Posts: 29
Joined: Tue Feb 10, 2015 12:45 pm

Relay to control mini 5v fan

Sun May 31, 2015 3:38 pm

I have a spare Raspberry pi Model B rev2 laying around which i use for various projects. I wanted to install a mini 5v fan on top of it because it gets a bit hot during the summer.
Now i want to be able to control the fan with a python script, instead of it being on all the time using the raspberry pins (5v, ground).
I had a spare 2 channel relay so i thought i can use that to turn the fan on/off.

So i connected the relay to the 5v, ground and GPIO 3 on the pi and with a simple python script i can turn on/off the relay.

Now my question can i connect the fan also on the relay so that the raspberry powers up the fan, instead of using an external power source.
Do i just hook up the 2nd 5v pin on the pi ? And what about the Ground pin ? Its occupied now by the relay ground pin ?

My relay's jumper is set to JD-VCC, VCC.


Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Relay to control mini 5v fan

Tue Jun 02, 2015 5:38 pm

And what about the Ground pin ? Its occupied now by the relay ground pin ?
The main header on the Pi has several pins that are connected to ground - you can use any one of them.

But ... you need to know how much power your relay + fan will use. The Pi has limited power available. The power is limited by a poly fuse, even if the power unit you use can deliver more, so if you draw too much, the poly fuse will open and turn everything off. Remember that the Pi's power supply may also be required to supply any usb devices if they aren't attached through a powered hub.
Also you may find that the surge of demand when the relay and fan turn on together will drop the supply voltage enough to stop the pi even without blowing a fuse.

So check the power (milliamps) that the fan and relay require. If this is within the Pi's capacity, give it a try. If the Pi stops/reboots when you turn the fan on, then it's probably the initial start-up surge that's causing the problem.



Return to “Interfacing (DSI, CSI, I2C, etc.)”