Help with battery monitor circuit? - Page 1
Forum section: electronics / projects

author: TERRA Operative
author_rank: Super Contributor
timestamp: July 28, 2018, 06:57:03 am
content: I have the following circuit I am trying to get working.Basically, it has 2x 9v batteries in series for 18v, under normal operation, the green LED should be on, and when the voltage gets down to 16-ish volts, the green LED should turn off and the red LED turn on.It doesn't seem to be working though, the red LED doesn't turn on at all, and the green LED just fades out as the voltage drops.I know it has to be something simple, but my head is not getting into gear...Can anyone poke me in the right direction?

author: Ian.M
author_rank: Super Contributor
timestamp: July 28, 2018, 09:13:13 am
content: Q1 never switches off as even when the Zener stops conducting its still got base drive, so the rest of the circuit doesn't work properly.

author: TERRA Operative
author_rank: Super Contributor
timestamp: July 28, 2018, 10:12:32 am
content: Hmm, how can I fix that? Do I have to re do the circuit, or can I just change component values?

author: mikerj
author_rank: Super Contributor
timestamp: July 28, 2018, 10:21:03 am
content: Swap the positions of R7 and D1.

author: TERRA Operative
author_rank: Super Contributor
timestamp: July 28, 2018, 11:03:30 am
content: Cool, makes sense.I swapped them and it is working, except for one thing... Which I think is a characteristic of the zener maybe...It seems that there is an overlap of the green and red LED's being illuminated at the same time between 17V and 18V.ie. above 18v, only the green LED is lit, at 18v the red led starts to illuminate and the green starts to turn off, with the red gradually fading on and the green off down to 17V where the red is fully on and the green is completely off.Is there any way to make a sharp transition at a set voltage, say 16V?

author: sourcecharge
author_rank: Regular Contributor
timestamp: July 28, 2018, 11:36:18 am
content: Quote from: TERRA Operative on July 28, 2018, 11:03:30 amuse a 15V zener?https://www.digikey.com/product-detail/en/on-semiconductor/1N4744ATR/1N4744AFSCT-ND/1626121

author: JS
author_rank: Frequent Contributor
timestamp: July 28, 2018, 01:45:27 pm
content: Resistor and 15V zener right next to a 15V regulator? Why not go from the base resistor to the 15V rail, that rail should behave much stable than the knee of the zener.JS

author: Ian.M
author_rank: Super Contributor
timestamp: July 28, 2018, 03:35:51 pm
content: Its still going to be mushy, as the Vbe of the transistor follows an exponential.The true answer is you need a comparator. Its possible to cobble something together with a couple of transistors used as a long tailed pair, with one's base held at a fixed potential relative to +batt using a Zener, and the other's base fed via a potential divider, then add enough positive feedback to get a snap action without getting excessive hysteresis, but component values will be critical and 'tuning' the circuit for the right setpoint may be tricky.I'm assuming its a requirement to use a common cathode dual LED. Two separate LEDs would be a bit simpler.Its really not worth faffing around with discretes for this. Either use a proper dual comparator with push-pull outputs or a dual OPAMP. It can be powered from the +15V rail. You need a reference voltage that wont start dropping when the regulator browns out, so you still need a resistor and Zener (unless you have a lower regulated rail available. Use a potential divider to bring the battery voltage down to the reference voltage, and set up one comparator (or OPAMP as comparator) to drive one of the LEDs (+ series resistor) direct. Use the other comparator as an inverter, -in from first output, +in from reference voltage, to drive the other LED.

author: not1xor1
author_rank: Frequent Contributor
timestamp: July 28, 2018, 05:04:24 pm
content: There are a couple of quite basic battery monitor circuits in most TL431 datasheets

author: JS
author_rank: Frequent Contributor
timestamp: July 28, 2018, 08:37:00 pm
content: You could add hysteresis to that circuit but changing a few connections, I know pcb is probably made but you only need to swap the led on the right with its series resistor and take the reference between them for the zenner, you might have to tweak some values but thats some possitive feedback which will make the seitching more pronounced even with no comparator IC, as you are bassically doing that. The only problem with the circuit is that you are using a comparatpr between the VBE of the transistor and something that change too slow, so the things operate in a linear way for some time, once it's start to change but not quite. With possitive feedback you force that switching moment to be more well defined, as it starts to switch moves the reference in a favorable way for the switching to occur.JS

author: Ian.M
author_rank: Super Contributor
timestamp: July 28, 2018, 09:21:11 pm
content: I hacked a two transistor long tailed pair comparator circuit together in LTspice, with 'snap' action switching, centered on 16V with about 0.2V total hysterisis. It also stabilises the LED current at about 10mA over quite a wide supply voltage range. However I don't *like* it as IMHO its excessively sensitive to component tolerances including the red LED Vf, is a PITA to adjust and uses too many parts (compared to a dual OPAMP or comparator IC based circuit). Sim attached.

author: Paul Price
author_rank: Super Contributor
timestamp: July 29, 2018, 03:43:39 pm
content: Use a PIC12LF1571, only 8-pins, works at 1.8V. Has built-in 1.024V reference, 10-bit A2D, can wake up from sleep every minute or less(< 20uA current use in sleep) to measure battery voltage, and as a plus, can slowly blink an undervoltage battery indicator LED to save what's left of the battery while still giving a reliable battery indication. A 1.8V Von red LED can provide voltage regulation for the MCU.

author: TERRA Operative
author_rank: Super Contributor
timestamp: July 30, 2018, 04:51:19 pm
content: Alrighty, I got myself some LM358's today, so I'll crack out the breadboard and see what I can come up with...Brace yourselves for more stupid questions!