OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Relay not disengaging with 16 relay board

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #46874

    mjtice
    Participant

    Hi, I’ve managed to pick up a Rpi 3 and a Sainsmart 16 channel relay module (here).

    OpenSprinkler 2.1.7 was installed, on a fresh raspbian OS, by following
    Tthe instructions here.
    This board needs to be independently powered via 12v. I’m using a 12v, 1.5A DC wall adapter pulled from my old Nexus player (attached images)
    I’ve connected the relays 1-9 to GPIO pins 18,23,24,25,8,7,12,16,20 (these are the BCM numbers, btw).
    Using this quick python snippet I’m able to engage/disengage the relays:

    import RPi.GPIO as GPIO
    import time
    
    #set up GPIO using BCM numbering
    GPIO.setmode(GPIO.BCM)
    
    chan_list = [18,23,24,25,8,7,12,16,20]
    
    GPIO.setup(chan_list, GPIO.OUT)
    
    GPIO.output(chan_list, GPIO.HIGH)
    time.sleep(5)
    GPIO.output(chan_list, GPIO.LOW)
    
    GPIO.cleanup()

    This tells me that the pi is successfully engaging the relays via the gpio – so hardware seems to checkout okay.

    However, when I manually run a zone via OpenSprinkler the relay will engage but it never disengages. I’m not sure what I’m missing.

    #46924

    geko
    Participant

    Hello,
    I’ve got the same problem.
    Nobody a solution?

    Regards
    Geko

    #46925

    geko
    Participant

    Hi,
    I just found out, that it works (4 Relay testboard… my 16 Relay is on the way 🙂 ) when I connect it to the 3.3V!

    Regards
    Geko

    #46927

    mjtice
    Participant

    I think I got it figured out. After reading around it looks like you need to pull down each relay with a 1k resistor. So I ended up taking a jumper from gpio 18 (for example) and connecting a 1k resister to it. Then from the resistor I used another jumper and connected it to one of the pins on the relay board. Also I needed to set the Active State (I think that’s the setting) in OS to ‘low’.

    #47160

    bluezp
    Participant

    mjtice – can you post an updated picture of what your wiring looks like now? I was about to buy the same relay board to use with OS and want to make sure I set it up correctly!

    #47162

    mjtice
    Participant

    Nah, sorry. I keep running into design issues so I don’t have anything assembled. If it helps, The additional parts I need to buy/have bought are: adafruit proto hat for rasp pi. Some in-hole screw down terminals, and some different types of jumpers.

    I figured I’d solder the hat to the gpio. Then solder on the 1k resistors. Then solder the screw terminals. Then from the terminals I’d attach them to the relay board like in the picture shown.

    If I was to do this over again I’d probably buy 2-8 channel relays… Going with the 16 channel has ended up taking up too much time and money.

    #47164

    geko
    Participant

    Hi,
    My system runs till 2 days very well.😀

    Attachments:
    #47312

    Ray
    Keymaster

    When using a relay board, just be careful what type of relay board you have. Some are active high, some are active low. In fact, a lot of relay boards I’ve seen are active low (which means a ‘low’ signal activates the relay). Also, as suggested in this thread, a pull up/down resistor might be needed.

    #52230

    baggar11
    Participant

    I know I’m late to the party on this, but I had the same issue with an RPI3 and the 16 relay sainsmart board. I read that others were having the same issue apart from OpenSprinkler and solved it by connecting the 3.3v gpio pins instead of the 5v pins on the RPI3. I tried it out and it worked. And in my case, the PI3 is being powered from the 3.3v pins, so only the 24vac and 12v dc psu needed.

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

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Relay not disengaging with 16 relay board