Hazlan
Posts: 13
Joined: Tue Jul 15, 2014 8:11 pm

Transistors and the Raspi.

Thu Aug 07, 2014 4:31 pm

Hey guys!

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!

rgrbic
Posts: 128
Joined: Thu Jun 12, 2014 1:07 pm
Contact: Website

Re: Transistors and the Raspi.

Thu Aug 07, 2014 4:38 pm

The approach is ok. See here.
At 127.0.0.1
Twitter: @rgrbic
IoT-projects.com

drgeoff
Posts: 10218
Joined: Wed Jan 25, 2012 6:39 pm

Re: Transistors and the Raspi.

Thu Aug 07, 2014 5:08 pm

I suggest the FET method in the link provided by rgrbic. Note that the 2N7000 is only rated for currents up to 100 mA. Depending on what your fan draws, you may need to change that for a beefier device.

Hazlan
Posts: 13
Joined: Tue Jul 15, 2014 8:11 pm

Re: Transistors and the Raspi.

Thu Aug 07, 2014 6:00 pm

Would I be in risk of getting 12v of feedback into the GPIO? If so could I eliminate this using a simple diode?

Thank you!

gordon77
Posts: 4509
Joined: Sun Aug 05, 2012 3:12 pm

Re: Transistors and the Raspi.

Thu Aug 07, 2014 9:25 pm

You could try a solid state relay, which is optically isolated, look up the LCA710. Rated at upto 60v and 1.8A in dc config.
Dearer than a transistor or fet. Just put a 330ohm resistor at the input.
Attachments
ST-4_interface2.jpg
example using LCA710's
ST-4_interface2.jpg (44.37 KiB) Viewed 655 times

Return to “Beginners”