0
\$\begingroup\$

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?

\$\endgroup\$
  • 1
    \$\begingroup\$ If you are running the ADC in a mode where full scale is 1024, then values ranging from 505-520 sound rather normal for a circuit which probably has some electrical noise. You can explore better supply biasing, and both electrical and software filtering. \$\endgroup\$ – Chris Stratton May 23 '16 at 0:55
  • \$\begingroup\$ Ok and let say that this number is ok, how can I convert it into milliamps? \$\endgroup\$ – ShP May 23 '16 at 0:58
  • \$\begingroup\$ The present number appears likely to be the center once noise is removed. But for a number with an actual offset, you would convert it to a voltage using the ADC range relationship and convert that to a current using the information on the ACS712 data sheet. \$\endgroup\$ – Chris Stratton May 23 '16 at 1:08
  • 1
    \$\begingroup\$ "as raw input without any analog to digital conversion" - this makes no sense. The raw input is an analog voltage, not numbers. The numbers you read (from 505 to 520) are the raw output of the ADC. They will vary due to noise in the sensor and in the ADC, power supply etc. To get stable numbers you will have to take several readings and average them. \$\endgroup\$ – Bruce Abbott May 23 '16 at 3:22
1
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.