Help with specing transistors

I've managed to put togther some code that monitors and number of channels on a RC reciever and then can turn a series of LEDs on or off depending on the state of the channels.

However, I want to power the LEDs off VIN (9v battery), but lack the knowledge to spec up transistors. I assume that I would have to use a circuit like: But with the 470 resistor replaced with something specific for the LEDs I'll use.

My questions: 1. What is the purpose of the 10k resistor connected to transistor base? 2. How do I work out which transistor to use?


Hi James, the resistor in series with the LED is used to limit the current through the LED and the value of this and the transistor you use depends on the LED. If you know how much current your LED requires and its forward voltage drop (that info should be in the specs) you can calculate the LED series resistor using one of the online tools such as this one :

A typical low current led works on 20ma or less so almost any NPN transistor can be used, the 2N2222 is a common choice. The 10k resistor is used to limit the current flowing into the base of the transistor when the output pin is high.

BTW, I published a library for decoding all channels from a radio control receiver here: I would be interested to hear more about yours


Thanks for that, its been a great help.

as for the code, I had seen your 'decode' post but, for the time being I'm just using three pulseIn() statements. One for each channel I'm interested in (I'm running each channel on seperate pins. I might try something a bit more sophisticated in the future, esp. since I might incease it to monitoring 5 channels.