Follow the Snap Circuits platform!
OverviewWhat Are Snap Circuits?
Snap Circuits makes learning electronics easy and fun! Learn how to integrate Snap Circuits with your hardware. Fun for Kids!
Introductory Project
If you have not completed the introductory project, please see Snap Circuits - Introduction. This project also contains a complete index of Snap Circuit projects.
Let's Get StartedProject Objective
This experiment will demonstrate the how to detect motion using the Snapduino.
Building the Circuit
The minimum set requirement for this project is Motion Detector set, SC-100 and the Snapduino. Build the following circuit by following the directions in the PDF file:
Click the link below to download a PDF file containing the circuit diagram and instructions to build it (the PDF file can also be found in the GitHub repository).
Download Circuit Diagram and Instructions
Completed CircuitThe Circuit
The motion detector component U7 can detect motion when powered with 5V. The middle snap on the U7 component will have an output of HIGH when motion is detected and LOW when there is no motion. The Snapduino monitors the output of the motion detector on pin PB2 and turns the LED on, connected to PB4, whenever motion is detected.
The LED D1 is connected to PB4 through the current limiting resistor R1 to ground. When PB4 is HIGH, the LED will turn on. When PB4 is LOW the LED will turn off.
The Software
The code in the sketch sets up PB2 for input and PB4 for output. In the loop, the state of PB2 is read, and if HIGH, the output of PB4 is set to HIGH. If PB2 is LOW, the output of PB4 is set to LOW.
Comments