OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi with relay card on GPIO

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42752

    mdpluimers
    Participant

    Hi,

    I have some dificulties with my Raspberry Pi OSPi and a relay card attached to the GPIO pins. I moved from SIP (Dan-in-CA) to OpenSprinkler Unified Firmware. I removed SIP from my Pi and setup OpenSprinkler Unified.
    My setup with SIP was a relay card connected to GPIO 11, 12, 13, 15, 16, 18, all working fine (the hardware part). Now it looks like the relays connected to 11, 12, 13 get constant high, and 15 is continuously switching. Higher pin numbers do nothing.

    It is possible to choose the pins, but not for Pin 15. I used the webinterface to do the setup.

    I have the latest release of OSPi and of the app.

    Anyone any idea what is going wrong/what i’m doing wrong?

    #42754

    Peter
    Participant

    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.

    Pete

    #42757

    mdpluimers
    Participant

    Thank you for the Response. I am using a Active High board. Already tried Active Low setting, did not see any difference.

    Thijs weekend i Will try what you mention. I Will Keep you updated.

    #42765

    Peter
    Participant

    OK, so I was blind to the obvious …

    SIP uses the physical number of the header pin rather than the OperSprinkler convention of using the logical GPIO number. See attached diagram for the mapping.

    This also explain the constant high/switching on physical pins 11, 13 and 15 as these are used by OS to control the onboard shift register hardware.

    So before you try any of the above tests, just re-connect the relay board to a set of pins marked with GREEN arrows and use the corresponding GPIO number in the Station settings.

    Fingers crossed,
    Pete

    Attachments:
    #42770

    mdpluimers
    Participant

    That might Just Be the answer….. I’ll Let you know hopefully this weekend.

    Thanks!

    #42789

    mdpluimers
    Participant

    Had some time left after mowing the lawn. Changed the pins to the right ones… aaaand, it’s working! Thanks!

    Now I van enjoy a lot more development compared to SIP.

    #42791

    Peter
    Participant

    Great stuff. And good to learn that SIP uses a different pin convention.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi with relay card on GPIO