A friend asked me about PIR Motion Sensors and how they
work. Recently I got one for one of my projects. As soon as I got it the
first thing I thought of was to write an article about it. Working with
Sensors is always amazing. I am always excited when I run my first
Sketch with a new type of Sensor and they never fail to impress 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 a demonstration I
made a Burglar Alarm System with this. Its detecting range is up to 6
meters. It plays a buzzer and lights a LED when it detects an intrusion
in my room. Let us understand about PIR Motion Sensors and how they work
and how to create some cool stuff 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 as a PIR, "Passive Infrared", “PID”, "Pyroelectric", or "IR motion" sensors. These are small and 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 radiation whether human, animal or any object passing 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” that can detect
levels of infrared radiation. “Pyroelectricity” means heat that
generates electricity, hence these sensors convert changes in Infrared
Radiation to a change in output voltage. These sensors usually have a
small plastic covering that is actually the lens that 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 do not send anything out hence they are called Passive Sensors.
This image will help you to understand how a PIR sensor works.
For this project we will make a Burglar Alarm System. It will detect intrusion or any fire outbreak in your home. Let us see how it works in action.
Prerequisite
Arduino Compatible board with power supply
PIR Sensor
A Buzzer
An LED
In this project I will use Grove’s PIR Motion Sensor and will show how it works with Intel Galileo Gen1. You can reproduce the same example with Galileo gen2 or Arduino boards. This sensor has a Grove compatible interface, you need to just connect it through the Base Shield and start programming for it. If you are unfamiliar with Grove Sensors then please go through my article Grove Starter Kit With Intel Galileo Gen 2: Getting Started . This sensor has a detection range of a max of 6 meters 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 need to worry much about the connections or polarity. Here I have placed the Base Shield on my Galileo Gen 1 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 when motion is detected it will alert us.
Comments