4
\$\begingroup\$

I have a 5v microprocessor that needs a PNP transistor between it and the common anode of an LED display, as it can't source enough current to drive all of the LED's without burning up. I understand in principle how the transistor connects, but seeing as I'm a computer programmer and not an electrical engineer, I'm having a little trouble finding the exact part number or specifications that will work in this application (all this talk of bias voltage, forward and reverse biasing, etc. has me thoroughly stuck). The display should suck around 400 mA through the transistor, worst case, and everything runs on 5 volts. Lastly, will I need any resistors (aside from the LED resistors) on the transistor and if so, how do those work?

\$\endgroup\$
1
  • \$\begingroup\$ Again, sorry if this is a really basic question, but I'm just getting into EE by teaching myself, and I've had trouble forming a coherent answer by looking at the 'net. Thanks for any help! \$\endgroup\$
    – Chris
    Aug 24, 2012 at 19:56

3 Answers 3

5
\$\begingroup\$

What you want is something like this:

except that the parts for individual LEDs will be replicated 16 times instead of just 4 as shown.

Since you have 16 LEDs each drawing 20 mA, the total current when all are on at the same time is 320 mA. R1 will cause about 10 mA base current in Q1 when the processor drives the common enable line low. That means the transistor needs to have a gain of at least 32, which this transistor can do. The other transistors are only handling the current for individual LEDs, which is 20 mA, so don't need as much base drive. That is why R2-R5 can be larger than R1.

R6-R9 are sized so that after a little voltage drop in the anode and cathode transistors, about 20 mA should flow thru the LEDs if they are normal green ones. Red LEDs have a little lower voltage drop, so you may need a little higher series resistor.

\$\endgroup\$
3
  • \$\begingroup\$ Perfect! Exactly what I was looking for, part numbers, values and all. Thanks! \$\endgroup\$
    – Chris
    Aug 25, 2012 at 5:22
  • \$\begingroup\$ In your answer you have a bar over the COMMON_ENABLED, are you saying to enable the LEDs the COMMON_ENABLED but be low? \$\endgroup\$
    – Dean
    Aug 26, 2012 at 16:31
  • 2
    \$\begingroup\$ @Dean: Yes, by convention a bar indicates negative logic. In that case that means the line must be low to enable the common side of the LEDs. I could have named it COMMON_DISABLE and left off the bar. \$\endgroup\$ Aug 26, 2012 at 16:52
4
\$\begingroup\$

Kind of hard to tell what you're looking for from your question... do you have an array of LEDs?

This is the basic schematic for using a PNP transistor to power an LED from a microcontroller pin.

enter image description here

The idea is that the microcontroller only has to provide the control signal on the base of the transistor while the main draw comes from the power supply (the +V in the schematic above) through the transistor.

As far as calculating values for the resistors, it depends on so many variables you didn't give us including but not limited to: forward-bias voltage drop of your LED (Vf) and the recommended on current of the LED (Id). Please provide more information about your setup so we can answer your question better.

You might also want to research multiplexing and charlieplexing to see if they would help with your project. They allow lower power draw and less pin usage on your microcontroller for large displays.

\$\endgroup\$
1
  • \$\begingroup\$ Yes, it's an array of LED's in parallel, with a common anode. 16 segment LED display, each segment with ~20mA forward current each, 2.0V forward voltage drop. I've multiplexed each display digit together, however the common anode restricts my options, and leads to this problem - all 16 segments have to be sourced from one micro pin. Thank you for the schematic :) given the new info, can anyone suggest a value / part # for the transistor? Thanks! \$\endgroup\$
    – Chris
    Aug 24, 2012 at 20:27
0
\$\begingroup\$

Instead of JGord's answer I would go for a NPN transistor instead. This way, a high input on the base (the middle one) will open up for collector-emitter current and the schematic would be the same.

You could buy almost any transistor you want. These ones will suffice, just be sure the collector current is able to drive at least 400mA.

\$\endgroup\$
3
  • \$\begingroup\$ do you decided to use a NPN to be placed as a emitter follower circuit? \$\endgroup\$ Aug 24, 2012 at 22:11
  • \$\begingroup\$ Problem is, they need to be connected between the common anode of the led and the positive rail, would an NPN still work there? \$\endgroup\$
    – Chris
    Aug 24, 2012 at 22:27
  • \$\begingroup\$ Yes, doesn't matter on what side it is placed, you only want current to flow \$\endgroup\$
    – chwi
    Aug 25, 2012 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.