I'm trying to control a dc fan with a Raspberry Pi 3 and I'm using a NPN transistor (BC547) to switch the fan on and off.

The schematics I found called for a PNP transistor with a 1k resistor on the base. I left the resistor but used a NPN transistor instead because that's what I had lying around.

This resembles my setup:

[![with resistor](https://i.stack.imgur.com/TLOID.png)](https://i.stack.imgur.com/TLOID.png)

The Raspberry outputs 5v (red wire) and 3.3v on the gpio pin (blue wire in picture). (Don't think I need so say this, but ground is black.)

The fan didn't start so I hooked up a multi-meter where the fan should be and I measured 5.6 volts. As a test I then replaced the fan with a 5v led I have and it worked as expected. Still, the fan wouldn't start when I replaced the led with the fan again.

I don't seem to remember using a resistor on the base when I used these years ago (it's been a while since I last messed with these) so I removed the resistor and the fan worked!
So now my setup is like this:

[![without resistor](https://i.stack.imgur.com/WDW45.png)](https://i.stack.imgur.com/WDW45.png)

I'm confused as to why only the fan doesn't work with the resistor on the base of the transistor. Can somebody explain why?