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

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


  • dzee
    replied
    Jeanv, Yes, you got it. I used the breakout board so that I could just solder it down, and if I ever need to pull the RasPi for service, I can keep all the wires attached to the break-out board and relay board, and not have to worry about connecting the wires back to the right pin. Of course, you can do that with the relay board too, since it has pins on top to add another hat. I have another relay board that is identical except it does not have the through pins to add another hat on top of it.

    Regarding the resistors, yes, those are the RaspPi's internal resistors that can be set from the RaspberryIO software. No need for an external resistor. I have fairly short runs between the dry contacts and the device. With regard to GPIO pins, the relay has defaults and jumpers to select alternates, but after you choose those, use whatever is left and assign them to inputs in the plug-in.

    I've not had a single problem with the reliability of this setup since it went in this spring, and its reaction time is nearly instantaneous so I couldn't be happier. Especially since it's also communicating over Wifi.

    Leave a comment:


  • jeanv
    replied
    dzee, I think I just found the answer online.. This must be the Raspberry Pi's internal pull-up or pull-down resistors that you can enable for digital inputs so the Pi can detect when a switch is closed (it changes the pin state from High to Low or Low to High). So there is no need for any external resistor correct? Also, is there a preference as which GPIO pins to use for the inputs?

    Leave a comment:


  • jeanv
    replied
    dzee, thanks so much! I just ordered the relay board you told me about from Amazon and some female to male pin wires. I am confused about a few things:
    1. You talk about a break out board... like a breadboard? Why? (Can you not just connect directly to the GPIO pins that the relay board exposes that the relay board itself does NOT use? (From what I read, it uses GPIO PINs# 37 (BCM 26), 38 (BCM 20), 40 (BCM 21) so I should be free to use the other GPIO pins, right?)
    2. I see in the screenshot you posted a reference to a "resistor" field... I do not understand this field. You say you are connected a simple reed switch to the pins and that is it, what resistor are they talking about here?

    Thanks for any guidance!

    Leave a comment:


  • Timon
    replied
    Another way is to use the Pimoroni Automation HAT for Raspberry Pi. It has three SPDT relays, three output that can handle 24V loads, three pinouts that can handle 24V inputs and 3 analog inputs that can handle 24V inputs. Just use it without the Automation HAT drivers and don't use the I2C pins for I/O.

    You won't be able to use the analog inputs with RaspberryPi IO but I hope that someday RaspberryPi IO will be able to handle the board including its LEDs and A2D.

    I'm ordering one and will be looking to update the native drivers so it can drive the LEDs.

    Leave a comment:


  • dzee
    replied
    Hi Jeanv, The relay board only handles the outs (relays) and the RaspPi handles the dry contacts directly by setting whichever GPIO pins you like (that aren't already spoken for by the relay board) as Input in Spud's plugin. See screenshot below.

    I have magnetic reed switches connected as dry contacts, and haven't had a problem with bounce. You'll notice that the relay board I posted earlier has pins to add another hat on top of it. Note that some do not. Either way, you can connect your dry contacts right onto the GPIO pins but I used a break-out board. This just takes the pins from the RasPi and runs them out to solder pads. So, I have the RasPi, the breakout board, and finally the relay module stacked inside a weather-tight enclosure.

    Here's what this looks like once setup inside the RaspBerryIO Plugin, and an event that checks the status of a dry contact and then triggers the relay for a 1000ms pulse to run the garage door opener (or in this case "closer").


    Click image for larger version  Name:	relay.png Views:	1 Size:	428.8 KB ID:	1265933
    Click image for larger version  Name:	relay-event.png Views:	2 Size:	89.7 KB ID:	1265934

    Leave a comment:


  • jeanv
    replied
    Yes, I would FAR prefer to do this via the ELK, but this is for controlling outdoor items where I do not have all the needed wiring. I need 2 SPDT relay outputs (I have plenty of those on my ELK) and 3 simply dry contact inputs (again, tons of those on the ELK), but to do that I need 12 wires.. I currently have a CAT 5e run to the outdoor location and power is very close by so I figured I would simply supply the power and do the logic at the location and use the CAT 5e to give the Pi network connectivity.

    Had I run 18/2 and a few more CAT 5e to that outdoor location from the wiring closet I could have done everything from the ELK (which is exactly what I would have wanted).

    So now I need to learn how to make the Pi do what I do on the ELK

    Leave a comment:


  • Krumpy
    replied
    Jean, you sure you don’t want to do this via the Elk?

    Leave a comment:


  • jeanv
    replied
    dzee, I saw that board and it made sense since it will handle the Relay Outputs using the GPIO pins, but how do you take the dry contact inputs on any of the remaining pins? I am sure it it not hard, but do you have schematic of what you have done? What GPIO pins did you use for your dry contact input?

    Leave a comment:

Working...
X