PIR Sensor Module SE-10

manufactured by Hanseelec, sold by Sparkfun number SEN-08630

Applications

This is the sensor that activates lights or security cameras or alarms when it detects infrared energy close to it.

How does it work?

It basically scans an area and then detects movement inside of it. When it does, it sends a low through the alarm pin (black wire).

PIR

PIR stands for passive infrared. Infrared is a type of radiation that is not visible to the human eyes but can be detected. It’s part of the electromagnetic spectrum at a longer wavelength than visible light.

It has two sensing elements made of a crystalline material that generate surface electric charge when they detect a difference in heat energy in the form of infrared radiation. Each one of them measures 2 x 1 mms and they are 1 mm apart. They are connected in a way that cancels signals caused by vibration and weather. The sensing area is set at an angle so that when a body passes in front of the sensor it activates the first element and then the second one. If both elements are affected simultaneously, it gets canceled.

The lens that covers the sensing elements filters the infrared radiation to only let through the most sensitive to human body radiation (8 to 14 µm range). It also works as a focusing device. In this specific sensor it is a silicon coated material.

The detected element must pass across the sensor in a horizontal direction when both pins are on a horizontal plane and thus can get sequentially exposed to the IR source.

This kind of sensor is commonly used in two ways:

security alarms (example) and security cameras (example)

automation lights that turn on/off when people pass by (example) or to control electronic appliances (example)

more on PIR from Wikipedia

Important notes

The alarm pin (black) is an open collector, meaning that it needs a resistor (I used 10k) going to power, parallel to the cable that goes to DC. That's right, both the Alarm pin and the DC pin are connected to power.

It works from 3.3 to 12 volts ( I used it on 5 V)

Dual sensor PIR is the most widely used motion detection system. They’re false-triggered less often than ultrasonic.

Changing the cover on it can change the range they cover.

They only react to change so they can't detect someone standing still in front of them.

When using more than one, they can be connected on the same input to Arduino, however the values need to be normalized. I found it better to connect them to different analog inputs.

The PIR motion sensor needs a direct and uninterrupted line of sight. It's unable to detect through cloth or cardboard.It detects movement in front of it from about 8 feet away.

Electrical specifications Data Sheet SE - 10

It has 3 wires, DC (red), GND (brown) and Alarm (black).

Connecting it on a breadboard

close up of the breadboard

As you can see it needs a resistor going to power for the Alarm Pin. This keeps the value at around 1023 while no infrared has been detected.

Sample code in Arduino

This code makes the LED on digital pin 11 blink as soon as the sensor goes lower than 20. The regular value without movement is above 1021, upon detecting it, it goes low to 17 - 18.



' // example for the PIR motion sensor SE-10
' 
' int timer = 500;
' int alarmPin = 0;
' int alarmValue = 0;
' int ledPin = 11;

' void setup () {
' Serial.begin (9600);
' pinMode(ledPin, OUTPUT);  
' pinMode(alarmPin, INPUT);
' delay (2000); // it takes the sensor 2 seconds to scan the area around it before it can 
' detect infrared presence. 
' }

' void loop (){
' alarmValue = analogRead(alarmPin);

' if (alarmValue < 100){
'  blinky(); // blinks when the motion has been detected, just for confirmation.
' }
' delay(timer);

' Serial.println (alarmValue);

' delay (10);

' }

' void blinky() {
'  for(int i=0; i<3; i++) {
'    digitalWrite(11,HIGH);
'    delay(200);
'    digitalWrite(11,LOW);
'    delay(200);
'  }
' }