I would like to use an NPN transistor to turn on a DC motor from my Raspberry Pi. I have a 12V motor which cannot go anywhere near the Pi! Yet, I need to somehow connect the Pi to activate the motor...
Here is my current configuration, but it didn't work; on some occasions I nearly fried my Pi:
Jumper cable from GPIO pin through a 1K resistor into the transistor base.
The emitter of the transistor goes to the motor and then from the motor to the ground rail.
The collector is connected to +12V from a battery.
The other side of the battery is connected to the ground rail.
The ground rail is connected to GPIO pin 6.
When I activate the GPIO, nothing happens! In fact, the transistor becomes scorching hot and so I have to throw them away.
Could somebody please tell me what is happening. I am really confused.