LED turning on at certain point

Thread Starter

Max Kreeger

Joined Oct 1, 2013
95
Hey guys,

I have the attached circuit for an LED to turn on when a voltage reaches a certain limit. I want it to turn on at 5.6V (keeping in mind the 0.6V for the transistor).. so would I use a 5V Zener diode and a 150 Ohm resistor for the LED (5V/150Ω = 33mA; LED needs 30mA) ? Don't understand why he uses a 2K-2.7KΩ for his LED

Thanks in advance
Max
 

Attachments

AnalogKid

Joined Aug 1, 2013
11,042
The 2.7K isn't for the LED, it's for the transistor. It limits the base current to a safe value. In this application the 3904 will have a gain of over 40, so for 30 mA of collector current you need less than 1 mA of base current.

If 5.6 V is the minimum turn-on input voltage, what is the maximum input voltage? Let's assume it is something like 12 V. This is used to calculate the base resistor to limit the base current to a safe maximum value. For the 3904, 5 mA is a nice number. Calculate the resistor for 5 mA of base current at 12 Vin.

Once you have a resistor value, you can work backwards to estimate the input voltage when the LED just starts to become visible. For this assume the transistor has a gain of 100 (conservative estimate for the 3904 in these conditions), and the LED is just barely visible with 1 mA of current.

Keep in mind that the LED has about 2 V of voltage drop across it. At 5.6 Vin and 0.1 Vcesat (saturation voltage of the transistor), the LED current limiting resistor value is:

R = E / I --> R = (5.6 - 2.0 - 0.1) / 0.03 = 3.5 / 0.03 = 117 ohms

Again, if the input voltage has a range, then you calculate the LED resistor the the highest allowed current at the worst case input voltage (12 V in the example above), not the minimum turn-on voltage (5.6V).

ak
 

Fibonacci

Joined May 23, 2014
25
Hey guys,

I have the attached circuit for an LED to turn on when a voltage reaches a certain limit. I want it to turn on at 5.6V (keeping in mind the 0.6V for the transistor).. so would I use a 5V Zener diode and a 150 Ohm resistor for the LED (5V/150Ω = 33mA; LED needs 30mA) ? Don't understand why he uses a 2K-2.7KΩ for his LED

Thanks in advance
Max
There are several things to talk about. The 2K-2.7K resistor, is the base resistor of the 2N3904 npn transistor, wich is working like a switch, and the collector resistor in the output circuit is for the LED. If you want 30 mA across the LED use Rc=(5.6-0.3-2)/30mA, where 0.3 is the Vce at saturation (from 2N3904 datasheets) and 2 is the LED forward LED voltage, it gives ≈323 Ω, take a 330 Ω commercial value. On the other hand, at the input circuit, for a fast turn on switching behavior Ib >Ic/β. β is a problem, and usually β=√βmin*βmax, for the 2N3904 is √100*300≈173. Taking a LKV in the base circuit we obtain:
Vz = Vin - RbIb-Vbe = 5.6 -2.7K*174μA - 0.65 = 4.48 V, where 174μA comes from Ib >Ic/β =30mA/173 ≈174μA. You have two choices for the Zener voltage: 1N4731 with Vz@Izt = 4.3 V and 1N4732 with Vz@Izt = 4.7 V; pick the 1N4732.
 

Thread Starter

Max Kreeger

Joined Oct 1, 2013
95
Oh, ok makes sense! The max would be 10V.

I ran this simulation with a 4.7V Zener (no option for anything larger). How would I go about tweaking it for a sharper response? Instead of just gaining from 3V?

EDIT: Sorry Fibonacci, just saw your post. What is LKV abbreviated for?
 

Attachments

Last edited:

Fibonacci

Joined May 23, 2014
25
Oh, ok makes sense! The max would be 10V.

I ran this simulation with a 4.7V Zener (no option for anything larger). How would I go about tweaking it for a sharper response? Instead of just gaining from 3V?

EDIT: Sorry Fibonacci, just saw your post. What is LKV abbreviated for?
You established a 5.6 volts for Vin. Obiously it changes the design if you changes Vin. Sorry, LKV is in spanish KVL (Kirchhoff Voltage Law).
 

AnalogKid

Joined Aug 1, 2013
11,042
Build the circuit and look at it. The relationship between current and LED brightness is not linear, and neither is our perception of brightness. As the input voltage rises, the perceived brightness will at first increase much more quickly than your simulation implies, then increase very little at the high end.

ak
 

wayneh

Joined Sep 9, 2010
17,498
I don't think my knowledge permits me to re-design the circuit haha..
Don't count yourself out. A comparator is incredibly easy to use and, if you do learn it, you'll slap yourself for not doing it sooner. I know it seems complicated at first, but it's worth it.

Look at the LM339 or LM393 (quad or dual) comparators. They need to be powered. Easy enough. Then the comparator you are using needs a reference voltage to compare your battery voltage to. Your zener can supply that reference. The comparator output has only two states (no mushy middle): the high state is "open", like a cut wire, while the low state provides a current path to ground. This can be used to connect your LED to ground and light it up when the output goes low, just like flipping a switch.

The comparator current can't handle much current, barely enough for an LED, so it is often used to control a transistor if larger currents are necessary.
 

Fibonacci

Joined May 23, 2014
25
Because it never has a particular value due to temperature dependency and other factors. So, generally we have several options. Engineers usually take the "beta rms", defined as βrms=√βmin*βmax.
 

THE_RB

Joined Feb 11, 2008
5,438
...
I ran this simulation with a 4.7V Zener (no option for anything larger). How would I go about tweaking it for a sharper response? Instead of just gaining from 3V?
...
The circuit has a really soggy response because it turns on based on base current (and is really dependent on beta).

You can improve it a great deal by changing the 2k7 resistor for a 5k trimpot.

Then put the trimpot centre wiper to the base, one end of the timpot to gnd, and the other (top) end of the trimpot to the bottom of the zener. (The zener now goes where the 2k7 used to be.)

Now the circuit will switch based on the 0.6v Vbe point of the transistor, not the transistor beta. AND you have another big benefit of being able to trim the voltage where it switches on (using the trimpot).
:)
 

Thread Starter

Max Kreeger

Joined Oct 1, 2013
95
RB thanks for the modification, was going to simulate it on LTSpice only to find out theres no pot component. I'll just have to build it.

Wayneh. I'll definitely look in to the comparators.

Thanks again guys.
 

BobTPH

Joined Jun 5, 2013
8,958
You simulate a pot in LTSPICE with 2 resistors. Just change the values of them to see the effect of different settings.

Bob
 
Top