Improving a TL431 Window Comparator with Hysteresis - Page 1
Forum section: electronics / projects

author: Echo88
author_rank: Frequent Contributor
timestamp: September 02, 2020, 05:01:25 am
content: I needed a cheap circuit which decides wether an input voltage is in an acceptable range and consequently switches a MOSFET to connect the input voltage to a load (Undervoltage/Overvoltage Lockout).So i decided to adapt some TL431 in window comparator configuration for that task, based on the following circuit suggestion:https://electronics.stackexchange.com/questions/47154/low-battery-indicator-for-2x-aa-batteries?noredirect=1&lq=1(second circuit)However, since the input voltage might vary a bit the circuit needs some hysteresis, which i couldnt successfully implement/the output still shows instability.I found another TL431 comparator suggestionhttps://www.edn.com/shunt-regulator-monitors-battery-voltage/with hysteresis and based on that i cobbled together another circuit, which seems to work and is stable. Might be improved in values or contain problems in real life though.Both circuits are included in the attached .asc document and id like to know if someone can enlighten me on how to implement hysteresis on the bottom circuit, to get a stable output like the top circuit shows.Just watch Vout/Vout2 and youll see the mentioned instability at the switching endges in the bottom circuit. The sine voltage source is used to simulate voltage variation.Or maybe there are other suggestions for low cost/simple UV/OV-LO-circuits, without needing to use more expensive LT4356/LTC4365 for example.Thanks.

author: magic
author_rank: Super Contributor
timestamp: September 02, 2020, 05:52:34 am
content: Since it seems you already need two TL431, not just one...Dunno, use a normal dual comparator with the usual hysteresis solution and open collector outputs or diodes to NOR the two outputs?

author: Ian.M
author_rank: Super Contributor
timestamp: September 02, 2020, 07:03:59 am
content: A TL431 closely resembles an OPAMP with an open collector output, with its +in internally connected to a 2.5V reference and not user accessible. As the only input you have is the -in, all DC feedback is inherently negative and therefore hysteresis, which requires positive feedback is impossible without another active device acting to invert its output. If you are using it to pull down a P-MOSFET pass transistor gate, its tempting to tap additional feedback from the drain, but that can result in load dependent instability, so its much safer to use a separate small signal P-MOSFET to bypass part of the upper part of the feedback divider or switch in a high value resistor in parallel to achieve the shift in setpoint required to proviide the required hysteresis band. The EDN circuit you linked works on the same principle but increases the part count by using a PNP BJT, which needs base resistors.The StackExchange TL431 window comparator is from a depreciated (2004) copy of the Texas Instruments TL431 datasheet. Thecurrent datasheet(rev. 2018) totally omits any such circuit. I believe that would be because its fundamentally flawed - depending on tolerances there's no guarantee that the left TL431's output low level is below the reference voltage of the right TL431. To fix it you need to insert an extra resistor in the middle of the R1B, R2B divider chain with the left TL431 cathode above it and the right TL431 Ref below it.You can apply hysteresis to the right TL431 for the undervoltage threshold easily enough, but applying hysteresis to the left one for the overvoltage threshold is much trickier.I'm with Magic on this: If you want a window function, the TL431 is seriously sub-optimal. The cheapest option is probably a 'jellybean' dual comparator with push-pull outputs, fed from a jellybean low power regulator so the reference can be a simple divider from its supply, with its outputs NORed together with a common cathode dual diode. Three semiconductors and a sprinkling of passives.Of course you *CAN* pay boutique prices for dual comparators with a reference in the same package but finding one with adjustable hysteresis for both thresholds isn't easy and you'll probably not be able to easily second source it.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 02, 2020, 08:30:30 am
content: Well for discussion and comment, the following is my feeble attempt to put hysteresis to the circuit. Without them the Vout oscillate both at the low and high level limit. The output seem clean after adding the hysteresis. So it is for your reference only.

author: Alti
author_rank: Frequent Contributor
timestamp: September 02, 2020, 10:10:25 am
content: LM339 is around $36 for 1k,LM339 from ST, LCSC

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 02, 2020, 10:13:43 am
content: Quote from: Ian.M on September 02, 2020, 07:03:59 amActually, the output saturates down to a diode drop below Vref -- review the internal diagram to see why.Also underappreciated is the subthreshold region of these devices -- leakage is low below 2.1 or 2.2V, gradually turning on up to 2.5V. The 1mA minimum bias spec (or less for improved versions) is for meeting the 2.50V spec, but there are one-sided or clamping use cases where this is less important.Also FYI, it's feasible to add positive feedback by adding a resistor divider to the anode (ground return).Mind that none of these approaches are acceptable for battery management; the leakage is way, way too high (fractional mA even for the best 431-style parts). For that, use a proper battery management chip, or one of those micropower ref+comp chips. Single microamperes is very reasonable here.Tim

author: Echo88
author_rank: Frequent Contributor
timestamp: September 02, 2020, 07:34:49 pm
content: Thanks for the suggestionsIn this case it might indeed be the best to go with a LM393 and a small shunt regulator, while the cost and partcount are about the same.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 04, 2020, 06:08:16 am
content: Don't forget to show us how the new circuit performs with a 1V ripple riding on the input voltage, as per the TL431 simulation shown above.