+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
Raspberry Pi, Arduino & Other SBCs Thread, Programming Raspberry Pi in Technical; Originally Posted by dhicks Any idea how to go about getting the GPIO pins to drive a relay? If I ...
  1. #16


    Join Date
    May 2009
    Posts
    3,260
    Thank Post
    287
    Thanked 878 Times in 657 Posts
    Rep Power
    339
    Quote Originally Posted by dhicks View Post
    Any idea how to go about getting the GPIO pins to drive a relay? If I understand correctly, most relays need 5v to operate them, but the Raspberry Pi can only provide 3.3v and would be damaged by trying to provide 5v. Any idea how I go about using the Raspberry Pi to control a relay so I can switch motors / solenoids / etc on/off?
    You can use a 'Darlington Transistor' (actually a pair of transistors) AND a diode to prevent any issues with back EMF. The Darlington handles the switching - you feed it the output from the pin and it will switch a higher load, in this case a relay. Once a relay has been triggered, the coil is 'charged' and then the switching current is switched off, the coil will dump it's energy into the circuit as "Back EMF". The Diode will only allow current to flow one way, so will prevent a surge going back to the input (possibly causing the Darlington to re-trigger).

    The PicAxe manual on basic circuit interfacing might be a very useful resource. There should be no difference interfacing to output pins on the PI.

  2. Thanks to pcstru from:

    dhicks (2nd July 2012)

  3. #17

    Join Date
    Sep 2012
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I have found the following book to be a good resource Raspberry Pi for Schools. I thought I would learn this before my students start to teach me. I have also found the following resources useful Computer Laboratory: Computer Lab Raspberry Pi Tutorials and www.raspberrypi-tutorials.co.uk.

    If anyone has any other useful resources please let me know.

    Thanks
    Felix.

  4. #18
    januttall's Avatar
    Join Date
    Sep 2010
    Posts
    225
    Thank Post
    17
    Thanked 28 Times in 28 Posts
    Blog Entries
    1
    Rep Power
    14
    Quote Originally Posted by dhicks View Post
    Any idea how to go about getting the GPIO pins to drive a relay?
    Start with a few transistors they switch with .5v but can handle much more on the other side enough for a relay definitely. i know its a pain but its the best way from going pin to relay. the transistor its self may be able to drive much of what your after, without the need for a relay.
    Last edited by januttall; 7th September 2012 at 10:26 AM.

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Raspberry Pi Ideas
    By LosOjos in forum Raspberry Pi, Arduino & Other SBCs
    Replies: 54
    Last Post: 5th December 2012, 11:53 AM
  2. Raspberry Pi - Almost here
    By Dos_Box in forum IT News
    Replies: 79
    Last Post: 13th April 2012, 09:26 PM
  3. Raspberry Pi
    By alonebfg in forum Hardware
    Replies: 3
    Last Post: 7th June 2011, 10:06 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •