how to measure dc current through device

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
2K, 10K, 15K of what? What exactly is out there as the current load?

Ron
I want to measure dc current through the load and the load may be variable resistor it can give any resistance like 2K, 10K, 15K

Manually if i want to measure current through 2k load what would be output voltage of acs712 according to this diagram

upload_2018-9-8_20-24-59.png

There is only acs712 5v DC supply and 2K load

I have measured the output of acs712 with multimeter

acs712 input voltage 5v Dc
acs712 output voltage 2.5 DC with no load
acs712 output voltage 2.5 DC with 2K load

I have measured the output voltage 2.5 V with 2 K load if the output is 2.5 v that means no current is flowing through load. if i connect any load why the output of acs712 doesn't change
 
Last edited:

bertus

Joined Apr 5, 2008
22,278
Hello,

The ACS712-30 has a sensitivity of 66 mV / A.
With a 2K load on 5 Volts, you only have 2.5 mA.
This would result in a voltage of only 0.165 mV.
No wonder that you do not see any change.

Bertus
 

Attachments

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
Hello,

The ACS712-30 has a sensitivity of 66 mV / A.
With a 2K load on 5 Volts, you only have 2.5 mA.
This would result in a voltage of only 0.165 mV.
No wonder that you do not see any change.

Bertus
What size of load should be use to see the change in output
 

nsaspook

Joined Aug 27, 2009
13,315
I want to measure dc current through the load and the load may be variable resistor it can give any resistance like 2K, 10K, 15K

Manually if i want to measure current through 2k load what would be output voltage of acs712 according to this diagram

View attachment 159532

There is only acs712 5v DC supply and 2K load

I have measured the output voltage 2.5 V with 2 K load if the output is 2.5 v that means no current is flowing through load. if i connect any load why the output of acs712 doesn't change
To easily detect currents that low you need a better device and/or measurement equipment.
https://www.allegromicro.com/en/Pro...712-ACS713-Frequently-Asked-Questions.aspx#Q6
 

bertus

Joined Apr 5, 2008
22,278
Hello,

The datasheet states a range of 0.2 to 30 A for the 30 Amp sensor.
A load on 5 Volts for 0.2 A would be 25 Ohms.
This would give a voltage change of 13.2 mV

Bertus
 

Reloadron

Joined Jan 15, 2015
7,523
OK, then let's look at it. We are going to see a few problems as we look at this.Lets start with a 1K Ohm resistive load and a 5.0 VDC source. Using Ohms Law we get 5 Volts / 1,000 Ohms = 0.005 Amps, 5 Volts / 2,000 Ohms = 0.0025 Amps and obviously as we increase R (the resistance) the current A is going to decrease.

I see where bertus has contributed and that is where I was going with this.

You also need to consider your analog to digital resolution. You have a 10 bit A/D so you get the 1024 quantization levels mentioned earlier. so if 0 to 5.0 Volts equal 0 to 1024 bits then 5.0/1024 = 0.0048828 and the least step change you will see is about 4.9 mV That is not even considering noise and other inaccuracies in the A/D conversion process.

Ron
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
Hello,

The datasheet states a range of 0.2 to 30 A for the 30 Amp sensor.
A load on 5 Volts for 0.2 A would be 25 Ohms.
This would give a voltage change of 13.2 mV

Bertus
This is calculation for 20 ohms

acs712 input voltage 5v Dc
acs712 output voltage 2.5 DC with no load
acs712 output voltage 2.7 DC with 20 ohms load
 

bertus

Joined Apr 5, 2008
22,278
Hello,

With 5 Volts and 20 Ohms, the current will be 0.25 A
This will result in 0.25 X 66 mV = 16.5 mV offset.
So the output voltage will be 2.5 + 0.0165 = 2.5165 Volts and not the 2.7 you mention.

Bertus
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
Hello,

With 5 Volts and 20 Ohms, the current will be 0.25 A
This will result in 0.25 X 66 mV = 16.5 mV offset.
So the output voltage will be 2.5 + 0.0165 = 2.5165 Volts and not the 2.7 you mention.

Bertus
But my multimeter showing 2.6 volt dc
 

Travm

Joined Aug 16, 2016
363
as per my knowledge the voltage at the output of acs712 would be different not should 2.v DC with load

I am sure if i connect any load the output voltage of acs712 would be change that's what I want to see

For the experiment What should the value of load if i take 5v power from PI
Your load is so small its beyond the resolution of the sensor to change its output. You need to put a much larger load on it.
What you are trying to do wont work well. If your math says a 10k resistor @ 5v will change the output of this sensor, your math is wrong.
 

Reloadron

Joined Jan 15, 2015
7,523
You also need to make sure that your power supply driving the load can supply the required current. Your load should not really be sharing the same supply. The ACS712 uses isolation between the measurement plane and its supply and output. I am not saying using the same supply won't work but make sure your supply provides adequate current.

Also the -30 to 30 Amp version of the chip was a poor choice if you plan to measure low currents below 5 Amps as the 5 Amp version would have been much better suited for low current measurements.

acs712 input voltage 5v Dc
acs712 output voltage 2.5 DC with no load
acs712 output voltage 2.7 DC with 20 ohms load
OK if I apply 5 VDC across 20 Ohms I get 5 / 20 = 0.250 Amp. Remember your 10 bit best resolution is 5 / 1024 = 4.88 mV. At 66 mV per Amp the ACS712 should output 16.5 mV. So you get the 2.500 Volt out offset and we add 16.5 mV giving you 2.500 + 0.0165 = 2.5165 Volts. Leaving out your A/D conversion and with a focus only on the ACS712.

Read the data sheet for the ACS712 and determine the allowable error with this measurement? Now figure in the allowable error of your meter? In a perfect world your Vcc would be 5.000 Volts. The Vout offset is Vcc * 0.5 so is your Vcc exactly 5.0 Volts? Even if it is what is the allowable error? If you are going to expect to resolve milli-volts the numbers you posted above are useless.

Ron
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
Still I am struggling with calculation How do we get adc value ?

if I have

Supply voltage = 5 Volts
Load = 50 Ohms

the current will be

I = 5/50 = 0.1A

and 0.1 X 0.066 V = 0.0066V

output voltage will be 2.5 + 0.0066 = 2.5066 Volts

ADC value 512 = 2.5 V DC

if ADC is working with 5v Dc

What would be adc value for 2.5165 Volts
 
Last edited:

Travm

Joined Aug 16, 2016
363
Still I am struggling with calculation How do we get adc value ?

if I have

Supply voltage = 5 Volts
Load = 50 Ohms

the current will be

I = 5/50 = 0.1A

and 0.1 X 0.066 V = 0.0066V

output voltage will be 2.5 + 0.0066 = 2.5066 Volts

ADC value 512 = 2.5 V DC

if ADC is working with 5v Dc

What would be adc value for 2.5165 Volts
I expect the correct formula is in the data sheet.
 

Reloadron

Joined Jan 15, 2015
7,523
Each amp is 66 mV (0.066 Volt). With that in mind each 0.1 Amp (100 mA) is 6.6 mV. OK, you have that. The ACS712 Vout on the 30 Amp version has an offset of 2.5 Volts so with 100 mA you get 2.5 Volts offset plus 6.6 mV or 2.5066 volts.

Now the A/D conversion is with a 5.0 Volt Vref (Voltage Reference not Vcc) and a 10 bit analog to digital conversion (2^10) you get 1024 bits or quantization levels. Now 0 to 5.0 Volts becomes 0 to 1024 bits so each bit or count is equal to 5.0 / 1024 = 0.00488 Volts or 4.88 mV. Therefore 2.5 / .00488 = 512 bits. OK, so if I take 204.8 bits/volt I get 204.8 * 2.5165 = 515.3792 bits. Keep in mind this is not about Vsupply but about Vref on your ADC. Also keep in mind the allowable resolution.

Somewhere I have a 712 in my junk box. Let me set something up using an Arduino which I also have. Let me see what I get.

Ron
 

LesJones

Joined Jan 8, 2017
4,191
This is in answer to post #54.
1 bit (With a 5.00 volt reference to the ADC) = 5/1024 = 0.0048828125 volts.
So 2.5165 volts will give a count of 2.5165/0.0048828125 = 515.3792 The count can only be an interger so it should be 515 but there is always assumed to to be 1 bit uncertainty so it could read 516. As you are using such poor construction methods (Breadboard.) you are likely to have a larger error than 1 bit. I am still not clear what the specification of the device you a building is. At first it was supposed to measure AC and DC power but now it just seems to be for DC current. Can you give a clear specification. (I don't think I am the only one that is not clear on what you want.)
If it is any use to you I can post the schematic and code for a device using an IN219 (I^2C device which reads and current and voltage, that I built to monitor battery charging, It uses a PIC12F1840 and outputs the information as an ASCII text string which can be read on a PC running a terminal emulator program.

Les.
 
Last edited:

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
This is in answer to post #54.
1 bit (With a 5.00 volt reference to the ADC) = 5/1024 = 0.0048828125 volts.
So 2.5165 volts will give a count of 2.5165/0.0048828125 = 515.3792 The count can only be an interger so it should be 515 but there is always assumed to to be 1 bit uncertainty so it could read 516. As you are using such poor construction methods (Breadboard.) you are likely to have a larger error than 1 bit. I am still not clear what the specification of the device you a building is. At first it was supposed to measure AC and DC power but now it just seems to be for DC current. Can you give a clear specification. (I don't think I am the only one that is not clear on what you want.

Les.
I want to measure dc current through the load. System should be able to measure minimum 0.2 A current and Maximum 30 A current and the load may be variable resistor it can give any resistance like 50, 100, 1000 etc.

For Example if given

Supply voltage = 5 Volts
Load = 50 Ohms

system should calculate current

I = 5/50 = 0.1A
 

bertus

Joined Apr 5, 2008
22,278
Hello,

At 0.2 A using 5 Volts the load resistance will be 5 Volts / 0.2 Amp = 25 Ohms.
At 30 A using 5 Volts the load resistance will be 5 Volts / 30 Amps = 0.166666666 Ohms.

When you want to have 30 Amps into 15 K Ohms, the voltage would be 30 Amps X 15000 Ohms = 450000 Volts.
The power into that resistor would be 30 Amps X 30 Amps X 15000 Ohms = 13500000 Watts.

Bertus
 

Travm

Joined Aug 16, 2016
363
I want to measure dc current through the load. System should be able to measure minimum 0.2 A current and Maximum 30 A current and the load may be variable resistor it can give any resistance like 50, 100, 1000 etc.

For Example if given

Supply voltage = 5 Volts
Load = 50 Ohms

system should calculate current

I = 5/50 = 0.1A
The system will do that. It sounds like its working fine. You measure 2.5v @ 0A, and you measure 2.5V @ 0.0002A. If you want to test this, hook up a load and test it.
 
Top