 |
PIR Sensor |
An Introduction to PIR Motion Sensor
PIR sensors are primarily used to detect motion, and they are especially popular for sensing human movement. These small, low-power, and inexpensive sensors are staples in security and automation projects.
While most commonly referred to as PIR (Passive Infrared) sensors, they are also known as Pyroelectric or IR Motion sensors. At their core, a PIR sensor works by capturing infrared radiation.
There are many types of PIR sensor modules available, such as the HC-SR501 and the DYP-ME001. In this guide, we'll focus on the DYP-ME001 sensor module and how to use it with an Arduino. (Note that these sensors can also be used without a microcontroller.)
 |
DYP-ME001
|
Specification Of DYP-ME001
Input Voltage - DC 4.5 - 20V
Static Current - 500
uA
Block Time - 2.5s
Delay Time - 5s
Sentry Angle < 110
Sentry Range -3m to 7m
The Science Behind Detecting Heat and Motion
When a heat source (like a human or animal) passes through the sensor's field of view, it first intercepts one of the two sensitive slots. This creates a positive differential change between the two slots.
When the warm body leaves the sensing area, the reverse happens, and the PIR sensor generates a negative differential change. The sensor's circuitry detects these changes, which is how it recognizes motion.
 |
PIR Setting |
Trigger Mode Jumper
The DYP-ME001 sensor module does not have a configurable jumper setting, so it is connected to the 'H' (High) position by default. In contrast, other PIR sensors like the HC-SR501 allow you to change the jumper settings.
L position
When a warm body moves in front of the sensor, it will trigger an output signal.
The behavior of this signal depends on the mode the sensor is configured for:
Non-Retriggering (Single Trigger) Mode: In this mode, the sensor triggers once when motion is first detected. It will then remain 'ON' for a pre-set duration and will not re-trigger, even if motion is still present. This means that after the initial trigger, the output will turn 'OFF' after its set time has expired and will not turn on again until a new motion event is detected.
Retriggering Mode (Commonly set as 'H' on HC-SR501): This is the more common mode. As long as motion is continuously detected, the sensor's output will stay 'ON'. The timer will reset every time motion is detected, ensuring the signal remains active. The output only turns 'OFF' after motion has ceased for the duration of the pre-set time.
H position
Sensor will turn on entire time that something is moving. So we call this as
retriggering or repeatable trigger mode.
Sensitivity and Time Adjustment
Sensitivity
According to PIR motion sensor (DYP-ME001) specification adjustable range is from 3m to 7m. Here is way adjust.
Clockwise or Right side -- decrease sensitivity, so it fully right and range will be approximately 3m.
Counter Clockwise or Left side --increase sensitivity , so it fully right and range will be approximately 7m.
Time Adjustment
This adjustment determined how long of PIR sensor will remain high after motion detected.
Clockwise or Right side -- Increase delay,So it fully right and delay will be approximately 5 second.
Counter Clockwise or Left side -- decrease delay , So it fully left and delay will be approximately 3 second
Code Sample
int motion_in =2;
int led_out=3;
void setup() {
pinMode(motion_in ,INPUT);
pinMode(led_out,OUTPUT); }
void loop() {
// put your main code here, to run repeatedly:
int pir_read = digitalRead(motion_in);
if(pir_read==1)
{
digitalWrite(led_out ,HIGH);
delay(1000);
}
else
{
digitalWrite(led_out,LOW);
delay(300);
}}