Introduction: Sparkfun Redboard Motion Sensor Light
Do you need a light for when your kid is sneaking out of there room? Maybe out of the house? Any pesky neighbors going through your yard? Maybe the bears have been getting in the trash again? On this project, you will create a motion sensor (input) that lights up an RGB LED (output) when your distance has been met. Your LED will light up with a different color depending on how far away the motion occurs. I choose this project for multiple reasons. My wife is pregnant right now and we are in the process of buying a house. I can think of many reasons why we will need motion-sensing lights including wild-life in the yard, kids crawling around, or just getting up to use the restroom at night. This project is set up for beginner-level folks similar to myself. \
Resources: "Circuit 3B: Distance Sensor." SparkFun Inventor's Kit, 2019, pp. 60–64.
- Motion sensor
- RGB LED
- 3 resistors
- 10 jumper wires
Step 1: Setup Your Board
- Insert a distance sensor and RGB LED on the same row.
- The Distance Sensor should be A3-A6.
- RGB LED should be A22-26.
- Just a note, if the sensor isn’t working properly, you may have the LED on backward.
Step 2: Create Your Code
Here is my code. This code can also be found at File>Examples>SIK-Guide-Code-master>CIRCUIT_3B-DISTANCE SENSORS.
Step 3: Plugin and Upload Your Code
It should look like this!