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 7431 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

    Hi,

     

    You guys seem to be pro at the RPi and relay control.

    Can you guys offer some tips as to how I would control this 12v relay from it?

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

    Personally

    I'd be asking Sainsmart for some info as their document page is empty.

     

    It hints at needing a 15-20mA driver, but the picture shows some logic chips on board.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • gdstew
    gdstew over 12 years ago in reply to mcb1

    It hints at needing a 15-20mA driver, but the picture shows some logic chips on board.

     

    They look like opto-isolators to me. There are very few if any 4 pin logic chips in DIP packages that I am aware of.

     

    3.3V logic outputs will work with TTL compatible inputs (2.4V min. logic high). They will not work with CMOS inputs (40xx, 74HCxx)

    when they use a 5V supply.

     

    Edited to add:

     

    NOTE:

    If a TTL compatible input is tied to +5 through a pull up resistor it is not a good idea to connect it to a 3.3V output. If the

    ICs on the relay board are opto-isolators then I suspect the anode of the IR LED in the opto-isolator is connected to

    +5V through a current limiting resistor and it would NOT be a good idea to connect this directly to a RPI output.

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

    I need a 12v relay to use with this 12v solenoid

     

    Could you offer an alternative 12v relay board?

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

    No you don't.

     

    You need a relay that is capable of switching a 12v load at whatever current the solenoid draws.

     

    Any 5v relay that has 2Amp contacts should be fine to switch this solenoid.

     

     

     

    Mark

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

    No you don't.

     

    You need a relay that is capable of switching a 12v load at whatever current the solenoid draws.

     

    Any 5v relay that has 2Amp contacts should be fine to switch this solenoid.

     

     

     

    Mark

    • 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