This tutorial will teach you how to use arduino and PIR Motion sensor for doing awesome projects.
By Using PIR Motion sensor you can do projects like switch on the Lights when person entries the room/house. PIR Motion sensor is very important in Home Automation. If you use this sensor then you can save some electricity.
I’m showing you a simple example where PIR Sensor will be connected to arduino and when some motion is detected then the default arduino LED will be on and when the motion is not detected for more then 10 sec then the LED will e turned off.
This project can be extended by using Relay to switch on Light , Fans etc….
In fact in next tutorial i’ll show how to use Relay is integrated to PIR Sensor. Lets stop this theory and start doing practically.
Things to be done:
- I’ll show How PIR Motion sensor looks.
- I’ll show how Arduino looks for who are new to Arduino.
- I’ll explain Connection between arduino and PIR.
- I’ll explain the code.
- More important i’ll give link for code – Github.
PIR Motion Sensor
Interface between Arduino and PIR Motion Sensor
There are only connection it’s very easy. The PIR sensor output is digital.
The output is HIGH when the motion is detected.
The output is LOW when the motion is not detected.
This is code where we define pin 3 as PIR digital input to arduino.
According to datasheet the calibration time of PIR sensor is between 10 – 60 sec.
When there is motion the LED will be on, this is shown in below image