Op amp input voltage - Page 1
Forum section: electronics / projects

author: PatrickJC
author_rank: Newbie
timestamp: April 15, 2025, 02:20:23 pm
content: Hi,I am working on a project where I need to get a rough estimate of a 12V or 24V lead acid battery in construction vehicles. I can't use a fuel gauge or battery monitor because the battery will never be fully depleted and fully charged over multiple cycles. I decided to use inverting op amps to reduce the voltage so the ADC on the MCU I'm using can report the voltage. I know this will not be an accurate representation of the charge remaining on the battery. I just need a rough estimate while the vehicle is turned off for a long period of time.For the op amp it is easier, more cost effective and more space efficient to use +5V and -5V for the supply. Since the max input voltage to the negative input could be +28V to the negative input I'm using a voltage divider to reduce the input below +5V.My question is, is it actually necessary to use the voltage divider to reduce the voltage? I know for most op amp the input voltage cannot excided the supply voltage. But where the positive input is grounded and op amps try and make the voltage of both the input terminals the same, will the input voltage on the negative terminal be almost 0V? Or am I misunderstanding the fundamentals of op amps?Thanks for the help!

author: Zero999
author_rank: Super Contributor
timestamp: April 15, 2025, 02:46:48 pm
content: Why not use a single potential divider?If the ADC requires a low source impedance, then add a unity gain buffer.

author: ledtester
author_rank: Super Contributor
timestamp: April 15, 2025, 04:47:57 pm
content: How much did you want to scale the battery voltage by?Note that the effect of the R5-R9 voltage divider and the first op-amp is a division of the battery voltage by a factor of about -1000, i.e. an input voltage of 24V results in U15 outputting around -24mV.

author: Zero999
author_rank: Super Contributor
timestamp: April 15, 2025, 06:19:55 pm
content: To analyse the circuit.R5, R9 and R24 form a potential divider.R24 and R9 are in parallel, so their value is:R = (R24+R9)/(R24*R9) = (100k*10k)/(100k+10k) = 1000k/110k = 9.09kFor a potential dividerVOUT= VIN*RL/(RH+RL)RH= R5 = 1M = 1000kRL= 9.09kVOUT= VIN* 9.09k/(1000k+9.09k) = 9.09k/1009.09k = 0.009The op-amp has a gain of RF/RINand is inverting, so the input is divided by another factor of ten and inverted, which is then inverted again by the other stage, so the total gain of the circuit is 0.0009.

author: David Hess
author_rank: Super Contributor
timestamp: April 15, 2025, 08:43:09 pm
content: Quote from: PatrickJC on April 15, 2025, 02:20:23 pmNo divider is required in inverting mode because feedback will hold the inverting input at ground in your case.Difference amplifiers which can handle very high common mode voltages are sometimes made with a pair of inverters for the same reason.

author: Zero999
author_rank: Super Contributor
timestamp: April 16, 2025, 08:04:00 am
content: Just use one op-amp and a potential divider.The following resistor values will give the same attenuation as your circuit.R1 = 1M1 or 1M and 100k in series.R2 = 10k

author: Andree Henkel
author_rank: Regular Contributor
timestamp: April 16, 2025, 09:39:24 am
content: It is possible to use inverting OPA in an inverting "attenuator" configuation, where feedback resistor is much lower than input resistor.But as you need same amount of components this way as in Circuit shown by Zero999.The inverting attenuator configuration tends towards being unstable, which can be countered by using suitable sized feedback cap.But circuit shown by Zero999 doesn´t have that potential instability (ofcourse assuming unity gain stable OPV).

author: Zero999
author_rank: Super Contributor
timestamp: April 16, 2025, 09:49:09 am
content: Quote from: Andree Henkel on April 16, 2025, 09:39:24 amWhy do you think that?An inverting amplifier has a higher noise gain, than the equivalent non-inverting amplifier and therefore should be more stable. For example an inverting buffer, i.e. gain of 1, has a noise gain of 2, whereas a non-inverting buffer has a noise gain of 1.If the op-amp isn't unity gain stable, it can be stabilised by adding a couple of resistors and a capacitor to set the high frequency noise gain to an acceptable level. See the thread linked below.https://www.eevblog.com/forum/beginners/op-amp-spec-noise-gain-configuration/

author: bson
author_rank: Unknown
timestamp: April 17, 2025, 08:16:43 pm
content: Doesn't the MCU input have a buffer? You might perhaps only need the divider and a small cap to the ADC ground (GNDA) on the input.

author: UnijunctionTransistor
author_rank: Frequent Contributor
timestamp: April 18, 2025, 09:01:44 pm
content: You mention that you are planning to divide down "below 5 volt".How far below 5 volt?addtionally; What are you planning to use as the voltage reference for the uC's ADC? Will it be the uC's supply voltage or a voltage reference?If you use a common 4.096V reference, then a 7:1 divider will provide a 28.672V full scale range.

author: Zero999
author_rank: Super Contributor
timestamp: April 19, 2025, 09:35:29 am
content: It appears the original poster has lost interest. Hopefully he'll be back after Easter.He didn't say why what the output voltage needs to be. I forgot to post a link to the calculator website, I got the schematic in my previous post from. It can be used to determine the values of R1 and R2 for different input and output voltages.https://www.ti.com/download/kbase/volt/volt_div3.htm

author: PatrickJC
author_rank: Newbie
timestamp: April 24, 2025, 07:24:33 pm
content: I think I over complicated the solution, thanks for the suggestion!

author: PCB.Wiz
author_rank: Super Contributor
timestamp: April 24, 2025, 10:31:59 pm
content: Quote from: PatrickJC on April 15, 2025, 02:20:23 pmMost designs would first try to use +5V only, to be reallyeasier, more cost effective and more space efficientQuote from: PatrickJC on April 15, 2025, 02:20:23 pmYes, some form of divider is needed, but notice R24 & R34 already form a divider.You do not normally needtwodividers.The circuit of #5 is the common/simplest way to do this. Some MCUs may not need an opamp.

author: Terry Bites
author_rank: Super Contributor
timestamp: April 25, 2025, 12:58:35 pm
content: As noted, all you need is a voltage divider and a buffer. Use a single supply low voltage RIRO. eg MCP6497. That TI part will be on the edge of its minimum Vdd @ 5VAn opamp buffer stage is much cheaper to replace than the MCU.Add input over voltage protection diodes.Get rid of the -5V while you're at it, that could kill your ADC. Its a good idea to power the buffer from the MCU Vdd. That stops you overvolting the ADC input.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 25, 2025, 03:12:50 pm
content: One mayor design consideration is the current though the initial voltage divider. For bigger (solar?) systems this does not matter much, but when you have coin-cell sized batteries it can be important. And Opamps also draw (continuous) current. Often you can use a high ohmic voltage divider (10 MOhm or so) and then add a capacitor on the output, and then directly to the ADC. Most ADC's have capacatively coupled inputs, and the extra capacitor swamps the capacitive input of the ADC. Big resistors combined with a "sizable" capacitor form a low pass filter, but your battery voltage is unlikely to change fast. An RC time constant of a few seconds is not a problem for battery voltage monitoring.