Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to measure current in variable power supply by using controller?

Status
Not open for further replies.

thannara123

Advanced Member level 5
Joined
Jan 7, 2010
Messages
1,580
Helped
122
Reputation
244
Reaction score
114
Trophy points
1,353
Location
India
Activity points
10,382
How to measure current in variable power supply by using controller?
if measure it by a shunt resistor how to calculate the current (Calculation ).
 

According Ohm's law, obviosly. 0.1 Ohm resistor under 1A current will give 0.1V voltage drop. Multiplying it by operation amplifier with fixed ratio 10:1 will give 1V to ADC. If adc accuracy is 10 bits, code value will be 2^10*1V/5V code.
 
In order to minimize power rating in the shunt and voltage drop, thus 75mV shunts are commonly used at rated current. 100mV is also common.
Common mode noise by careful design of traces should be reduced with shield tracks so that differential gain does not amplify common mode noise.

CMRR always drops with rising frequency so beware of datasheet specs and add ferrite CM choke if SMPS noise is high.

On the high side Differential Op Amps must have Rail to rail input common mode range.
On the low side, ground reference makes that easy as more Op Amps have CM range to ground or Vee.
 
Last edited:

My power supply voltage is 0 to 12 Volt and the maximum 3 A current .
if i use 0.1 ohm resistor the maximum voltage drop is 0.1*3= .0.3 volt.
How to scale it without using a op amp ?

0.3/1023 =.293810^-3 millivolt .

can i use as the following example like ?

maximum value 1024* 2.93 =300*10 = 3000 Milliampere . ( just for an example )

Can i make a 0.1 ohm resistor ?
How does calculate the wattage of the shunt resistor in my application ?
 

10 bit ADC with 5V power supply will give you 5mV accuracy (much less in real because of noise)
0.1 Ohm resistor under the 3A current will drop 0.3V. So, basicaly, you can measure it with ADC. Actual accuracy will be 5mV/0.1 = 50mA, but in reality about 200mA.
Next thing. Under maximum current 3A and voltage drop 0.3V shunt resistor will have to dessipate 0.9W of heat. Are you ready for that? )))

- - - Updated - - -

By the way, you can use ADC with 1.024V reference voltage. Thus, your accuracy will be 1mV and current can be theoreticaly measured +/- 10-20mA if layout will be good enought.
 

In my case the maximum voltage drop feed to controller will be 0.3 volt .
If that resistor will dissipate any good solution for it ?

- - - Updated - - -

I cant use referance voltage as 1.024V because one of the same ADC port is used with refferance 5 volt .:cry:
 
Last edited:

Show your circuit and I will design a circuit for you using OPA350 and post the circuit here.
 

Good attempt to make a spaceship from paper and glue, but I'm worring about you more and more.
 

Good attempt to make a spaceship from paper and glue, but I'm worring about you more and more.

why so sir ?

- - - Updated - - -

the following code is used to test run
Code:
 v =   read_adc(0);  // reading voltage    
   i =   read_adc(1);  // reading voltage for current  
   v = (v * 4.89 * 2.4)/10;
   i = (i * 2.92);
   i = ((i*4.89)/0.47)/10;
   
   current[0] =((i /1000)%10)+0x30; 
   current[1] = '.';
   current[2] = ((i /100) % 10) + 0x30;
   current[3] = ((i/ 10) %10) + 0x30;
   
   if(v< 1201)
   {
   
   volt[0] = ((v /1000)%10)+0x30;
   volt[1] = ((v /100) % 10) + 0x30;
   volt[2] = '.';
   volt[3] = ((v/ 10) %10) + 0x30;
   volt[4] = (v % 10) + 0x30 ;
   string(" Volt : ");
   for(int i =0; i<4;i++)
   lcd_data(current[i]);
 

Code:
{   
	
	unsigned char volt[5] ,current[5];
   DDRD = 0xFF;
   int v,i;
   char ch_sec =0;
    adc_init();
    lcd_init();
	string ("power supply");
	_delay_ms(50);
	lcd_cmd(0x01);
    //string("ADC Readed ");   
   v =   read_adc(0);  // reading voltage    
   i =   read_adc(1);  // reading voltage for current  
   v = (v * 4.89 * 2.4)/10;
   i = (i * 2.92);
   i = ((i*4.89)/0.47)/10;
   
   current[0] =((i /1000)%10)+0x30; 
   current[1] = '.';
   current[2] = ((i /100) % 10) + 0x30;
   current[3] = ((i/ 10) %10) + 0x30;
   
   if(v< 1201)
   {
   
   volt[0] = ((v /1000)%10)+0x30;
   volt[1] = ((v /100) % 10) + 0x30;
   volt[2] = '.';
   volt[3] = ((v/ 10) %10) + 0x30;
   volt[4] = (v % 10) + 0x30 ;
   string(" Volt : ");
   for(int i =0; i<4;i++)
   lcd_data(current[i]);
   
   LINE2
   string(" Current: ");
   for(int i =0; i<5;i++)
  lcd_data(volt[i]); // just displaying ADC value 
  
  }
  else
  {
  lcd_cmd(0x01);
   string("over voltage");
    }
  // while(1);
}

- - - Updated - - -

please guide me
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top