I am trying to troubleshoot an issue with a GPIO pin turning off automatically. Any advice would be greatly appreciated.
I have GPIO pin 4 connected to a relay:
https://www.digikey.ca/products/en?keyw ... 11042-5-ND
My code is:
Code: Select all
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(4,GPIO.OUT)
GPIO.output(4,GPIO.HIGH)
When I run this, I can hear the relay click on, then in about 1 or 2 seconds it clicks off. I put a voltmeter to confirm that it does in fact go high, then goes low automatically. Is it possible it is being overloaded or something?
Wiring diagram here:
https://imgur.com/HOTH5Qq