1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics Yet another simple transistor question

Discussion in 'Modding' started by MoD, 23 Nov 2006.

  1. MoD

    MoD What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    57
    Likes Received:
    0
    Hi,

    Probably this is a very simple and obvious question but i am not very bright with transistors so sorry about this. I am trying to use a pnp transistor to act as a switch which will switch on an LED when the input on the base is 0V and switch off the LED if the base is connected to 5V.

    I came up with this simple diagram but it does not seem to work.

    [​IMG]

    I think I am doing something wrong :sigh:



    Any pointers will be greatly appreciated :)
    Thanks.
     
  2. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    Yep, you've got your transistor the wrong way round. Emitter to +5V, collector to LED.
     
  3. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    Conventional current flow (positive to negative) always follows the transistor symbol's arrow. That's why they're drawn like that. ;)
     
  4. MisterX

    MisterX What's a Dremel?

    Joined:
    24 Dec 2004
    Posts:
    12
    Likes Received:
    0
    Your diagram shows the PNP transistor, with the 2N3904 label. But 2N3904 is an NPN part. Your are probably using 2N3906, right?
     
  5. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    Good catch. :duh:
     
  6. MoD

    MoD What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    57
    Likes Received:
    0
    This is going to sound horrible but I haven't actually checked if it was a PNP or NPN, I just grabbed the 2N3904 from a plastic bag labeled PNP so yes the schematic is wrong. If I were to do it with an NPN transistor, would it be something like this?

    [​IMG]

    now the curent flow matches the transistor's arrow (as cpemma suggested). one more thing is should i actually use a 10k resistor on the base of the transistor. the current level going to the base is around 4mA and do I want to limit that even more?

    I know I am hopeless with this and thanks a lot for all your answers :)
     
  7. fat-tony

    fat-tony What's a Dremel?

    Joined:
    26 Mar 2006
    Posts:
    23
    Likes Received:
    0
    I think things got confused here a while ago. Note that it's supposed to be an INVERTER.
    I think he was very close in the first diagram, just a little off... I'm going to draw up my hypothesis here :)


    Edit:
    [​IMG]

    This should exhibit the proper behaviour for the given input voltages. It does use the 2N3906 PNP transistor, to get the easy inverter effect.
     
    Last edited: 25 Nov 2006
  8. SteveyG

    SteveyG Electromodder

    Joined:
    23 Nov 2002
    Posts:
    3,049
    Likes Received:
    8
    That won't act as a switch if that's what he's after unless the base can be pulled up to Vcc. You've drawn it as an emitter follower. PNP for high side switching and NPN for low side switching.

    I wouldn't rely on your diagram if you're interfacing with logic as it's not guaranteed to swing the full supply voltage range.
     
  9. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    Going back to the original (but with a PNP connected the right way round) you can get round SteveyG's concern that the control signal may not swing high enough (over 4.3V) to turn the PNP off by putting the LED on the emitter (top) side and the resistor on the collector (bottom) side. Now 'High' only needs to be over (5V-0.7V - LED forward voltage), say over 2.5V, to shut the PNP down.

    Using a single NPN as switch you've two choices,
    • Rewrite the software so a logic high signal turns the LED on,

    • Put the LED across the NPN so the 'on' transistor shorts out the lit LED, with the resistor on the collector to limit either LED current or transistor current.
     
  10. fat-tony

    fat-tony What's a Dremel?

    Joined:
    26 Mar 2006
    Posts:
    23
    Likes Received:
    0
    DOH. You're completely correct.

    In my defense, he did specify Vcc and GND inputs, but yes, it would be reasonable to assume that these are coming from logic gates with questionable rail swing :)

    That's why I shouldn't do stuff quickly

    [​IMG]

    Like this!

    I was thinking about that base resistor too, and considering if hfe was low. So, shrinking that down to 4.7k seemed to make sense.

    Vi = 0V
    Vb = 5V - 2.0V (guestimated LED forward) - 0.7V = 2.3V

    Ib = 2.3V / 4.7k = 0.5mA
    (Gain eqn) Ic ~= ßIb = 50 * 0.5mA = 25mA [ This is pretty beta ]

    Now, on our collector resistor:

    Vc = 5V - Vled - Vce(sat) = 5V - 2.0V - 0.1V = 2.9V
    Real Ic = 2.9V / 220ohm = 13.1mA

    (Real Ic < Gain eqn Ic) => Transistor in Saturation!
     
    Last edited: 25 Nov 2006
  11. MoD

    MoD What's a Dremel?

    Joined:
    13 Oct 2001
    Posts:
    57
    Likes Received:
    0
    Following the final schematic drawn by fat-tony I managed to get this thing working :)


    SteveyG, cpemma, MisterX, fat-tony: Thanks a lot for all your help!
     

Share This Page