What is a Motion Sensor (PIR)
PIR (Passive Infrared) sensors are electronic devices that detect the movement of people or animals through infrared radiation emitted by the body.
These sensors are commonly used in security systems to detect intrusions, but can also be used in other types of automated systems, such as lighting and temperature control.
PIR sensors work by comparing the infrared radiation emitted by the body with the ambient temperature.
If they detect a significant difference, they send a signal to a controller that triggers a response, such as turning on a light or setting off an alarm.
PIR sensors are very sensitive and can detect movements from several meters away, making them very useful for security and home automation applications.
The PIR sensors are low cost and small.
All sensors are compatible to carry out projects on Arduino, NodeMCU, Raspberry Pi, ESP32 or ESP8266.
Specifications
Operating voltage: 5 – 20 V DC
Quiescent current 65 µA
Output voltage level: 3.3 V high / 0 V low
Adjustable delay (0.3 – 18 s)
Switching time (adjustable): 5 – 200 s
Range (adjustable): 3 – 7 m
Blockade time: 2.5 s
Detection angle: 140 °
Operating temperature: -15 – 70 °
Board dimensions: 32 x 24 mm
Screw hole spacing: 28 mm
Hole diameter: 2 mm
Sensor lens diameter: 23 mm
Trigger methods: L unrepeatable trigger, H repeatable trigger
Trigger can be easily switched using a jumper!
Datasheet: HC-SR501
PIR HC-SR501 configure
HC-SR501 The can work in 2 operating modes
JUMPER L / 1 single shot :
in this mode, when a motion detection occurs (which we will call ‘event’), the sensor output is activated for the time that has been adjusted through the corresponding potentiometer.
For example, suppose the activation time is 60 seconds. If a second event occurs during those 60 seconds, it will not be considered.
JUMPER H / Repetitive triggers :
in this mode, each detected event generates a new activation time.
Going back to the 60 second time example.
When the first event occurs, the output is activated.
If a second event occurs after 30 seconds, then 60 seconds will be added to the elapsed time, giving a total of 90 continuous seconds with the output active And thus, each additional event will add a time of 60 seconds of activation to the time already elapsed.
In any case, if the output returns to its inactive state, there will be a 3 second period during which new events will not be considered.
After those 3 seconds, the device returns to normal operation.
How to use HC-SRS01 motion sensor on Arduino?
This sensor is compatible with most Arduino development boards and to use it with these boards you have to connect OUTPUT to any digital pin of the Arduino that you use and finally connect the VCC pins to 5v and connect the GND.