I'm new to Raspberry Pi.
I followed this source and am stuck on checking "sudo python lighton.py".
The problem is the bulb is not turn on. Also there is no click sound from the relay. I'm using relay really similar to this Relay from amazon. The module is 5v as the name said SRD-05VDC-SL-C using Raspberry Pi 3
I have connected the module like this :
relay module = raspberry pi
GND = PIN 9 (Ground)
IN1 = PIN 12 (GPIO18)
VCC = PIN 2 (5V)
the Jumper is stay on JD-VOC and VCC, other side of relay is connected as usual. just connect the wire on COM and NO.
"For testing purpose, if I switch wire from NO to NC, the bulb turns on without relay being trigger. This concludes that the bulb and bulb wiring is correct and no fault there, I guess".
Im using side 1 only that is IN1, K1.
I wrote python code to trigger the relay:
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(12, GPIO.OUT)
GPIO.output(12,1)
then I type the command on terminal
sudo python lighton.py
The result, the led on board turn on but the bulb didn't turn on and there is no click sound from relay at all.
When I change GPIO.output(12,1) to GPIO.output(12,0) then run the code, the led on board turns off but bulb and relay no change.
I'm using Raspbian OS. I believe the relay is broken, but what do you guys think?