Announcement

Collapse
No announcement yet.

How to Get 2 Relay SPDT Outputs and 3 Dry Contact Inputs On Raspberry Pi

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dweber85rc
    replied
    I ordered pretty much everything on this list and it all showed up today, wow was it easy. I still have to wire it up in my garage but installing the raspberry pi and then setup and config of this plug in-was super easy. This was just released today which made the initial set up of raspbian easy.
    https://www.raspberrypi.org/blog/ras...aging-utility/ Good timing
    Thanks for the help and thanks spud for the great plugin.

    Leave a comment:


  • Dweber85rc
    replied
    Awesome. Exactly what I was looking for. Thank you so much

    Leave a comment:


  • dzee
    replied
    I did exactly what you want to do, but only have 2 NO/NC dry contacts, but technique will work for 6-8. I put on a 3-relay hat, and a break-out board where I soldered the dry contacts to other GPIO pins rather than directly to the RPi. This makes it easy to take apart for servicing if the need arises.

    Here's my parts list:

    RPi 3 (runs cooler than 4) - I bought a Canakit from Amazon with the power adapter and heatsinks (which I don't even use, even in 100°F summers)
    https://www.amazon.com/CanaKit-Raspb...1697869&sr=8-6

    A microSD of your choice. Probably can get away with 16GB or even less, but I buy 32GB because they're not much more and you never know.

    I used this GPIO hat ($$, but great for benchtop experimentation because it allows you to move things easily, and it had through pins I could use to mount the relay board which I wanted on top, because the relays are tall-ish.
    https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

    This 3-relay board
    https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

    If you can find a way to get through pins, this breakout PCB could be used as a cheaper alternative to connect the dry contacts, then the relay could be mounted on top of it. I think you can use this on top if you don't mind the relay board being hidden behind it. It doesn't matter which order you stack things, unless the mechanics of the connectors prohibit you from doing it, or the board is too tall.
    https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

    All of that fits inside this clear-covered project box (I drilled a hole on the narrow side to run the power, dry contact inputs and relay outputs). The clear top gives you visibility to the Rpi status lights and relays without having to open the box to see.
    https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

    With the box mounted so the hole is pointing to the floor, it keeps everything dry, and you can put a little putty or insulation in the hole to keep bugs out. Note this box has some mounting holes outside making it easy to place, and some plastic bosses inside to mount a board. These are NOT in an official RPi pattern. I can't remember if I used one to mount the board but I did have to add some super-glued bosses to support the board elsewhere if not everwhere.

    Finally, there are other options for mounting like these (which I did not use):
    https://www.digikey.com/product-detail/en/keystone-electronics/9081/36-9081-ND/4499381

    Digi-Key and Mouser are good supply houses, but shipping can add up.

    Leave a comment:


  • Dweber85rc
    replied
    Originally posted by jeanv View Post
    I do not understand your question Dweber85rc? Exactly what functions are you wanting to accomplish?
    I guess I am looking for some guidance on what "parts" to get to use a relay board on a rpi like this. Is it simply slap the hat on? I am looking for a way to control 2 garage door openers which and then have 6-8 No/nc sets of dry contacts.

    Leave a comment:


  • jeanv
    replied
    I do not understand your question Dweber85rc? Exactly what functions are you wanting to accomplish?

    Leave a comment:


  • Dweber85rc
    replied
    Would someone be willing to put together a list of everything that would be needed to make a solution like this work? I am interested in using a solution like this to automate my garage doors but new to rpi and not really sure what all I need to get?

    Leave a comment:


  • jeanv
    replied
    Thanks so much! I did use RaspberryIO plugin (

    Leave a comment:


  • Tj in Bristol
    replied
    want an easy solution, no cl commands try RaspberryIO (Spud), works well, have 1 raspberry pi for I/O and one for 8 port relay all managed by the spud module in HS

    Leave a comment:


  • dzee
    replied
    Originally posted by smithdavee View Post
    I am totally stumped.

    The new board comes with 2 dip switches, off off is the first board, off on is the second, on off the third and on on for the 4th board.

    I have double checked the devices and there is only one set.

    For some reason the plugin on the RPi is not talking to the relay board, however using the following commands on a ssh session
    works. That being said the commands only work if the plugin on the RPi is not running.
    • Turn on channel No.1 relay

    i2cset -y 1 0x10 0x01 0xFF
    • Turn off channel No.1 relay

    i2cset -y 1 0x10 0x01 0x00

    Wait a minute. Just clued in to your CLI commands. You're sending i2c commands? That's different than the GPIO protocol, and I'm not sure if RasberryIO does anything other than GPIO. Does this relay board run GPIO?

    Sent from my SM-N975U1 using Tapatalk

    Leave a comment:


  • dzee
    replied
    The dip settings you mention make sense if the boards are #0, 1, 2, 3 in binary:
    00 off-off
    01 off-on
    10 on-off
    11 on-on

    But, are you referring to different boards or all this on one board? How many relays per board? Can you send a link to the relay board(s) you bought?

    Sent from my SM-N975U1 using Tapatalk

    Leave a comment:


  • smithdavee
    replied
    I am totally stumped.

    The new board comes with 2 dip switches, off off is the first board, off on is the second, on off the third and on on for the 4th board.

    I have double checked the devices and there is only one set.

    For some reason the plugin on the RPi is not talking to the relay board, however using the following commands on a ssh session
    works. That being said the commands only work if the plugin on the RPi is not running.
    • Turn on channel No.1 relay

    i2cset -y 1 0x10 0x01 0xFF
    • Turn off channel No.1 relay

    i2cset -y 1 0x10 0x01 0x00


    Leave a comment:


  • dzee
    replied

    EDIT AGAIN: I was finally able to D/L your screen shot PDF above and view it. Your relay board should be responding to what you've named Relay19 (relay 1 on the board), Relay25 (relay 2 on the board), and Relay20 (relay 3 on the board) if you have the same relay hat as I do.

    FROM EARLIER POST:
    If you're using the same relay board, then the GPIO pins should be set the same as mine above at 20, 21, and 26 for relay 1, 3, and 2 respectively (https://forums.homeseer.com/forum/an...31#post1265931)

    There are some jumpers on the relay board to enable you to use alternative GPIO pins. How are yours set? Are they jumpered across two pins or just connected to one pin? Just wondering if the manufacturer is defaulting them a different way.

    EDIT: Just thought of something else. So, I have run into a problem where I'm getting new devices created when the RPi reboots. The old ones are there, but they're either sluggish or don't work, but the new ones do. Sort your devices and make sure there is only one device per configured GPIO in the device list.

    Leave a comment:


  • smithdavee
    replied
    Hey dzee,

    Thanks for the fast response, and no insult taken.

    I have configured every GPIO pin in homeseer, as seen in the attached pdf.
    Raspberry.pdf

    The devices do get created within homeseer, and I have tried turning them on and off, even the logs on the pi says it has seen the commands it does nothing. No LED's no click.

    I must be missing something, perhaps on the pi side.



    Dave
    Attached Files

    Leave a comment:


  • dzee
    replied
    I'm nowhere near my system right now but my first thought was whether the correct GPIO pins are configured.

    I don't mean to insult if you're very familiar with pi, but those pin numbers and GPIO numbers don't match so it always a mind twister to map one thing to another.

    Can you hear any of the relays click? Do any of the relays light? Do you see any blinking from traffic on the pi when you send a command from HS3?

    Sent from my SM-N975U1 using Tapatalk

    Leave a comment:


  • smithdavee
    replied
    Jeanv and dzee,

    I am trying to get this exact hardware to work with this plug in. I can control the relays via cmd line on the pi, however I can't for the life of me get to work from HS on my Windows box. The pi does create the remote plugin, I configure all the gpio pins to output and it creates the objects, however the objects do nothing on the pi.

    Any help would be appreciated.

    Dave

    Leave a comment:

Working...
X