Circuit Help

Discussion in 'General Electronics Chat' started by r_james14, May 3, 2010.

  1. r_james14

    Thread Starter New Member

    Apr 23, 2010
    I know i am going to get alot of people laugh at me for asking this but i have the follwoing circuit, it is meant to make the led come on when the pulse input is low, can anyone suggest how or why this dosnt work, i know it really simple but i run out of ideas.



  2. mik3

    Senior Member

    Feb 4, 2008
    Replace D1 with a 1K resistor and remove R2.
  3. SgtWookie


    Jul 17, 2007
    Hi rjames,

    It's easy to make mistakes like that, particularly when starting out.

    Here's a correction to your original schematic on the left, and a more power-efficient version on the right.


    Note that when the output of V2 is high, the NPN transistor is turned ON, which actually draws more current through R2 to turn the LED off than it does when the LED is lit!

    The circuit on the right uses a PNP transistor to source current to the LED. This way, there is no current drain at all when V3's output is high.

    Just a note on conventions in schematics:
    Inputs come from the left, and outputs are towards the right.
    More positive voltages belong towards the top, more negative towards the bottom.
    If you follow the convention, you will find it much easier to understand schematics; as practically all modern schematics are drawn with those conventions in mind.
    Your schematic was fine, except for the +5v coming in from the bottom right. That makes following the current flow somewhat confusing to read, as the positive source is coming from the lower right, and circling around to above the LED.

    A bit about LEDs, current limiting resistors, and using transistors as a saturated switch.

    Let's start with LEDs and their current limiting resistors. Let's say that you are using red LEDs that are rated for a Vf (forward voltage) of 2.0v @ 20mA. Many LEDs available today are of the super-bright variety, and you can operate them with much less current to get the same amount of light that you could from the old LEDs. So, let's go with 10mA current instead.
    The generic formula for an LED current limiting resistor is:
    Rlimit = (Vsupply - Vf_LED) / Desired_Current
    In this example case, Vsupply=5v, Vf_LED = 2v, and Desired_Current = 10mA.
    Rlimit = (5v - 2v)/10mA = 3V/0.01A = 300 Ohms.
    300 Ohms is a standard value. Here is a link to a table of standard resistor values:

    You can usually find E12 or E24 values in local stores. E48's and higher can be ordered, but are generally much more expensive.

    Note that capacitors are generally available in the E6 ranges.

    Now you need to calculate the power dissipation in the resistor.
    P=EI, or Power in Watts = Voltage x Current.
    So, 3v x 0.01A = 30mW (milliwatts) or 0.03 Watts. For reliability's sake, you always double the actual power requirement, and then select a resistor that is rated for at least that much power. So, you need 60mW or higher rated resistors.

    Let's go to using transistors as a saturated switch. "Saturated" means that increasing the base current will not result in more collector current.
    The generic formula for the base current limiting resistor of a transistor used as a saturated switch is:
    Rb = (Vin - Vbe) / (Ic/10)
    Vin = the voltage being applied to the base resistor, with respect to the emitter voltage.
    Vbe = the voltage on the base in respect to the emitter. For NPN transistors, 0.7v is a typical value for up to 1/2 the transistors Ic (collector current) rating.
    Ic = the desired collector current.
    10 = forced beta/hFE/gain of the transistor. Most transistor spreadsheets use a forced beta of 10 for transistor saturation curves.

    In the 1st circuit, you need to pull the junction of R2, the LED anode, and Q1's cathode low in order to turn off the LED.
    I=E/R, or Current = Voltage/Resistance.
    So, Ic = 5v/300 Ohms (from what we calculated above)
    Ic = 16.67mA.

    Oops, remember we calculated power dissipation when R2 was just going to be used to source current to the LED? Now we have to plan for when it has the full 5v of the supply across it.
    P = 5 x 16.67mA = 0.08335 Watts; doubled and that's 0.1667 Watts. You'll need to use a 1/4 Watt resistor, as that is the smallest rating that is greater than 166.7mW. If we forgot about that, you would wind up with toasty resistors.

    Back to transistor saturation.
    Rb = (Vin - Vbe) / (Ic/10)
    Rb = (5v - 0.7v) / (16.67mA/10)
    Rb = 4.3/1.667mA
    Rb = 2,580 Ohms. That is not a standard value of resistance (you bookmarked that page, right?)
    Looking at the E24 values (green columns), you have 240 and 270. In this case, you could use either.
    270 is within 5% of 258, and 240 is about 7% lower than 258. Since 270 is closer, we'll go with 2.7K.

    If the source for Vin is actively pulled to the value of Vin and later connected to the same potential as the transistors' emitter, the pull-down resistor is not necessary. However, if Vin is turned on and off like a switch (open or closed connection) then a pull-down resistor will help a great deal to turn the transistor off quickly. Use roughly 3 to 5 times the value of Rb.

    Don't forget to calculate the wattage requirement for Rb.
    Last edited: May 3, 2010