Electrical – ACS712 Low Current Sensor

arduinocurrent measurementdcintegrated-circuitsensor

Before I begin, just to let you know that I'm new to electrical engineering, in case that my question sound weird to you, but here's my problem.

I bought few days ago ACS712 Low Current Sensor and hooked up everything on my Arduino board, but the values that I'm getting are weird.

From my understanding, the Vout from that sensor without any load should be 2.5v, right? And if there's any load, it should change.

However, I'm getting different values on Vout while I read them in my code (from 505 to 520) (as raw input without any analog to digital conversion). Is that normal? I thought I will get stable (constant) input value if there's no load?

How can I tweak that and how to convert it properly from that number into milliamps?

Best Answer

You would use a set of formulas like this:

$${ADC\_Value \over ADC\_MAX} \times ADC\_Volt\_Scale = ADC\_Voltage$$

You can see that this makes a ratio out of the read ADC value and the maximum value, then scales it by the maximum voltage that the ADC can read (this works for ADCs that start at 0V and go to some max voltage only!)

Now that you have the output voltage, you can offset it to zero, and divide the mV/mA conversion value:

$$(ADC\_Voltage - 2.5V) \div mV\_per\_mA\_CONST = Curent\_in\_mA$$

That should work in your case. If you have divider circuitry or other voltages in play, you might have to modify the formula to get what you want.