3
\$\begingroup\$

I want to read the voltage of my 12 V lead-acid battery, and I want it to be isolated from my circuit. I came across the voltage follower op-amp topology. My schematic is shown below:

enter image description here

I am using the NE5532 op-amp. First, the battery input is fed to a voltage divider that goes from 0-12 V to 0-3.3 V using the voltage divider network R50 and R51.

The output of the voltage follower then goes to the ESP32 ADC input.

My questions are:

  1. Is there anything that does not look right in terms of how I set up the voltage follower?
  2. Are there any mistakes in general on how I am doing this?

Updated version:

enter image description here

\$\endgroup\$
5
  • 1
    \$\begingroup\$ You should still provide overvoltage protection at the output of the op-amp (Zener 3.3 V). NE5532 seems not to be rail-to-rail op-amp. TL081H or equivalent. \$\endgroup\$
    – Antonio51
    Commented Nov 4, 2022 at 9:04
  • \$\begingroup\$ @Antonio51 the Vcc ranges from 5 to 15V and the Vcc- ranges from -5 to -15 for both op-amps. How do you determine if the op-amp is rail to rail \$\endgroup\$
    – JoeyB
    Commented Nov 4, 2022 at 9:50
  • 1
    \$\begingroup\$ When this is the case, it is explicitely mentioned in the specifications. As your voltage range is 0 V to 3.3 V ... you need this. Moreover, I guess that your op-amp is supplied with the battery, so with 12V - 0 V or 3.3 V - 0 V. Rail to rail does matter. See @Spehro answer. \$\endgroup\$
    – Antonio51
    Commented Nov 4, 2022 at 13:35
  • \$\begingroup\$ @Antonio51 I will be the OP2348 op-amp. Is the output protection for the schematic shown in EDIT 2 okay? \$\endgroup\$
    – JoeyB
    Commented Nov 5, 2022 at 10:25
  • \$\begingroup\$ Added an answer with classical "protection". OP2348 seems a good choice ... \$\endgroup\$
    – Antonio51
    Commented Nov 5, 2022 at 15:22

3 Answers 3

1
\$\begingroup\$

With 0-12V power rails, the NE5532 can only reliably read input voltages of a few volts above ground in that configuration. This is shown on the datasheet as so:

enter image description here

For the follower to work, the output voltage must also be able to cover that range, but if the input doesn't work we need look no further.

Your suggested use of zener diodes to clamp the output will likely lead to large errors near the clamping voltage.

You may be able to do better by using a rail-to-rail input and output CMOS op-amp and high impedance divider, and by powering the op-amp from 0/3.3 and using the internal protection diodes to clamp the op-amp input avoid the necessity of using zeners. Alternatively, make a better clamp using a TL431, bias resistor and a 1N4148 diode, and avoid using the top of the voltage range of the ADC (maybe up to 2.3V rather than 3.3, which saves two resistors on the TL431 since it would clamp at 2.5+ 1 diode drop). Such a clamp can be applied to the input or output.

A high impedance divider (eg. megohm) can reduce the drain from the battery to well below the self-discharge current so it is negligible. An op-amp with very low input bias current (just about any CMOS rail-to-rail op-amp) is necessary.

\$\endgroup\$
4
  • \$\begingroup\$ I realized I made a silly mistake in my post. A lead acid battery's voltage range is actually from 9V to about 14.2V. Hence I can use a 3V3 and GND rails to power the op-amp. As you suggested at 14.2V the output of the voltage divider should be around 2.3V hence R50 is 51M and R51 is 10M. \$\endgroup\$
    – JoeyB
    Commented Nov 4, 2022 at 20:48
  • \$\begingroup\$ Is the above comment will work for the NE5532 op-amp? \$\endgroup\$
    – JoeyB
    Commented Nov 4, 2022 at 21:14
  • 1
    \$\begingroup\$ No, you should find a CMOS low-voltage RRIO op-amp. Eg. MCP6021. The clamp suggestion will work if you add a negative rail. \$\endgroup\$ Commented Nov 5, 2022 at 1:18
  • \$\begingroup\$ Thank you, I see the MCP6021 is not in stock, however, the OPA2348 from TI is in stock, which is a CMOS RRIO op-amp \$\endgroup\$
    – JoeyB
    Commented Nov 5, 2022 at 10:07
3
\$\begingroup\$

In principle the idea is okay. I have a few suggestions:

  • The divider resistors will drain the battery (~2 mA at 12 V). Considering the input bias current of the op amp, the divider resistors could have been larger to decrease the consumption (10x resistance can still work here).
  • I don't think you need to monitor the battery voltage every single millisecond. If you can take the measurement in, say, every second then you can place a series (preferably, high side) switch to the divider network so you can connect the divider before measurement, and disconnect after measurement. This will reduce the consumption further.

schematic

simulate this circuit – Schematic created using CircuitLab

The circuit above can be useful. After turning on the switch you may want to allow some time for the filtering capacitor, C10, to charge up.

\$\endgroup\$
1
\$\begingroup\$

Generally, input protection uses a Zener ... or classical two diodes and one resistor.
Resistor limit current. Diodes used are very "low leakage".
There is some post on this site explaining a little this method.
Example.

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ is there a reason why R1 is 2k2? \$\endgroup\$
    – JoeyB
    Commented Nov 5, 2022 at 21:03
  • 1
    \$\begingroup\$ Yes. Just to limit the max current into the diodes. If the input voltage goes to 5 V, for example, then the current into D1 should be 5-(3.3+0.6) / 2k2 = ~ 0.5 mA. If the input goes to -1.6 V, current should be ~ 1/2k2 = ~ 0.454 mA. Current through diodes can be as high as 5 mA, the resistor is just limited by the input impedance of the ADC. R1 should be not too high (something between 1k-2k2 is a good value, not critical). \$\endgroup\$
    – Antonio51
    Commented Nov 5, 2022 at 21:44
  • 1
    \$\begingroup\$ You can use also higher values for your R50 and R51. 10 times bigger should be ok. \$\endgroup\$
    – Antonio51
    Commented Nov 5, 2022 at 21:52
  • \$\begingroup\$ Just manufactured the PCB and I manage to get the ADC to a 0.2% error! Thank you for the assistance \$\endgroup\$
    – JoeyB
    Commented Nov 27, 2022 at 23:50

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.