In this tutorial we will be using an PIR motion sensor. We are going to program our surilli with a very basic program for Motion detection. In this program, whenever a motion is detected, it sends a digital value “1” to surilli, and when no motion is detected the digital value remains “0”.
What is PIR Motionsensor :A PIR-based motion detector is used to sense movement of people, animals, or other objects. They are commonly used in burglar alarms and automatically-activated lighting systems.Passive infrared motion detectors (PIR) detect emitted infrared energy – given off by humans and animals in the form of heat.When there is a sudden increase in infrared energy, a digital value is given by sensor.
In this case, When the sensor is idle, both slots detect the same amount of IR, the ambient amount radiated from the room or walls or outdoors. When a warm body like a human or animal passes by, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves.
STEP 1:Setup Arduino IDE for Surilli
Make sure you have selected the right port, board and processor for the Surilli as shown in the picture below and it is programmable (compile and upload “Blink” from File>Examples>Digital>Blink onto your Surilli to check if every thing is working fine).
STEP 2: Thecircuitry:
The circuitry is very simple. It's mostly the programming.Follow the Figure 1 to setup your hardware.
STEP 3:Upload & Burn Code Onto Surilli
- Now you have completed setting up your hardware and Arduino IDE. Copy and paste the Arduino sketch given below into your Arduino IDE and hit upload.
- After it is uploaded, the PIR Motion sensor will start detecting motion.
Play with the program to see how it reacts to different values and logic. This will develop your understanding about motion sensors so you can use them in your practical application.
Note:Builtin LED of surilli is inverted, means when value is zero, it will be turned ON and vice versa.
If you make something fun and interesting do share it with our community :)
That’s all for now. If you have any queries, visit surilli.io or contact our support. Stay connected with Surilli family for more amazing stuff :)
Comments
Please log in or sign up to comment.