We interface the IR Motion sensor “OUT” to Pin 4 and the Relay “IN1″ to Pin 8.
The light has one of the 120V wire grafted to associate the end associated with the power attachment to the COM(Common) Pin of the Relay module and the one heading off to the light is associated with the NC(Normally Closed) Pin.
We utilize a breadboard to interface the VCC and Ground to both modules from our UNO, however, we associate a 1N4007 rectifier Diode to the VCC line of the Relay Module to permit the current to go just a single way.
One critical thing that is at some point overlooked is to utilize a Rectifier Diode when exchanging High Voltage.
Some Relays have this security incorporated, however, these Diodes are so shabby, why not add another layer of insurance to our circuit.
Putting the Diode between the Relay and Arduino will shield us from power surges when the Relay switches since the Diode just permits current to stream one way.