The relay is connected to 5V = VCC, Ground = GND and GPIO 23 = INN.
When i messure the voltage on VCC and INN on startup its about 0.6volts. When i run the script and setup the pin and make the output LOW(relay ON) the voltage goes to 4,75 volt and the relay is turning on but when i set te output to HIGH(relay OFF) nothing happend and the voltage is about 1.5v volt.
When i switch the board to 3.3v everything worked fine but its 5v relay why do i have to connect it to 3.3v to get it working?
Can someone help me out ?
My code is:
Code: Select all
import RPi.GPIO as GPIO
import time
RELAY_PIN = 23
GPIO.setmode(GPIO.BCM)
GPIO.setup(RELAY_PIN, GPIO.OUT)
print 'Relay ON'
GPIO.output(RELAY_PIN, GPIO.LOW)
time.sleep(2)
print 'Relay OFF'
GPIO.output(RELAY_PIN, GPIO.HIGH)
