I am having a bit of an issue with the current setup. Im trying to run multiple solenoid valves of a 16 channel relay optocoupler (http://www.ebay.com.au/itm/16-Channel-12V-Relay-Shield-Module-wiht-optocoupler-LM2576-Power-supply-Arduino-/141815612900?_trksid=p2141725.m3641.l6368). I am using a 19VAC 3 amp power supply. Currently my issue is that i can't seem to get the relay to activate when controlled by the relay. I can hear the relay module tick when i run my program, but the solenoid dosen't open. When i run the solenoid directly from the power source it works. Anyone have any idea where i went wrong?

Pi Relay

import RPi.GPIO as GPIO
import time


# init list with pin numbers

pinList = [2]

# loop through pins and set mode and state to 'low'

for i in pinList: 
    GPIO.setup(i, GPIO.OUT) 
    GPIO.output(i, GPIO.HIGH)

# time to sleep between operations in the main loop

SleepTimeL = 2

# main loop

  GPIO.output(2, GPIO.LOW)
  print "ONE"
  print "Good bye!"

# End program cleanly with keyboard
except KeyboardInterrupt:
  print "  Quit"

  # Reset GPIO settings

# find more information on this script at
# http://youtu.be/oaf_zQcrg7g
  • 1
    We are going to need to see the code you are using and pics of all the connections. As written we can not answer your question. How are you triggering the relays as they require 12v Feb 19, 2017 at 0:26
  • The valves also expect 24V not the 19V you mention. Feb 19, 2017 at 0:33
  • @SteveRobillard Sorry for the lack of info, just edited the post. How come it worked when i connected it directly if the power supply is insufficient? Feb 19, 2017 at 0:55
  • the diagram is nice but we need photos. A diagram shows what should be a photo shows what is. Feb 19, 2017 at 0:57

1 Answer 1


I think that your problem may be that your relay board isnt reciveing a high enough voltage from the pi to trigger the relay to open as the magnetic field being created is likely not powerful enough. This is likely due to the product being marketed as an arduino device which uses 5 volt logic instead of the pi's 3.3v which is likely the difference between you hearing the module "tick" and it actually being activated. To solve your problem i would recommend you add an npn transistor between the pi with the base being the pi's gpio, the collector being the power supplies output(i wouldn't recommend connecting the transistors to your pi's 5v line, because although it may work with all 16 of your relays on, or even more that about 2 you are likely to be overloading your usb power supply and the pi's circuit) then you would connect the emitter to the relay board.

NOTE: be sure you get a transistor that is capable of handling your power supplies voltage and the replays required current, also be sure to get one compatible with the pi's 3.3v logic

you can read more about transistors: HERE

  • Hey, would the 3.3V logic be an issue if i connect it to the Pi's 5v rail? Feb 19, 2017 at 2:05
  • 1
    @wayne what would be the point in that? you do understand that the pi's 5v rail is just a usb passthrough and has no control Feb 19, 2017 at 2:07
  • @goldilocks why would you recommend controlling the return to ground from the relay and not the power going into the relay? Feb 19, 2017 at 16:36
  • Actually I'm not sure that what I was saying applies ;)
    – goldilocks
    Feb 20, 2017 at 9:32
  • Sorry -- I did not have time to clarify earlier. The reason I made the point about using the transistor on the line to ground is that the voltage from the emitter of an NPN transistor is not necessarily the voltage at the collector. Exactly what it can be I still don't understand; factors include I think physical characteristics of the transistor, load and current on both collector and emitter sides, base voltage (?), blah blah...
    – goldilocks
    Feb 20, 2017 at 18:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.