I bought a new house. The house had a nice sprinkler system but someone had cut out the sprinkler controller. I thought this would be a great chance for me to move from my mostly software-based experience into the electronics world. I think I've made some bad decisions and I could use some help getting this all glued together.
The sprinkler valves are Rainbirds and take 24VAC. I got a transformer from Amazon that is actually a Rainbird replacement, works great.
I ordered this relay board. Basically it's 16 Songle SRD-24VDC-SL-C relays with some LEDs, diodes and nice connectors.
That was my first bad mistake - I didn't realize I was buying relays that are powered by 24VDC rather than capable of switching 24VAC. Turns out most relays will easily handle 120VAC (wall power, duh) and so 24VAC is no problem. If I had it to do over again I'd get relays powered by 5VDC.
Next I ordered a board for connecting to my computer over USB. I went with Phidgets 0/16/16 board because, while expensive, they have really good software support and I figured I'd trade a little money for time after hearing horror stories from coworkers trying to get software working for this sort of thing.
The Phidgets board is ridiculously easy to program, especially in Python on Ubuntu. Sadly, the board is a low-end switch, which I'd never even heard of until I plugged it in and started poking the pins with my voltmeter. For those who were uninitiates, like me, it means that I can set the output pin to one of two states: open or ground. Not ground or 5V like I thought.
My original idea was to just straight wire my output pins from the Phidgets board to the relay board control lines. This doesn't work - the relays expect a high voltage control signal, not to be pulled to ground.
So my question now is what is the best thing to do to translate from ground to a 5V signal? I've been toying with the idea of using a simple 74HC14, a Hex Inverter IC, so that I feed the IC my ground and it gives me 5V. This means I am supplying 5V to the IC and a separate 24V power line to the relay board. But, it's too easy. I'm worried about the IC melting since I'm not sure how much current the relay needs on the control pin.
I've been trying to sort out if there's a simple way to turn a NPN or PNP transistor into what I need. Also, I may try soldering in a similar Songle relay that uses 5V as the power so that a single power supply can power the inverter IC (if I use it) and the relay board.
So, to summarize:
1 - What's the best way to convert 16 output pins that do ground/high impedence (low-side switching) into 5V/ground or 5V/high impdence switches (high-side switching)?
1b - Would a hex inverter IC work? If so, which is the best one to use?
2 - Should I be able to swap out the Songle SRD-24VDC-SL-C for a SRD-5VDC-SL-C on the relay board I've bought?
3 - What would you have done for this project to avoid all the pain and expense?
The sprinkler valves are Rainbirds and take 24VAC. I got a transformer from Amazon that is actually a Rainbird replacement, works great.
I ordered this relay board. Basically it's 16 Songle SRD-24VDC-SL-C relays with some LEDs, diodes and nice connectors.
That was my first bad mistake - I didn't realize I was buying relays that are powered by 24VDC rather than capable of switching 24VAC. Turns out most relays will easily handle 120VAC (wall power, duh) and so 24VAC is no problem. If I had it to do over again I'd get relays powered by 5VDC.
Next I ordered a board for connecting to my computer over USB. I went with Phidgets 0/16/16 board because, while expensive, they have really good software support and I figured I'd trade a little money for time after hearing horror stories from coworkers trying to get software working for this sort of thing.
The Phidgets board is ridiculously easy to program, especially in Python on Ubuntu. Sadly, the board is a low-end switch, which I'd never even heard of until I plugged it in and started poking the pins with my voltmeter. For those who were uninitiates, like me, it means that I can set the output pin to one of two states: open or ground. Not ground or 5V like I thought.
My original idea was to just straight wire my output pins from the Phidgets board to the relay board control lines. This doesn't work - the relays expect a high voltage control signal, not to be pulled to ground.
So my question now is what is the best thing to do to translate from ground to a 5V signal? I've been toying with the idea of using a simple 74HC14, a Hex Inverter IC, so that I feed the IC my ground and it gives me 5V. This means I am supplying 5V to the IC and a separate 24V power line to the relay board. But, it's too easy. I'm worried about the IC melting since I'm not sure how much current the relay needs on the control pin.
I've been trying to sort out if there's a simple way to turn a NPN or PNP transistor into what I need. Also, I may try soldering in a similar Songle relay that uses 5V as the power so that a single power supply can power the inverter IC (if I use it) and the relay board.
So, to summarize:
1 - What's the best way to convert 16 output pins that do ground/high impedence (low-side switching) into 5V/ground or 5V/high impdence switches (high-side switching)?
1b - Would a hex inverter IC work? If so, which is the best one to use?
2 - Should I be able to swap out the Songle SRD-24VDC-SL-C for a SRD-5VDC-SL-C on the relay board I've bought?
3 - What would you have done for this project to avoid all the pain and expense?