1

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

#!/usr/bin/python
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

# 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

try:
  GPIO.output(2, GPIO.LOW)
  print "ONE"
  time.sleep(20); 
  GPIO.cleanup()
  print "Good bye!"

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

  # Reset GPIO settings
  GPIO.cleanup()


# find more information on this script at
# http://youtu.be/oaf_zQcrg7g

closed as unclear what you're asking by Steve Robillard, Milliways, Jacobm001 Feb 20 '17 at 20:29

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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 – Steve Robillard Feb 19 '17 at 0:26
  • The valves also expect 24V not the 19V you mention. – Steve Robillard Feb 19 '17 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? – Wayne Irwin Feb 19 '17 at 0:55
  • the diagram is nice but we need photos. A diagram shows what should be a photo shows what is. – Steve Robillard Feb 19 '17 at 0:57
2

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? – Wayne Irwin Feb 19 '17 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 – Mohammad Ali Feb 19 '17 at 2:07
  • @goldilocks why would you recommend controlling the return to ground from the relay and not the power going into the relay? – Mohammad Ali Feb 19 '17 at 16:36
  • Actually I'm not sure that what I was saying applies ;) – goldilocks Feb 20 '17 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 '17 at 18:30

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