element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry Pi GPIO Control
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 39 replies
  • Subscribers 681 subscribers
  • Views 7424 views
  • Users 0 members are here
  • raspberry
  • gpio
  • raspberry_pi
  • raspberrypi
Related

Raspberry Pi GPIO Control

Former Member
Former Member over 12 years ago

I saw a picture on flickr, which interests me vey much. I want to make a same one, as I want to learn some more about GPIO control.

I got the raspberry Pi and this exact 8 channel relay. How can I do the wire up? There are many cables, I am a bit confused,

image

  • Sign in to reply
  • Cancel
Parents
  • pjc123
    pjc123 over 12 years ago

    Why didn't you buy the board that the flickr site told you that they used?  Unless you made a mistake, your "This exact 8 channel relay" url that you point to is a 12V 16 Channel relay board and is the wrong relay board.  You should have bought the 5V version, not the 12V version, so it works with the pi (Unless you absolutely needed 16 channels instead of 8 and planned on getting an additional 12v power supply.  Here is the proper board:

     

    http://www.sainsmart.com/8-channel-dc-5v-relay-module-for-arduino-pic-arm-dsp-avr-msp430-ttl-logic.html

     

     

    I have many very detailed threads regarding the operation and hookup of this relay on the raspberry pi site (See user pjc123) including theory, current requirements, hookup, etc.  I have been using it for several months now, and it works perfectly if hooked up properly.  A person recently drew up a very nice and extremely easy to follow diagram on how to hook it up, of which I have added a couple of enhancements.  There are also a couple of threads on how to hook it up with a darlington pair IC instead of a transistor if you so desire.  Be careful of the advice that people may give you regarding this board as there are variants from other manufacturers that do not operate the same.  The following specifically applies to the Sainsmart 8 channel 5V Relay module, part # SKU:20-018-102.

     

    Here is the hookup diagram:  EDIT:  As I indicated in the following thread, do not power the raspberry pi through the test points as noted in this person's diagram, because doing so bypasses the raspberry pi's main fuse (Unless you are adding your own protection device).  Power the raspberry pi the normal way through the microusb port instead.

     

    http://www.raspberrypi.org/phpBB3/viewtopic.php?f=44&t=36225

     

     

    There is also a solid state version of the above board but it is for AC loads not AC/DC loads like the relay board.  Also, it can not handle the higher current load of the relay board.  The relay board can handle a 10 amp load, while the solid state version can only handle 2 amps.  However there are some advantages to the solid state version.  People have indicated that it does not need a transistor or darlington pair on the front end and can be driven directly from the 3.3v signals of the GPIO ports.  Also, the current draw of the coils on the relay board are 60ma each and require an external 5v power supply to drive the coils if you plan on using more than a couple of relays simultaneously;  this is not an issue with the solid state version.  Disclaimer:  I have not used the solid state version and can only speak for what others have claimed.  Also, I have not seen detailed hookup diagrams for it:

     

    http://www.sainsmart.com/8-channel-5v-solid-state-relay-module-board-omron-ssr-4-pic-arm-avr-dsp-arduino.html

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to pjc123

    Thank you, pjc123

     

    I did make a mistake in the link to the relay board. SainSmart has so many different kinds of relays, I was a little confused.

     

    I was meaning to asking the wire up between the RPi and http://www.sainsmart.com/8-channel-dc-5v-relay-module-for-arduino-pic-arm-dsp-avr-msp430-ttl-logic.html

     

    Thank you for the detailed reply and pointing out the hookup diagram.

     

    I also want to figure out a different hook up, in stead of using a breadboard, the wire up should be like this:http://www.youtube.com/watch?v=rbkoJQEUt60

     

    The video includes a document on how to build the RPi with the relay. https://github.com/fixedd/RPi_SainSmart_Interface

     

    I am having fun with the tinkering

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • pjc123
    pjc123 over 12 years ago in reply to Former Member

    Glad to help.  Since my post, I moved my circuit from the breadboard to a circuit board, but since I am doing this just one time, rather than make or have someone make a printed circuit board I just used a pre-made circuit board and used wires to connect everything.  However, it would be a good learning experience for you to make your own pcb board, and it is nice not having to do all that wiring.

     

    I used the following BPS model BR1 solderable PC breadboard:

     

    http://www.busboard.us/pdfs/BPS-MAR-BR1-001.pdf

     

     

    I don't know if you are going to use the examples shown in the tutorial to write code for the relay or what, but there are various libraries written to control the GPIO ports.  I am using the first one, which is based on the "C" programming language:

     

     

    C:

     

    http://www.airspayce.com/mikem/bcm2835/index.html

     

    https://projects.drogon.net/raspberry-pi/wiringpi/

     

    http://quick2wire.com/2012/05/safe-controlled-access-to-gpio-on-the-raspberry-pi/

     

     

     

    PYTHON:

     

    https://pypi.python.org/pypi/RPi.GPIO

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • pjc123
    pjc123 over 12 years ago in reply to Former Member

    Glad to help.  Since my post, I moved my circuit from the breadboard to a circuit board, but since I am doing this just one time, rather than make or have someone make a printed circuit board I just used a pre-made circuit board and used wires to connect everything.  However, it would be a good learning experience for you to make your own pcb board, and it is nice not having to do all that wiring.

     

    I used the following BPS model BR1 solderable PC breadboard:

     

    http://www.busboard.us/pdfs/BPS-MAR-BR1-001.pdf

     

     

    I don't know if you are going to use the examples shown in the tutorial to write code for the relay or what, but there are various libraries written to control the GPIO ports.  I am using the first one, which is based on the "C" programming language:

     

     

    C:

     

    http://www.airspayce.com/mikem/bcm2835/index.html

     

    https://projects.drogon.net/raspberry-pi/wiringpi/

     

    http://quick2wire.com/2012/05/safe-controlled-access-to-gpio-on-the-raspberry-pi/

     

     

     

    PYTHON:

     

    https://pypi.python.org/pypi/RPi.GPIO

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube