Connect with us

Very basic transistor usage

Discussion in 'Electronic Basics' started by Jason Richard, Oct 9, 2004.

Scroll to continue with content
  1. First off, please excuse my ignorance as I know very little about this stuff
    and searching google has only helped to confuse me more.
    What I would like to accomplish is to drive 12 bi-color LEDs (red/blue) from
    two seperate inputs. I would like the red potion of the LEDs to light when
    there is network activity and the blue LEDs to light when there is hard
    drive activity. This seems simple enough, but the bi-color LED is common
    cathode, and judging by the readings I took, the network and hard drive LEDs
    toggle the cathode to turn on or off the LEDs. So, what I was thinking is
    that I could use a transistor to drive the anodes of the 12 LEDs, but thats
    about as far as I got. The specs of the LEDs are Blue: 3.2v at 20mA and
    Red: 2.2v at 20mA. Also, the readings I took showed the hard drive activity
    LED cathode swinging from 5v (off) to 0v (on) and the network LED swinging
    from 3.3v (off) to 0v (on). Any drawing of a suitable circuit would be
    greatly appreciated and any explanation of how the circuit works would be
    even better!
    Thanks for any and all help!
  2. CFoley1064

    CFoley1064 Guest

    Subject: Very basic transistor usage
    Hi, Jason. You've got two jobs here -- change both logic signals to a common
    +5V/0V, and then drive the LEDs.

    Here's one possible way to do this (view in fixed font or M$ Notepad):

    | + + +
    .-. | | |
    2.2K| | | | .-.
    | | | | | |2.2K
    '-' | | | |
    ___ | |/ | '-'
    .--|___|-o-| 2N3906 >| | ___
    | 2.2K |< 2N3906 |-o-|___|--.
    | | /| 2.2K |
    | | | |
    | .-. .-. |
    | 75 ohm| | | | |
    | | | | |120 ohm |
    | '-' '-' |
    | | | |
    | Blue V ~ Red V ~ |
    | - ~ - ~ |
    | | | |
    | | | |
    | '---------o--------' |
    | | |
    Netwk|\ | === |
    -| >O--' GND |
    |/ |
    2/8 74HC244 |
    |\ |
    -| >O-----------------------------------------------'
    HD |/
    created by Andy´s ASCII-Circuit v1.24.140803 Beta

    For your 12 bi-color LEDs, you'll need three 74HC244s and 24 small signal PNP
    transistors like the 2N3906. The HC244 is a non-inverting buffer, and each
    logic gate will provide a solid 5.0V output for any input significantly above
    1/2Vcc (2.5V if you use a 5V supply for the ICs). For each IC, be sure to make
    the two enable inputs logic low (0V), or the outputs won't work at all.

    Now, when the logic output goes low, it will pull current from the base of the
    PNP transistors through the 2.2K resistors (around 2 mA). That will turn on
    the transistors, so they will conduct through the emitter to the collector.
    This is called using transistors as switches. For a PNP current-sourcing
    switch, a logic "1" is off, and a logic "0" is on. As long as your base
    current is around 1/10th of what you want to switch, it will work fine. You
    notice that I wanted to switch 20 mA, so I made it so the base drive would be
    about 2 mA.

    Now you have to do the math on the series resistors that limit the current
    going through the LEDs when the transistors are "on". You add the expected
    voltage across the LED and the voltage across the switching transistor, and
    find out what's left. For the red LED, let's figure 2.2V for the LED plus
    about 0.3V for the "on" transistor, which will leave you 2.5V. You need to
    figure out what value of resistor is necessary to have 2.5V dropped across it
    when 20mA is going through it. For that, you use Ohm's Law. Sir Georg Ohm

    V = I * R, or

    R = V / I, so

    R = 2.5V / 0.02Amps = 125 ohms

    Choose 120 ohms as the nearest value. Do the same calculation for a 3.2V LED
    to get 75 ohms for that series resistor.

    Here's the datasheet to give you the pinout for the 74HC244:

    For a 2N3906, with the pins down and the flat of the plastic TO-92 case facing
    you, the pinout from left to right is E-B-C.

    Good luck
  3. 5V
    | | |
    \ \ |
    10k/ 10k / |
    \ \ |
    / / |
    | | |e
    | o---/\/\/-----b| PNP
    | | 220 |c
    | | | 130
    | |c o----\/\/\- RED ANODE
    o--------| NPN |
    | |e o----\/\/\- RED ANODE
    | | |
    10k |c | o----\/\/\- RED ANODE
    IN -/\/\/--| NPN | |
    |e | '----\/\/\- etc
    | |
    | |
    created by Andy´s ASCII-Circuit v1.25.250804

    Separate but equal circuit for BLUE anodes, except you use 82 ohm
    resistors to limit the current through them.

    I'd use 2N3904s for the NPNs, and 2N4403s for the PNPs, but just because
    I have them laying around. Make sure the PNP can pass at least 300mA.
    Its a switch, so its not dissipating much power (ie, it won't get hot)

    One odd thing is that if this circuit ends up always being ON, they may
    be controlling the LEDs by using a high impedance for off, rather than
    just bringing the voltage to the Vcc rail (your measurements say they
    probably aren't doing this, but you never know). If so, you'll need a
    10k resistor from IN to 5V as well.
  4. Wong

    Wong Guest

    Hi Chris,
    Something that I don't understand. Why is there a "voltage divider"
    between the node of a 2.2K resistor and the transistor base?
    Or it just the pullup resistor because of 74HC244 ?
    Think that you wont get 2mA when Netwk is "1" and 244 output is "0",
    I think you will get less than that, right ?
  5. CFoley1064

    CFoley1064 Guest

    Subject: Re: Very basic transistor usage
    Hi, Jason. It's common practice when using a transistor as a switch to have a
    pulldown (NPN) or pullup (PNP) resistor from the base to the emitter to keep
    things well-behaved. On is really on, and off is really off. In fact,
    "digital transistors" are made these days which have the series resistor and
    pullup/pulldown from base to emitter built in, and I'll usually use one of
    those when using a discrete transistor as a switch. Fewer components to place,
    less hassle. But if you're driving the transistors from HCMOS, which has logic
    levels pretty much at the supply rails (unless you're driving some current),
    the pullups technically wouldn't be necessary. Back in days of yore you'd need
    these extra resistors because TTL logic levels would lead to fuzzy turn-on and
    turn-off states. Times have changed. Good observation.

    Good luck with your project
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day