Maxwell Conolly
Member
Hello. I am trying to build a circuit that controls a 12V fan from the teensy 3.2 using a PN2222A transistor. My goal is to eventually control fan speed using pwm. For now the teensy is simply outputting 3.3V. I have run the circuit in multisim with a 12V lamp and the system worked. I have also got the system to work using an Arduino's pwm output to the base of the transistor. Whenever I use the teensy, however, it fails for some reason and the fan does not run. I have attached below the schematic (which is from multisim and contains a 12V lamp instead of a fan), a photo of my breadboard, and a photo of my code. I know the fan works because when it runs when I directly attach it to 12V. The transistor datasheet can be found here. If anyone has any suggestions please let me know.
Schematic
Breadboard
Note that while it's not pictured the main power supply is supplying the power rail of the breadboard with 12 VDC.
Code
Schematic
Breadboard
Note that while it's not pictured the main power supply is supplying the power rail of the breadboard with 12 VDC.
Code