I wish to control a 12V dc motor through the GPIO pins of a Raspberry Pi. I am currently referring to this tutorial.
I have a 2N222 NPN-transistor which will used as a Switch, a 12V-2A power supply, a resistor of 1K ohms and a diode.
This is the circuit I am using:
- motor in the collector of the transistor
- Jumper from 3.3V GPIO pin through 1K to transistor base
- Emitter to ground
- Battery negative to ground
- Battery +12v through motor to collector
- ground GPIO pin to ground.
- a reverse biased diode in parallel
I fail to get a working circuit - every time the transistor ends up frying. Please, how I can fix this?