HC-SR501 Human Body Pyroelectricity Infrared Sensor Module

From Wiki
Jump to: navigation, search


Pyroelectricity Infrared Sensor is a kind of sensor that can convert the infrared ray signal emitted by human or animal into electrical signal. And HC-SR501 is an automatic control module based on infrared technology which has high sensitivity and security and works under the extra low voltage mode. It is a common sight that the module is applied in a range of automatic sensing electronic equipments, especially in automatic control products powered by dry battery.

Main Features

  • Working Voltage : DC 3.6V to 30V;
  • Fully automatic induction: With detected creatures being within the detection range, high level is output; if not, a delay is executed automatically and high level output will turn to be low level output.
  • Micro power consumption: Static Current < 50uA, especially suitable for automatic control products powered by dry battery.
  • Output high level signal: Applies to various kinds of circuits.

Introduction of Pins

  • GND: Ground
  • OUT: Signal Output
  • VCC: 5V

Working Principle

After the sensing module is wired, there is a one-minute initialization. During the initialization, module will output for 0~3 times at intervals. Then the module will be in the standby mode. Please keep the interference of light source and other sources away from the surface of the module so as to avoid the misoperation caused by the interfering signal. Even you'd better use the module without too much wind, because the wind can also interfere with the sensor.
Two trigger modes: (choosing different modes by using the jumper cap).

  • H. Repeatable trigger mode: After sensing the human body, the module outputs high level. During the subsequent delay period, if somebody enters the sensing range,the output will keep being the high level.
  • L. Non-repeatable trigger mode: Outputs high level when it senses the human body. After the delay, the output will change from high level into low level automatically.

Turning the knob of the distance adjustment potentiometer clockwise, the range of sensing distance increases, and the maximum sensing distance range is about 0-7 meters. If turn it anticlockwise, the range of sensing distance is reduced, and the minimum sensing distance range is about 0-3 meters.
Rotate the knob of the delay adjustment potentiometer clockwise, you can also see the sensing delay increasing. The maximum of the sensing delay can reach up to 300s. On the contrary, if rotate it anticlockwise, you can shorten the delay with a minimum of 5s.

For Arduino

Using Steps
Step 1: Connect the circuit.


Step 2: Copy the following codes and paste them in Arduino.

///Arduino Sample Code
int ledPin = 13;  // LED on Pin 13 of Arduino
int pirPin = 7; // Input for HC-S501
int pirValue; // Place to store read PIR Value

void setup() 
  pinMode(ledPin, OUTPUT);
  pinMode(pirPin, INPUT);
  digitalWrite(ledPin, LOW);

void loop() 
  pirValue = digitalRead(pirPin);
  digitalWrite(ledPin, pirValue);

To observe the experimental phenomenon, we can open Arduino serial port monitor. Sensing the human body, the module outputs high level 1. Meanwhile, the LED on Pin 13 of Arduino will lights up. Choose L: Non-repeatable trigger mode, when the delay is done, the output changes from high level 1 to low level 0.