A microcontroller pin has a limited amount of current you can supply which is typically enough to light up one LED at a time. For instance the PIC32MX250F128B microcontroller the absolute maximum current drawn by any I/O pin is 15mA referencing the datasheet. By using a transistor you can increase this amount significantly, the PN2222A is capable of sinking up to 450mA and the IRLU024NPBF is capable of sinking 15A. You can even control higher voltages then your microcontroller pin could normally handle as well.
This example will demonstrate using two different transistors to switch on and off several LED's from one I/O pin. This example is sinking around 200mA of current for the eight LED's connected to each transistor. The setup used in this demo draws under 6mA of current from the microcontroller pin when using a PN2222A transistor and basically 0mA using a IRLU024NPBF. I purchased the transistors from Tayda Electronics, making the IRLU024NPBF sixty-five cents and the PN2222A five cents each.
Items used:
1 PIC32MX250F128B microcontroller board
9 White LED's with 220ohm resistors
2 830 point Breadboards
2 470 OHM resistor (one for each transistor)
1 PN2222A transistor
1 IRLU024NPBF transistor
Some black 22AWG solid wire
Some red 22AWG solid wire
A few jumper wires
PN2222A pinout photo can be found here:
http://bit.ly/1C6FxQz
IRLU024NPBF pinout photo can be found here:
http://bit.ly/1eYSJg0
See the video below for a demo of it being controlled by a PIC32 microcontroller and a simplified version of the circuit schematic connections to each of the different transistors used.
Direct video link: https://youtu.be/6XEnEG-1PdQ
This example will demonstrate using two different transistors to switch on and off several LED's from one I/O pin. This example is sinking around 200mA of current for the eight LED's connected to each transistor. The setup used in this demo draws under 6mA of current from the microcontroller pin when using a PN2222A transistor and basically 0mA using a IRLU024NPBF. I purchased the transistors from Tayda Electronics, making the IRLU024NPBF sixty-five cents and the PN2222A five cents each.
Items used:
1 PIC32MX250F128B microcontroller board
9 White LED's with 220ohm resistors
2 830 point Breadboards
2 470 OHM resistor (one for each transistor)
1 PN2222A transistor
1 IRLU024NPBF transistor
Some black 22AWG solid wire
Some red 22AWG solid wire
A few jumper wires
PN2222A pinout photo can be found here:
http://bit.ly/1C6FxQz
IRLU024NPBF pinout photo can be found here:
http://bit.ly/1eYSJg0
See the video below for a demo of it being controlled by a PIC32 microcontroller and a simplified version of the circuit schematic connections to each of the different transistors used.
Direct video link: https://youtu.be/6XEnEG-1PdQ