The Passive Infrared (PIR) Sensor HC-SR501 [Product Link] is great for robotics and home automation application.


PIR Sensor HC-SR501
PIR Sensor HC-SR501
  • Operating Voltage: 3.6 ~ 30 V
  • Pins: Vcc, Out(Digital), GND
  • Current Rating: 50µA
  • 2 Potentiometers for sensitivity control
  • Lens cover for wider area coverage


This sensor is highly useful in applications where it required to detect changes in the environment and especially human motion detection. This module has a power consumption of about 50µA, and so is especially suitable for battery powered products.

Two potentiometers on the sensor control the distance sensitivity (approximately 3 to 7m) and delay time (approximately 5 to 300s) when a motion is detected.

The special lens cover helps in covering a wider area of detection. By removing the cover, the sensor underneath will only be able to detect motion that happens directly in front of it.

Direct light and other types of interference sources should be avoided close to the modules’ lens, so as not to introduce false action of interference.

// Code by Jasmeet Singh for http://Wiki.JMoon.co
/* This code prints out the HIGH/LOW level value detected from the Out pin
of the PIR in the Serial Monitor.
A value of 1 indicates that a motion was detected.*/
int Din=4; //Out pin connected to digital pin 4 of Arduino.

void setup()

void loop()
Serial.print("D0 Digital Value:");

Possible Application Areas

1. Motion Detection Security [Link]
2. Motion Detecting Robot [Link]

Did you create a project using this product? Leave details/links below!


So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *