Arduino & acs712

Hi !

My arduino is powered by an external battery ans I'm searching a way to measure the remaining capacity.

I wonder if it's possible to do it with acs712 sensor.

Any advise about this solution ?

Thanks in advance

Use a voltage divider of about 100kOhm to battery+, 100kOhm to battery-; middle of those connected resistors goes to your Analog input. (For LiIon and NiMH batteries. For higher voltage batteries you need to use different values to move the voltage into the Vcc-range of your Arduino.)

Just read out the value over the voltage divider and multiply by (5000/1023) -> mV Vcc / 1023 resolution of the ADC. That's your current voltage in mV. Then take a look at the discharge curve of the batteries in use and make a formula to represetn full/empty form it.