how to measure dc current through device

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
So with all of this do we have it yet? Things making sense? :)

Ron
I want to make system that would measure dc current through the load. I have DC adopter and potentiometer. if I set the potentiometer at any resistance system should be able to measure dc current through the load
upload_2018-9-9_9-3-39.png

specification of DC adopter

Input: 100-240 V AC 50/60 Hz
Output: 5V, 2.0A (2000 mA).

I have following things on my table
  • Raspberry Pi 3
  • ACS712 30 A
  • MCP3008
  • DC adopter 5 V
  • Potentiometer
 

bertus

Joined Apr 5, 2008
22,937
Hello,

Is the potentiometer the only load?
When the potentiometer is turned to almost 0 Ohms, the potentiometer will burn out.

Do you want to "measure" the potentiometers position?

Bertus
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
If you only have a 2 amp power supply why are you designing for a maximum current range of 30 amps ?

Les.
because now I don't have power supply that can give 30 A current that's reason just using 5v DC adopter to simple test
Hello,

Is the potentiometer the only load?
When the potentiometer is turned to almost 0 Ohms, the potentiometer will burn out.

Do you want to "measure" the potentiometers position?

Bertus
I want to measure current through at different resistance. so i though potentiometer is one of choice

Please look post #62 there is diagram

I want to make system that will tell the load current flowing through device

At 0.2 A using 5 Volts the load resistance will be 5 Volts / 0.2 Amp = 25 Ohms.
At 2 A using 5 Volts the load resistance will be 5 Volts / 2 Amps = 2.5 Ohms
 
Last edited:

bertus

Joined Apr 5, 2008
22,937
Hello,

What will be the lowest and highest load resistance values?

When your powersupply can not deliver more than 2 Amps, use a ACS712 5 Amp version.
That will give you more output signal.
Also a higher resolution ADC like the MCP3208 will help.

Bertus
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
Hello,

What will be the lowest and highest load resistance values?

When your powersupply can not deliver more than 2 Amps, use a ACS712 5 Amp version.
That will give you more output signal.
Also a higher resolution ADC like the MCP3208 will help.

Bertus
I have mcp3008 and ACS712 30 Amp version on my table

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

bertus

Joined Apr 5, 2008
22,937
Hello,

If you want "full" range for 2 Amp, you could amplify the output signal of the ACS.
You would need a rail to rail opamp.
The output signal of the ACS is 66 mV / A.
So at 2 Amp the signal will be 132 mV.
If you want 2.5 Volt range at 2 Amp, you would need to amplify the signal about 15 times.

Bertus
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
Hello,

If you want "full" range for 2 Amp, you could amplify the output signal of the ACS.
You would need a rail to rail opamp.

Bertus
I think I can measure measure 0.2 A - 2A current in the voltage range of 2.5-5V.

Supply voltage = 5 Volts
Load = 20 Ohms

the current will be
I = 5/20 = 0.25A

and 0.25 X 0.066 V = 0. 0165V

output voltage will be 2.5 + 0.0165 = 2.5165 Volts

I want to compare reading of current on the paper and reading taken by program

Load : 20 Ohms
ACS712 Voltage : 2.5165 Volts
ADC value :
Load Current : 0.25A

I am confused to calculate adc value what would be adc value of 2.5165 Volts ?
 
Last edited:

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
The answer to the last line of your post #69 was answered in post #57 (Line 3)

Les.
It's big progress i really appreciate all of your help and support. I think I can determine the following calculation on paper

Load : 20 Ohms
ACS712 Voltage : 2.5165 Volts
ADC value : 516
Load Current : 0.25A

Now I would like to discuss on the part of circuit What I have to reduce noise
 

Reloadron

Joined Jan 15, 2015
7,892
Hello,

Is the potentiometer the only load?
When the potentiometer is turned to almost 0 Ohms, the potentiometer will burn out.

Do you want to "measure" the potentiometers position?

Bertus
You may want to give what is covered in there some thought. When you start looking at load currents and load resistances you also need to consider power. 5.0 Volts at 2.0 Amps for example would be a 2.5 Ohm resistance but what else? I also see 10 Watts so any small potentiometer when that resistance gets low will start getting real hot real quick and needs to be able to dissipate the power expressed as watts. Even in your above example:
Load : 20 Ohms
ACS712 Voltage : 2.5165 Volts
ADC value : 516
Load Current : 0.25A
Even a low 5.0 Volts * 0.250 Amp = 1.25 Watts so your 20 Ohm resistor needs to be rated well above 1.25 Watts like maybe a 3 to 5 watt resistor. The problem is as heat is generated the resistor gets hot and then the resistance increases and your current decreases.

There are also other tips and tricks which can be used to improve the uncertainty of your measurements like taking multiple sample averages and knowing exactly what your Vref is. That all comes later.

Ron
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
There are also other tips and tricks which can be used to improve the uncertainty of your measurements like taking multiple sample averages and knowing exactly what your Vref is. That all comes later.

Ron
Do you have any suggestion regarding circuit to reduce noise ?
 

Reloadron

Joined Jan 15, 2015
7,892
Hello,

Did you read page 13 of the datasheet?
There you will find information on filtering the signal.

Bertus
There have been no less than about a dozen references to the data sheet including the manufacturer's stating the ACS712 should no longer be used for new design. I also suggest you read the Wikipedia Analog-to-digital converter as it is informative. You can't just jump into A/D conversion without any understanding of some of the basic fundamentals. You need to read and more importantly understand data sheets because the question you just asked is well addressed in the data sheet. When you don't understand the data sheet then by all means ask questions.

Ron
 

Thread Starter

Fanfire174

Joined Mar 13, 2018
240
This is my mobile charger I opened it for testing circuit I don't have any other connector
pi4.jpg
How to identify which wire is for 5v DC output
pi8.jpg
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,892
You start with a Google of USB Pin Out. Again keep in mind you are using a +/- 30 Amp current transducer to measure at best several hundred mA. A USB 2 which you pictured only has 4 leads, a DATA + and - and a common and +5 Volts. Use a hand held multi-meter to make sure you have the correct wires. Also you can ring the cable out measuring resistance.

Ron
 
Top