This tutorial was perfect for what I am working on! Thank you for explaining how to select a transistor and calculating the resistor for the base! Much appreciated!
Excellent tutorial. Yours is the best refresher video I have seen to stir my grey matter reminding of 40+ years ago at college doing City & Guilds Electronics!
Hi Stewart. Thanks for an excellent tutorial explaining the details of bi-polar junction transistors. I am making a "Smart Planter" project for middle school age students using a microbit and a small pump to keep it watered. I chose a 2N2222 transistor to control the pump, but I had no idea how to choose the resistor from the microbit to the base. I am using a 470 ohm resistor which seems to be working, but that was only as a result of trying different values. The pump draws about 120mA and I see from your tutorial that I am past the limit of the 2N2222. Do you have any suggestion for a better transistor choice? Thanks, Joe P.S. I just ordered and downloaded your book from apress, and I am looking forward to reading it.
If it's just on and off then I'd actually recommend swapping the bi-polar transistor for a MOSFET. I think a 2N7000 should be sufficient, if not then an IRL520. In the case of a MOSFET the gate resistor (equivalent of the base) just needs to reduce surge current so 470R should be fine. One thing to add when using pumps (or any motor / electromagnet) is to add a flyback diode. Any standard diode should do such as a 1N400x series. Connected in reverse direction across the pump that will protect the transistor / MOSFET. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mT1Us2Cw8zM.html
@@PenguinTutor thanks for your reply. I tried the 2N7000, and it works ok when I connect the microbit to USB power, but not with battery power as the supply voltage is about 2.8 volts. I guess I’ll stick with the 2N2222 as they are not failing. I do have a IN4001 diode across the motor plus and minus, but I wasn’t sure it was needed until your reply. Thanks again, a Joe
The maximum current from the raspberry pi gpio is 16mA. Enough for a small LED but if you want to switch more powerful LEDs then the transistor allows you to do that.