Difference between revisions of "HC-SR501 Human Body Pyroelectricity Infrared Sensor Module"
(Created page with "='''Introduction'''= File:HC-SR501-1.jpgFile:HC-SR501-2.jpg<br> Pyroelectricity Infrared Sensor is a kind of sensor that can convert the infrared ray signal emitted by...") |
|||
(5 intermediate revisions by the same user not shown) | |||
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 | ||
Line 16: | Line 16: | ||
=='''Working Principle'''== | =='''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. | 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 | + | 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.<br> |
[[File:HC-SR501-3.jpg]]<br> | [[File:HC-SR501-3.jpg]]<br> | ||
− | Two trigger modes: (choosing different | + | Two trigger modes: (choosing different modes by using the jumper cap).<br> |
− | *H. Repeatable | + | *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.<br> |
− | *L. | + | *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. <br> |
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.<br> | 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.<br> | ||
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. <br> | 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. <br> | ||
Line 31: | Line 31: | ||
[[File:HC-SR501-5.jpg]]<br> | [[File:HC-SR501-5.jpg]]<br> | ||
− | '''Step 2: Copy the following codes and paste them in Arduino.''<br> | + | '''Step 2: Copy the following codes and paste them in Arduino.'''<br> |
<pre style="color:blue"> | <pre style="color:blue"> | ||
///Arduino Sample Code | ///Arduino Sample Code | ||
Line 54: | Line 54: | ||
</pre> | </pre> | ||
− | To observe the experimental phenomenon, we can open Arduino | + | 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.<br> |
[[File:HC-SR501-6.jpg]] | [[File:HC-SR501-6.jpg]] |
Latest revision as of 06:03, 5 September 2019
Contents
Introduction
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() { 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 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.