LED turning on at certain point

Discussion in 'The Projects Forum' started by Max Kreeger, May 29, 2014.

  1. Max Kreeger

    Thread Starter Member

    Oct 1, 2013
    71
    0
    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
     
  2. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    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
     
    Max Kreeger likes this.
  3. Fibonacci

    New Member

    May 23, 2014
    25
    5
    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.
     
    Max Kreeger likes this.
  4. Max Kreeger

    Thread Starter Member

    Oct 1, 2013
    71
    0
    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?
     
    Last edited: May 29, 2014
  5. BobTPH

    Active Member

    Jun 5, 2013
    789
    114
    Use a comparator if you want fast switching. This type of circuit is never going to have a sharp cutoff.

    Bob
     
    Max Kreeger likes this.
  6. Max Kreeger

    Thread Starter Member

    Oct 1, 2013
    71
    0
    I don't think my knowledge permits me to re-design the circuit haha..
     
  7. Fibonacci

    New Member

    May 23, 2014
    25
    5
    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).
     
  8. Max Kreeger

    Thread Starter Member

    Oct 1, 2013
    71
    0
    Why exactly is β a problem?
     
  9. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    math recheck.
     
  10. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    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
     
  11. wayneh

    Expert

    Sep 9, 2010
    12,155
    3,061
    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.
     
    Max Kreeger likes this.
  12. inwo

    Well-Known Member

    Nov 7, 2013
    2,435
    315
  13. Fibonacci

    New Member

    May 23, 2014
    25
    5
    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.
     
    Max Kreeger likes this.
  14. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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).
    :)
     
    Max Kreeger likes this.
  15. Fibonacci

    New Member

    May 23, 2014
    25
    5
    Thanks for point out my mistake, in fact was for a standard 12 V supply. The correct answer is 110 Ω.
     
  16. Max Kreeger

    Thread Starter Member

    Oct 1, 2013
    71
    0
    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.
     
  17. BobTPH

    Active Member

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

    Bob
     
Loading...