Driving a 12V led from a 5V Arduino pin

Driving a 12V led from a 5V Arduino pin

Today i ordered some big illuminated arcade style push buttons for a project. Each button has a built-in led that should be powered with 12 volts, but the Arduino pins only supply 5 volt, how do I solve this?

I didn’t manage to figure it out myself, but my sensei Nils helped me out. This is one of the fundamental uses for transistors; to make a lower voltage drive a higher voltage. I used a NPN transistor, BC547, but I guess most NPN transistors will do the same job in this case.

Driving a 12V led from a 5V Arduino pin

Actually in this case I think I will use a Netduino, which supplies only 3.3 volts on it’s pins, but it’s the same principle.

I connected 12V as supply (vin) voltage to the Netduino. The anode of led is connected to vin and the cathode to the collector av the transistor. A pin on the Netduino sends 3.3 volts to the base of the transistor. This will make current flow from the collector to the emitter. The resistor values are quite random, the leftmost resistor is to protect the led, the other i think is to protect the transistor, or maybe to create a current, or maybe both, I’m not sure.

Please correct any errors.