PIR_Sensor_Relay_Control_Working by Theomachist

This sketch is missing a short description
Modified sketch that uses a simple PIR sensor and a 5v relay to switch on and off a connected light source (an old desk lamp, in my case). For flavor, I've injected a single Adafruit Neopixel to cycle the color-wheel in place of a simple static or flashing red led. This serves as indication that the program is still running, even though the relay hasn't been triggered.

Embed This Sketch

Use the following HTML code to embed the sketch code above in your blog or website.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:228658" frameborder="0"></iframe>

Embed The Serial Monitor

You can also embed the Serial Monitor section! Just use this HTML code.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>