I want to measure the current of 12V lead acid battery for charger application. So mostly, I need bidirectional current sensing. The current measurement can be done using shunt resistor or using hall effect sensors. I see the shunt current sensors comes with I2C or SPI analog output. But the ACS712 can be directly hooked up to the analog pin of MCU.

Do I need to use any op amps here to maintain the current gain? Or just use ACS712 sensor hooked up directly to the battery terminals and sensor output terminals to the MCU?

  • \$\begingroup\$ (1) You might find the following Q&A useful: Rpi Current Sensing Using ACS712 and INA219 raspberrypi.stackexchange.com/questions/94403/…. (2) You need ADC, but no opAmp. (3) You need different current sensors for different test ranges. \$\endgroup\$
    – tlfong01
    Jan 11, 2021 at 9:22
  • \$\begingroup\$ If in case I need two measure four battery currents at a time with ADC of STM32. Now the ACS712 cannot be used instead we use INA219 using I2C. Is this operation possible. I feel I2C in STM32 is tough. \$\endgroup\$ Jan 11, 2021 at 10:28
  • \$\begingroup\$ For battery charging applications, there are other current sense amplifiers with dedicate charging/discharging output signals, eg, CJMCU-4080 MAX4080SASA Current Sense Amplifier - €1.56 th.aliexpress.com/item/1005001355840165.html \$\endgroup\$
    – tlfong01
    Jan 11, 2021 at 14:41
  • \$\begingroup\$ I just need a suggestion that for measuring the battery voltage, we can directly use voltage divider or is it better to use voltage sensor. \$\endgroup\$ Jan 12, 2021 at 11:03
  • \$\begingroup\$ Neither SPI or I2C are "analog". they are both digital busses. \$\endgroup\$ Oct 26, 2022 at 16:27

1 Answer 1


ACS712 has 3 different types. These are 5A, 20A and 30Ampere versions. The sensitivities are 185 mv/A , 100mv/A and 66mV/A . Actually if these values are good for your system, just hook up the VIOut pin directly to MCU ADC input pin. Be sure VDD of ACS712 is same as VADC voltage of MCU.enter image description here

If you need more you can use amplifier circuit for increase the sensitivity up to 610mV/A.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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