Current sensor ACS712

My project requires measuring current ranging from 30mA to 500mA. Is this circuit correct for the purpose?im using the ACS712 breakout board based amplifier circuit.

Initially i tried testing the amplifier circuit by giving an input voltage of 100mV then 500 mV followed by 1V. In each case the output voltage i received was 4.91V(since vcc is 5V).
After doing some research online i found that the Vin+ pot (reference voltage) limits the output between the rails.
i also observed that as i get the reference voltage closer to the input voltage(Vin-) the output voltage reduces.
One thing im not able to figure out is that in all of this process my gain pot wouldnt respond atall. i dont know if what im doing is wrong nor am i able to find a solution. What should i do?

hi @AndyW, yes im aware of that. but im stuck with the amplifier circuit itself. i have been measuring the voltage on a DMM so be sure if the circuit is working. since my amplifier circuit is based on the sparkfun low current sensor breakout board i thought i should ask you guys first.
Once the ciruit starts giving required output i can interface it with RPi. Can you help me with the amplifier?

@suvrat, I am not sure how you did this with the ACS712 in circuit. The device detects currents so applying a voltage to the sensor inputs will not do anything (since the ACS712 input effectively creates a short circuit). You would need to have a resistor limiting the current through the ACS712.

The first setting you need to make is with the R4 trimpot. This sets the zero current output. Since the ACS712 can sense current in both directions, the output is biased at 1/2 Vcc or 2.5v. Since your ADC can handle a 5V input, adjust the trimpot so the output is 2.5v or so. The most "dangerous" adjustment is the R3 trimpot which sets the gain. I believe the Sparkfun sensor has a sensitivity of 185mv/Amp. At 500ma, the output of the ACS712 should be 93mv or so.

So, with a zero current of 2.5v (or so), the maximum range on either side of that is 2.5v. Hence, the maximum gain (for 500ma max input) is 2.5/0.093 or about 27. Anything higher will "saturate" the output to Vcc or 5v. Additionally, if you exceed 500ma input current at that max gain will cause saturation as well.

In order to configure the board first short the inputs to the ACS712 so you get zero current and then set R4 to the desired mid-point voltage. Next, using either a bench supply or a 1% or better resistor, connect a voltage source and resistor to the input of the ACS712 so a known current is flowing through the resistor and the ACS712. Assuming you can set this up for 100ma, then the output of the board with the max gain above should be (zero current voltage) + (185*0.1)mv * 27 = 2.5+.3 = 2.8v.

It is important to remember that the ADC count will have an offset based on your trimpot setting outlined above. So assuming you set the zero current voltage to 2.5v, the ADC output will be about 2047 for a 12 bit ADC. You need to consider this in your code.

I hope this helps! Oh, and as @AndyW pointed out, this forum is not for Sparkfun products either! :stuck_out_tongue_winking_eye:


This is “spark” not “sparkfun”.

Here is the forum on their site dedicated to that design.

[trying to be helpful here, not negative - there’s a lot of knowledge here, and great people, just trying to point you to resources that can help you best.]


@peekay123, I should mention this, that i have made a circuit like the breakout board using the circuit diagram. so I had not connected the ACS712 in the circuit at all. i wanted to test the circuit and also understand the functioning of the trimpots.
Now reading your reply i have understood exactly where i went wrong and and how should i proceed with connection. Thanks a lot. I shall let you know if i succeed ! :wink: :slight_smile: :smiley:


@AndyW, Oh yeah, my bad!! :slight_smile:
And this forum has helped a lot in terms of knowledge. Thanks a lot! :smiley:


i connected a 9V adaptor (max 1A current rating) with a 56 ohms resistor(~~161mA current) followed by a DMM to measure the current flowing through the ACS712.
When i switched on the circuit my DMM shows ) 0A current and output of the acs712 was some random value around 13mv.

Then i connected an led(with pre-connected 1k resistor) in the circuit, the led didnt glow. When i removed the DMM, the LED glowed. This happened with 2DMMs.

Am i doing something wrong or is there something i am not doing?

@peekay123 @AndyW I have a query. When the ACS712 input is not connected(no connection between Ip+ and Ip-) or shorted should i get 2.5V at the output of the ACS712(Vcc is 5V)?
When i connected an external source with a potentiometer(1K) to manage the current input all i get at the output is 2.5V. Nothing seems to be happening. What could be the issue?

@suvrat, can you post of picture of your setup? One of the things you need to remember is that the raw output of the ACS712 is 2.5v when zero current flows. The ACS712 outputs 185mv/A of current so at 161ma, the output will be 185mv * (161/1000) = 30mv. So you will only see 2.5v +/- 30mv depending on the current flow direction. To see a more sizable output, you will need to increase the current.

@peekay123 Since i require to measure current ranging from 30mA to 500 mA the input to the amplifier will be 5.55mV to 92.5mV.

how do i manage the gain part since the current will keep rising gradually which i will be plotting in real time(later part of the project)?
For 100 mA of current gain will be 2.5/0.0185 which would be 135. And max gain i have is 47. I may be wrong in with concept. If the gain part is figured out keeping in mind the saturation voltage of output(5V), gain limit(47) then i think my circuit will be complete.

The gain is fixed and set by the trimpot R3. The gain is set ONCE so that the maximum current you will measure will give you the maximum voltage or close to it. In this case your maximum current is 500ma, so for 5V output the gain is 27. Try stuff out and figure the rest out for yourself :wink:

1 Like

@suvrat, have you considered using a shunt based current measurement? I have used hall sensors in the past and transitioned to shunt based sensors. Take a look at this part:

Hi everyone,

I know that I am very late, but I try a question: Like suvrat, I am using the ACS712 low current in an application. Adjusting the mid-point-voltave of 2,5V is very difficult. For me, it is rather impossible to turn the R4-poti that fine. Only a little bit more left or right, the amplifier output turns either to 4.95V or down to nearly 0V. So, getting the 2,5V output is nearly impossible. Even touching the R4 with my finger, the output voltage is changing at once.

Do you have a hint for me, please?

Thanks in advance

How have set the GAIN on R3?

I think the gain is at the minimum (R3 is turned clockwise to the right end). Here in this position I can adjust the output voltage to 2,5V. As soon as I rise the gain, the output voltage goes into saturation.

Have you shorted the input terminals of the sensor to calibrate the 2.5V center point?

When you keep them shorted and then turn gain up, how far can you go?

I’ve now shorten the input terminals and adjustet the output voltage (is it normal, that the adjustment of the output voltage is that sensitive?) to 2,5V. Now I can rise the gain up to about 20, then the saturation starts. Anyhow, the behaviour of the breakout board is better than before.

@Ramon, before you go much further, remember that the ACS712 board you are using was meant to work at 5v for an Arduino. Thus the midpoint of 2.5v. The ADC on the Photon has a maximum input voltage of 3.3v so the midpoint is 1.65v, NOT 2.5v. Furthermore, whatever gain you use, the output voltage cannot exceed 3.3v or you will damage the ADC input.

1 Like

There would be 3V3 capable boards too
e.g. Pololu - Current Sensors

This depends on environmental factors like temperature and also electrical like a the quality of your power supply.

@ScruffR, excellent suggestion! I personally found that ACS712 board a pain to use. The Pololu boards you pointed to are an excellent choice though sensitivity will need to be considered. @Ramon, what current range are you trying to measure?

1 Like