OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › OSPi with relay card on GPIO › Reply To: OSPi with relay card on GPIO
OK, so I wired the same setup here to test that all was well with my OSPi and a Sainsmart (active low) relay board and all is good. So this might need some diagnosing…
So to confirm your situation, when you say that the relays connected to 11, 12 and 13 are constantly high, do you mean that the relays are activated and open when OSPi is running. I also assume that opening/closing the station via the UI has no effect on the relay i.e. it stays open regardless of whether OpenSprinkler has turned the station on or off.
A few quick questions:
1) what type of relay board are you using and do you know whether it is active high or low ?
2) when you say that “higher pin numbers do nothing” do you mean they were also constantly high with relays open ?
3) did you try any of the other pins particularly pins 5-8 as curious if this made a difference ?
A few quick tests:
1) Can you try switching the GPIO Station settings between “active high” and “active low” to see if that makes a difference and double check the pin numbers are set correct. This will make sure there isn’t a mix up around polarity for the relays (I know many sainsmarts are active low whereas other manufactures are more intuitively active high). This should rule out any problems with the settings.
2) If you have a voltmeter, it would be really handy to test the gpio pins without the relay board connected to confirm whether the pins toggle when OSPi turns the associated station on and off. This would rule out a software problem with the GPIO Station functionality.
3) A bit of a hail mary but can you start a fresh with a clean install of Raspian and OpenSprinkler. I don’t know the SIP programme and although very unlikely it could be some config/setting idiosyncrasy. A long shot but worth checking to rule out an operating system problem.
4) If you can reboot the Raspberry Pi without starting up OpenSprinkler then we can check to see what state each of the relays is by default. I am interested in both the relay led, if one is present, and the relay itself. Note that following a system reset, each of those GPIO pins are by default INPUT pins rather than OUTPUT and each has a pull down resistors connecting it to ground. On an active high relay board this should mean all the relays (and associated status leds) are off. On a active low board, like my sainsmart, this results in the relay leds being on but the relay itself being off i.e. there is enough current going through the pull down resistor that the led shows a dim light but not enough to activate the relay. This would rule out a hardware problem (but leave us with more diagnosing to do !)
Lastly, GPIO15 is used by OSPi for RF Stations and so it is not made available for GPIO Stations via the UI. By default OSPi sets this pin low during initialisation so it is odd that connecting it to your relay board caused “chattering”. It should have resulted in either a constantly “on” relay (if active low) or a constantly “off” relay (if active high). The only reason I can think that it was chattering is if you had an RF Station enabled and it was sending the RF code to that GPIO pin. I ran into this when developing the GPIO Station functionality and it was very unnerving to hear the relay chattering away every minute or so hence I removed GPIO15 from the selection list to avoid a possible pin conflict.
Let me know how you get on as it would be good to sort this out. The GPIO Station stuff is pretty new and hasn’t got the mileage of the rest of the system so I’m very interested in discovering the root cause to your situation.