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

  • 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:


  • jeanv
    replied
    It looks great and works perfectly!!!! Thanks so much for the recommendations, help, and this plugin!!

    Click image for larger version

Name:	IMG_0713.JPG
Views:	71
Size:	114.5 KB
ID:	1266509

    Leave a comment:


  • jeanv
    replied
    dzee, yes in looking at the board, I agree it is overvill and add some complication to the layout. I trying to figure out the best way connect the Digital Inputs securely.. Maybe a board that breaks out the pins to screw terminals or just solder or jumper the pins.... thanks again!

    Leave a comment:


  • dzee
    replied
    Hi Jeanv, Here's the break-out board I used: https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

    I actually used this because I had intended on hooking up a variety of I/O to this RasPi, and thought that some of the proposed uses might need circuitry I could just prototype right onto this board. It's overkill for a few dry contacts, honestly, and since it doesn't have thru-pins (at least not with the dual-row connector provided, this has to go on top of the relay hat. That's a little tricky because the relays are actually pretty tall and prevent this board from seating all the way down.

    Leave a comment:


  • jeanv
    replied
    dzee, do you have the model of the breakout board you soldered your input to?

    Leave a comment:


  • jeanv
    replied
    I bought the valve for $50 on Amazon here:

    Motorized Ball Valve- 1" Stainless Steel Electrical Ball Valve with Full Port, 9-24V DC and 5 Wire Setup, can be used with Indicator Lights, [Indicate Open or Closed Position] by U.S. Solid https://www.amazon.com/dp/B06XCN8V6W..._0vjeCb7N075T3

    A raspberry pi and the relays.. this to me is a better approach than zwave primarily since I cannot co-locate the valve and the controller. I soldered 50 feet of burial grade cat 5E cable to the valve.


    Sent from my iPhone using Tapatalk

    Leave a comment:


  • drhtmal
    replied
    Originally posted by jeanv View Post
    This will be controlling the main water valve the comes into my home.
    What is the total cost of building this solution? HomeSeer sells a z-wave water shutoff kit for about $250. I would like automatic water shutoff so I want to compare the two solutions.

    Leave a comment:


  • jeanv
    replied
    dzee, thanks again! I have 3 Ubiquiti dedicated APs thought the house, but I did not consider connecting the Pi to WIFi (I had planned to use the 1 CAT 5e I have run to the location.

    Some final questions:
    1. Have you not had any connectivity issues at all over wifi?
    2. Does the remote Pi reconnect automatically if you reboot the HomeSeer PC or connectivity is temporarily lost?
    3. Does the remote Pi reconnect automatically if you reboot the remote Pi with no problems to the HomeSeer PC?
    4. Do the relays ever change state randomly or after a reboot? (same applies to the digital inputs)

    I already purchased the board, I have a few Pi 3's and am about to purchase Spud's RaspberryIO so I am just asking so I know what I am getting into...

    This will be controlling the main water valve the comes into my home. The valve will have to be installed in the front yard in my flower bed (I wish the builder has put it in the garage behind a panel). The valve has micro switches at the end points of the Open and Close and they provide feedback of the valve status. I built a little box to demo it before I automate it.

    Leave a comment:

Working...
X