Rebooting R-Pi causes relay to click on.
Posted: Wed Sep 16, 2015 11:26 pm
I have a raspberry pi that I've been using to turn on a AC Solid state relay for my desktop light. It was all working fine with no issues until I replaced it with a DC SSR. Now when I reset the raspberry pi, the relay will click on which causes the light to turn on any time the power is cut to the pi. I've read about this happening but I can't find where I read it anyway and was wondering if anyone had any input on this. The pins I'm using to output a signal to the relay are the 5v for power and pin 7(on the board, not BCM). Here is the code that gets executed to turn the light on:
Code: Select all
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(7,GPIO.OUT) GPIO.output(7, not GPIO.input(7))