Electronic – What transistor to use when building a simple MCU controlled LED blinking circuit

ledpictransistors

This is my conceptual schema to use a PIC12 to control the blinking of 3 LEDs with different blinking patterns. I have a few questions that would like to ask.

  1. Is this circuit going to work?
  2. What kind of resistors should I use?
  3. What kind of transistors should I use?
  4. Do I need capacitors or any other components?

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

Your circuit looks pretty good to start with but will need some modifications:

  • You will need resistors between transistor bases and the PIC, otherwise too much current will flow from the PC to the transistor bases. Something like 1K each would be fine.
  • You will need to tie all your grounds together: right now the transistors may not conduct because there may not be base->emitter positive bias, however, see next point first.
  • Might be thinking that you need 3.7V voltage source for your bright LEDs because that's their forward voltage drop characteristic. Actually, you can use (almost) any voltage, as long as you use the current-limiting resistors. The forward voltage drop just tells you a) the minimum voltage to use and b) how much the voltage will drop across a conducting LED. So using 5V for everything should not be a problem. If you have other reasons for wanting a separate 3.7V battery then just remember to tie the negative terminals of the two battery packs together.
  • You should use Ohm's law to figure out what the current-limiting resistors should be:

Ohm's law: V=I*R where V = voltage, I=current, and R=resistance in volts, amps and ohms respectively. To solve for resistance use \$R=V/I\$. Remember that 1 mA is 0.001 A, so your \$I\$ will be 0.12A

  • Finally, you'll need NPN transistors that can switch 120mA or more. Something like BC546/7 is limited to 120mA, so you need something better than that. PN2222 are very cheap and common, but you can use any NPN transistor that has maximum current at 150mA or more: look for maximum collector current or maxumum emitter current on the datasheet. At the same time (thanks to Anindo Ghosh for the the heads up) 120mA is a lot of current to continuously run through your transistor: it will definitely get pretty hot, so you may want to get something in a TO-220 package. Some parts that would work: TIP122, MPSA13 (I am just looking at the NPN transistors I have around that are bigger than TO-92). Alternatively you could deal with the heat dissipation by attaching a heatsink: a real heatsink, just glue a piece of metal (thanks Bitrex), or even just make a little heatsink out of aluminum foil, and wrap that around the plastic body (only body, no legs). On the other hand, you said "blinking LEDs" so perhaps this is less of an issue.

For driving the LEDs you are good. I am not a PIC person, so maybe your PIC needs something, like an external crystal with small caps, but judging from your schematic it doesn't look that way. As Kurt E. Clothier suggests in the comment, bypass caps are a good general engineering practice.