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.

Supplies

    • Redboard
    • Breadboard
    • 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.
    • Grab 3 resistors and place them in the following locations: E22-G22, E23-G23, and E25-G25.
    • Grab your 10 jumper wires and place them in the following locations. 5V-5V, GND-GND, D3-J25, D5-J23, D6-J22, D11-E4, D12-E5, E3-5V, E6-GND, and E24-GND.
    • Make sure you plugged into your computer (I’ve made this mistake).

    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!