Working with Sensors is always amazing. I am always excited when I run my first Sketch with a new type of Sensor and they always get successful in impressing me. This Sensor is one of them, it is so small yet powerful. When somebody walks into my room it notifies me, isn’t that cool? For demonstration I made a Burglar Alarm System with this. Its detecting range is upto 6 meters. It plays buzzer and light up LED when detects any intrusion in my room. Let us understand about PIR Motion Sensor and its working to create some cool stuffs like this.
“A passive infrared sensor (PIR sensor) is an electronic sensor that measures infrared (IR) light radiating from objects in its field of view.” It is also referred to PIR, “Passive Infrared”, “PID”, “Pyroelectric”, or “IR motion” sensors. These are small, inexpensive and operates on low power. PIR sensors are most commonly used to detect motion like if someone moves in or out within the Sensor’s range.
Everything emits some radiations if human, animal or any object passes within the Sensor’s range, the temperature at that point in the sensor’s field of view will rise from room temperature to body temperature, and then back again. The sensor will detect the change in Infrared Radiation. PIR Sensors are basically made of a “Pyroelectric sensor” which can detect levels of infrared radiation “Pyroelectricity” means- heat that generates electricity, hence these sensor converts change in Infrared Radiation to Change in Output Voltage. These sensors usually have a small plastic covering which is actually the lens which increases its sensing range. The Plastic lens have may multiple facets to focus the infrared energy onto the sensor. Each individual facet is a Fresnel lens. PIRs does not emit any Infrared and unlike other active sensors they does not send out anything hence they are called Passive Sensors. This image will help you to understand the working of PIR sensor.
For this project we are going to make a Burglar Alarm System. It will detect intrusion or any fire outbreak in your home. Let us see its working in action.
- LinkIt One Board
- PIR Sensor
- An LED
- A Buzzer
- Grove – PIR Motion Sensor
In this article I am going to use Grove’s PIR Motion Sensor and going to show its working with LinkIt One. This sensor has Grove compatible interface, you have to just connect it through the Base Shield and start programming for it. If you are not aware of Grove Sensors please go through my article
This sensor has max 6 meters of detecting range but by default it is 3 meters, you can increase or decrease it by attaching a Potentiometer to the circuit. Other Specifications are-
• Grove compatible interface
• Voltage range: 3V–5V
• 2.0cm x 4.0cm twig module
• Detecting angle: 120 degree
• Detecting distance: max 6m (3m by default)
• Adjustable detecting distance and holding time
Since we are using Grove’s Sensors we don’t have to worry much about the connections or polarity. Here I have placed the Base Shield on my LinkIt One board and connected the PIR Sensor to pin D2 and I also hooked up an LED to pin D4 and a Buzzer to pin D3 so in case if a motion is detected it will alert us.
The code is self-explanatory. When a motion is detected we are sending output to the Buzzer and LED.
I am including a complete working code with this article, you are free to download it and can play around that.
- Thief-guarding System
- Occupancy sensors- If somebody is in room it will turn on the lights
- Motion activated outdoor flood lights (definitely will save electricity)
- Automatic Doors