Proximity – PIR Motion Sensor

The SE-10 PIR motion sensor is a passive infrared sensor that detects motion by sensing differences in heat radiation. It is commonly used in security alarms and automated lights.

The PIR motion sensor needs a direct and uninterrupted line of sight. It’s unable to detect through cloth or cardboard. They only react to change so they can’t detect someone standing still in front of them.

The sensor has three wires.

  • Red – Voltage 5-12V
  • Brown – Ground
  • Black – Alarm (open collector)

The alarm pin is an open collector meaning you will need a pull up resistor on the alarm pin. The open drain setup allows multiple motion sensors to be connected on a single input pin. If any of the motion sensors go off, the input pin will be pulled low.

Using the PIR Sensor with an Arduino

Connect the sensor according to this table:

  • Red Wire – 5V
  • Brown Wire – GND
  • Black Wire – Arduino Digital Input 9 AND to 5V via a 10 K resistor

You can also connect the alarm pin to an analog input on the Arduino. When there is no movement the alarm pin will stay HIGH (or around 1023 on an analog pin) and when it detects movement it will go LOW (or about 16-18 if connected to an analog pin).

Arduino Code

 // example for the PIR motion sensor SE-10

 int timer = 500;
 int alarmPin = 9;
 int alarmValue = 0;
 int ledPin = 13;

 void setup () {
 Serial.begin (9600);
 Serial.println("Serial Ready");
 pinMode(ledPin, OUTPUT);  
 pinMode(alarmPin, INPUT);
 // the sensor needs two seconds to calibrate before it can detect infrared presence.
 delay (2000);
 Serial.println("Calibration Ready");

 void loop (){
 alarmValue = digitalRead(alarmPin);

 if (alarmValue == LOW){
 digitalWrite(ledPin, HIGH);
 Serial.println("Who's there?");
 digitalWrite(ledPin, LOW);
 Serial.println ("Nothing to see here.");

Links and Resources

Buy the sensor from Sparkfun
Tutorial for the SE-10