Comments
Login to post a comment...
A transistor is a semiconductor device commonly used to amplify or switch electronic signals. In this project, a power transistor is used as a digital switch. When pin 9 (digital output) is HIGH, the LEDs will turn on, and when LOW the LEDs will turn off. Using a power transistor with an Arduino pinout will allow you, for example, to control outputs with a higher current or voltage source than Arduino pins support.
|
Use an NPN Power Transistor, one 1k resistor, and 220 Ohm resistors for the LEDs. Connect the LEDs in parallel to 5 volts using 220 Ohm resistors. Connect the BASE (transistor's left leg) through a 1k resistor to pin 9, the COLLECTOR (middle leg) to the ground legs of the LEDs and the EMITTER (right leg) to ground. |
ImagesFilesLinks |
yaroslav # Nov. 30, 2009, 5:55 a.m.
what is the code for a Arduinohexskrew # Feb. 2, 2011, 9:47 p.m.
OMG this helps so much! You really don't know how long I have been looking for this. And yes I did google "How to use switching transistors", "how to use a transistor as a switch" and etc... And all it would give me at all was a rough diagram that made no sense to what I am trying to do (drive 128 leds using 24 outputs of an Atmel32L, with 8 of those switching the negative lines). You have made my day.