# Designing A Circuit To Light An LED When Voltage Drops Below Threshold

I'm a beginner with designing circuits and I'm attempting this because I'm trying to design my first PCB.

The basic idea is that I have a 12V battery as a power source and I want an LED to light up when the voltage drops below 3.2V (as an example). I got the idea from a retired SparkFun product called the "Uh-Oh" Battery Level Indicator.

After looking at the schematic for the product, I understand that the way the LED only lights up below a certain voltage is using a TL431 as an adjustable Zener (datasheet).

However, I'm struggling to understand two things:

1. How the TL431 works as an adjustable shunt
2. How the input voltage at which it will allow the LED to light up is calculated

How It Works

Based on this answer from another question posted on EESE, I am understanding that at a voltage above the internal reference voltage of the TL431, it will conduct current due to low impedance but at a voltage below it's internal reference voltage, it will not conduct current due to high impedance. If that thinking is correct, is the following diagram true?

Calculating V_out

According to the SparkFun schematic I already linked earlier, the output voltage of the TL431 is calculated as:

V_out = V_in * R_2/(R_1+R_2) and since the schematic uses a potentiometer, I am assuming that the two resistors are replaced by a single potentiometer, which is why R_1+R_2 is replaced by the maximum resistive value of the potentiometer, which is 10kOhms. This just leaves R_2 to be calculated.

However, another video I was watching on the TL431, shows a different calculation which can be seen at 4:38, the equation shown is different. There, it is V_out = V_in * (1 + (R_1/R_2)).

I am assuming that there is something fundamental I am misunderstanding here about how to calculate the resistive values for which I want the LED to light up at an input voltage of 3.2V. So, what am I missing? Why are these two equations different?

Side Note: I don't know if this is required, but I am designing the circuit to handle a maximum current of 1A.

• What exactly do you mean by "I am designing the circuit to handle a maximum current of 1A"? A TL431 cannot handle 1A, not can a typical indicator LED. Commented Jun 4, 2022 at 14:19
• A comparator, a Zener diode and a few resistors? Commented Jun 4, 2022 at 14:49
• You DO NOT want to discharge a 12 volt battery to 3.2volts - I think any 12 volt battery will be damaged long before the voltage drops to 3.2 votls. A Lead-Acid 12V battery should not be discharged below 10.5 V. Commented Jun 4, 2022 at 14:51
• Your circuit is not the same as used in the module. Check the connections of the upper left resistor. Draw it correct before trying to understand
– Jens
Commented Jun 4, 2022 at 16:12
• @brhans - Sorry, I should have mentioned that this is part of a larger circuit with DC motors attached which is why it requires 1A of current. Commented Jun 4, 2022 at 16:21

Why are these two equations different?

As far as I can tell the Sparkfun material is simply wrong. But it's hard to understand. For example, they say what will happen when $$\V_{in}\$$ is greater or less than $$\V_{ref}\$$, but there is no $$\V_{in}\$$ in the schematic.

Their equation for the output voltage of the TL431 is also simply wrong, as you can easily verify by reading the TL431 datasheet (page 19).

But the circuit has other problems. Mainly that in the $$\V>V_{ref}\$$ case, it doesn't block current from going to the indicator LED. Since the LED draws current whenever the voltage across it is greater than its forward voltage ($$\V_f\$$), it acts as a (crude) shunt regulator itself.

So if $$\V_f < V_{ref}\$$, the LED dominates and the TL431 never acts as a regulator. If $$\V_f > V_{ref}\$$ then the TL431 dominates, and the voltage is always regulated to less than $$\V_f\$$ so the LED never turns on.

Also, neither of these components is going to be able to handle 1 A, and 1 A is way too much to be pulling from a battery for an indicator circuit that could be designed to work with a couple of milliamps.

If I had to come up with a working solution off the top of my head, using the TLV431 since presumably you already bought one, and aren't planning to build 100's or 1000's of these, I might start with this:

simulate this circuit – Schematic created using CircuitLab

In this circuit, once Vcc reaches roughly $$\V_{ref}\frac{R_3+R_4}{R_4}+0.6\ V\$$, current starts flowing through the TLV431 to the base of Q2. Then the collector current of Q2 shunts current away from the LED, turning it off.

You'd need to make R3 and R4 big enough (more than ~1 megohms, I'd guess, so that leakage current through the R3 R4 path doesn't enable Q2 at too low a voltage. With such high values for R3 and R4 you have to consider the effect of the adjustment current of the TLV431 in setting the turn-on threshold.

If I wasn't constrained by wanting to use the TLV431 I'd use a comparator and probably get a solution that wastes a little less power.

• Sorry, I should have mentioned that this is part of a larger circuit with DC motors attached which is why it requires more than a couple of milliamps of current. Commented Jun 4, 2022 at 16:22
• So, if the circuit provided by SparkFun is wrong, what is the current version of the circuit to only power the LED when the voltage drops below a certain level? Commented Jun 4, 2022 at 16:23
• Hey, thank you so much for the circuit using the TL431. I actually haven't bought a TL431 yet so I'm not burdened by it. Could you provide the comparator circuit or a link to a comparator circuit that would implement the solution I want? Commented Jun 4, 2022 at 17:17