2

This question already has an answer here:

Following up from this thread : Raspberry pi Model B - Control a mini fan

I found a relay switch that I had laying around... so I thought since I can control the relay with python, then why not attaching the 5v fan on the relay so I can control it. (basically I want to be able to switch 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.

relay pi Now my question is... how can I connect the fan also on the relay/pi so that the raspberry powers up the fan as well, instead of using an external power source. Do I just hook up the 2nd 5v pin from the pi on it? (through the relay) And what about the Ground pin? Its occupied now by the relay ground pin? Can I just put 2 cables on the same pin?

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

marked as duplicate by goldilocks Jun 2 '15 at 13:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You should post some schematics, at least for the relay module... – Florian Fida Jun 1 '15 at 16:03
  • This is how i hooked up the relay: driscocity.com/wp-content/uploads/2014/05/connectrelay1.jpg and this is how i hooked up the fan to the relay and the pi: i.stack.imgur.com/zW5oL.jpg I am not following the 1st image's pin suggestion, i used gpio18. Its working fine now :) even the python script to control it..no hiccups whatsoever. – Sandbird Jun 1 '15 at 20:53
  • Congratulations :) Just one thing... Since you are powering a fan and a relay module directly from the 5V pin, make sure you do not exceed any power ratings. – Florian Fida Jun 1 '15 at 21:11
  • I know about the 'backfire' of the fan that it might produce some electricity and return it backwards but i hope that the circuits on the relay will help with that. And since when the power is cut 1st on the relay and then on the fan i guess i am safe if the same thing happening when i 'open' the circuit. – Sandbird Jun 2 '15 at 0:29
-1

I connected the (-)black cable of the fan to the same Ground pin the relay is connected, then i connected the (+)red cable to the relay switch, then the 2nd hole from the relay switch to the same red cable the relay is connected to the pi.

  • Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. – Bex Jun 2 '15 at 7:28
  • it is the answer...not additional information :) – Sandbird Jun 2 '15 at 11:20
  • 1
    It may be the answer, but it is less than clear what is connected to what. Are you powering the fan from the PI? You should edit your answer to be more clear and perhaps include a diagram or series of pictures showing the connections. – Steve Robillard Jun 2 '15 at 11:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.