Hi,
Background:
Yesterday I have connected a 12V PC fan through a NPN transistor (BC549C). Collector was connected to unregulated 12V from battery and Base was connected to regulated 5V from USB via Button and 15ohm Resistor.
Always use a PNP in that position.
And always use a base tier if you don't drive the base continually. Making it float means it will act as an "antenna" picking up noise and such.
My question is:
How come fan started to spin very slowly with Base of the transistor disconnected. After pressing the button fan got to full speed; after realeasing the button fan slowed down but did not stop.
Because you didn't use a base pull down and used an NPN on the high side.
Change to a PNP and pull it's base high with 5k to 100k and it won't leak