So essentially I want to be able to control a 12v cooling fan from my Raspi's GPIO pins. Obviously I can't do this directly since the raspi only gives 3v3 on it's GPIOs. Instead, I have opted for a mains 12v power supply to the fan. However, I want to have a transistor in the middle to turn the connection between them on or off so that it can be controlled via py script.
Am I approaching this in the wrong way? Are there any other ways to do this?
If I am right, what transistors, resistors etc will I need?
Thanks in advance!