Difference between revisions of "HC-SR501 Human Body Pyroelectricity Infrared Sensor Module"

From Wiki
Jump to: navigation, search
Line 9: Line 9:
 
*Output high level signal: Applies to various kinds of circuits.
 
*Output high level signal: Applies to various kinds of circuits.
  
=='''Introduction of Pins'''===
+
=='''Introduction of Pins'''==
 
*GND: Ground
 
*GND: Ground
 
*OUT: Signal Output  
 
*OUT: Signal Output  

Revision as of 05:56, 5 September 2019

Introduction

HC-SR501-1.jpgHC-SR501-2.jpg
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 lights or some sources of interference of light source and other sources like these away from the lenssurface of the module so as to avoid the misoperation caused by the interfering signal. Even you'd better use the module in the circumstance without too much wind, because the wind can also interfere with the sensor.
HC-SR501-3.jpg
Two trigger modes: (choosing different modeethods by using the jumper cap).

  • H. Repeatable triggering methodode: 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. UnNon-repeatable triggering methode: 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.
HC-SR501-4.jpg

HC-SR501-5.jpg

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() 
{
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
  pinMode(pirPin, INPUT);
  digitalWrite(ledPin, LOW);
}

void loop() 
{
  pirValue = digitalRead(pirPin);
  digitalWrite(ledPin, pirValue);
  Serial.println(pirValue);
}

To observe the experimental phenomenon, we can open Arduino Sserial port mMonitor. 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 modeUnrepeatable triggering method, when the delay is done, the output changes from high level 1 to low level 0.
HC-SR501-6.jpg