High voltage is being used, I know little about electrical work so I urge you make sure that you double check and don’t use this as a manual.
I work evenings and have to stumble trough a garage on my way in to the house. Got tired of almost falling over using my phone for light.
I hooked my Raspberry pi 3 with up a motion sensor (HC-SR501) and a relay to turn on and off a light.
From the motion sensor before the signal is going back to the raspberry I put a 10k resistor so the GPIO port wouldn´t fry. I’m not sure if it was a bit overkill? (the tutorial looked like a 100 ohm), but it works fine.
The relay is connected to a cable with a female and male plug to connect the light in and to the wall socket. Half way in on the cable I cut it open to plug in on of the cables to the relay to create the switch.
Pins on RPI:
##Triggers & Alerts
I used a trigger to turn on the relay when the motion sensor detects movements and one trigger to turn it off when no movement is detected. I will add an alert to send me a text if movements occur when I´m at work to find out if there is any intruders, might remote access the camera to take a picture…