Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8051

Automation, sensing and robotics • Re: Control main AC voltage with raspberry pi 2 and relay

$
0
0
I wired the relay without AC load and tested with a python program and it works.

Code:

from gpiozero import LED,DigitalOutputDeviceimport timer1 = DigitalOutputDevice(17,active_high=False) print('r1 on')r1.on()time.sleep(5)print('r1 off')r1.off()
Now I would like to connect an AC light bulb and test.
Can any one please review and confirm below wiring is correct?
relay-wiring.jpg

Statistics: Posted by sim_tcr — Mon Feb 24, 2025 4:59 am



Viewing all articles
Browse latest Browse all 8051

Trending Articles