0

I have a Pi Zero W and a Velleman VMA406. Wired like this

Pi Pin 2 (5v) - Relay "+"

Pi Pin 6 (GND) - Relay "-"

Pi Pin 11 (GPIO 17) - Relay "S"

When I run the following script I see a faint flicker on the Relay LED but I do not here the relay "Click"

#!/usr/bin/env python

import time
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.output(17, GPIO.LOW)

time.sleep(0.25)

GPIO.output(17, GPIO.HIGH)
GPIO.cleanup()

When I "jumper" across the "+" and the "S" on the relay I here the relay click. But I cannot seem to get my code to "click" the Relay. I am not super familiar with the python program and it was copied from another site. Is my problem in the code or in the wiring?

3 Answers 3

3

The relay was designed to be operated with a +5V signal, according to its specification. The Raspberry Pi GPIO outputs 3.3V signals.

So, this relay is not usable as is with the Raspberry Pi. You will need to either create an external transistor circuit that will control a 5V signal, or use a different relay board.

0

I have the same hardware and setup attached to the same pins on my Raspberry PI B.

The control signal specification in Velleman's manual indicates 5 - 12 VDC and lacks a minimum current specification which made me look at the circuit. The input circuit contains a transistor, a resistor, and an LED. The same components an indicating level translation circuit would use. The red LED shines bright when the GPIO output is left on and the relay clicks.

Your program allows a quarter second on time which is a very brief period of time. A flicker of the LED. Set the time to 5 seconds or run the program interactively.

0

As told in a previous answer the Pi Zero GPIO's are 3.3V based. Most relay boards (including your's) you can find are designed for use @ 5V. I was looking for a relay board which supports 3.3V input. It's difficult to find one, but I found one on Amazon. I ordered it today and am looking forward to do some testing. According to the description it has "Separated power supplies input pins for relay coils (5V) and optic isolators (3.3V-5V). Which allow 3.3V optic isolator driving by Raspberry PI" !

[update 24-nov-2018] I can confirm the board i bought on amazon is working perfectly fine! I have not seen any issues yet.

1
  • Thanks for your answer. I've been prompted by the system to review your post, and make suggestions to help you improve it. It's not entirely clear that your answer addresses the question. If you feel the issue was that the relays the OP used weren't specified for operation at 3.3 v, you must say so in your answer. Otherwise, most readers just won't "get it". And you ARE allowed to post links to the product you bought. Please read "How to write a good answer", then edit your answer.
    – Seamus
    Sep 16, 2018 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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