Using transistor as switch

I’ve been asked how to flash multiple LEDs using a timing signal from a 555 timer chip. It’s a good question because it’s something I need to be able to do once I tackle a large starship, like the 1/350th Enterprise refit, which will have many LEDs flashing simultaneously.

Actually a 555 (or 556) can run quite a few LEDs from the output leg of the chip, but if you try to run too many, the chip runs hot and you run the risk of burning it out. So a better solution is to use a transistor as a switch, one of its many uses. The nifty thing about a transistor is that a relatively small input, like from the output of a 555, can be used to switch on a much stronger signal, such as the common power supply voltage on the type of circuit board you’d create to run a starship.

transistor-switchIn this case, I’m using an NPN bipolar junction transistor, the 2N3904. It’s pretty common and you can get it from Radio Shack (please don’t die) individually or as part of a 15-pack of three common transistors. The circuit diagram below (please excuse the non-standard layout, but I like to see my pinout in order), shows that the output of the 555 is connected to the middle or base leg via a 1KΩ resistor. The emitter leg goes to common ground and the collector leg goes to my LED, which has a limiting resistor (a 330Ω resistor in this case for my white LED).

The breadboard below shows that I have four LEDs that connect to the collector. The long positive leg (anode) of the LED connects to the resistor and then to the common 9V positive rail of my breadboard. I admit this isn’t the most elegant breadboard, but I was in a hurry.

transistor-switch-breadboard

I chose a 1KΩ resistor for the base of the transistor because that’s what I saw other people using for a similar purpose. There is math involved for choosing the right resistor that frankly baffles me. You can read a little more about transistor drivers here and if you search the web, the mathematically inclined can probably find the formula for calculating the resistor value.

So I can’t swear this circuit won’t eventually fail and I don’t know how many LEDs it can drive, but I think it would be sufficient for most any Federation starship. I’d suggest running it for 24 hours and if it doesn’t overheat, it should be good.

 

Leave a Reply

%d bloggers like this: