I am trying to control a 4-Relay module with my Raspberry Pi 4. I tried to do that by writing this script:
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) relais_1 = 8 relais_2 = 10 relais_3 = 12 GPIO.setup(relais_1, GPIO.OUT) GPIO.output(relais_1, GPIO.HIGH) time.sleep(5) GPIO.output(relais_1, GPIO.LOW)
However, the relay does not turn off after that. By changing it to this setting:
GPIO.output(relais_1, GPIO.LOW) time.sleep(5) GPIO.output(relais_1, GPIO.HIGH)
It now works. But that does not make sense, does it?! Hopefully someone will be able to explain this behavior so I can learn something..
Thanks a lot in advance!