Labels

Wednesday, April 29, 2020

PIR Motion Sensor

PIR Motion Sensor ( DYP-ME001)


PIR Sensor

Introduction to PIR motion Sensor

PIR sensor can detect motion. Almost always PIR sensor used to detect human motion in or out of the sensor range. They are inexpensive, low powered  and small sensor. Usually this call as PIR (Passive Infrared) ," Pyroelectric","IR motion" sensors. PIR sensor capture IR radiation. There are meany type of PIR sensor module (HC-SR501 , DYP-ME001), So here I going to explain about DYP-ME001 sensor module with Arduino (PIR sensor can also work without microchip).

DYP-ME001


Specification Of  DYP-ME001

Input Voltage - DC 4.5 - 20V
Static Current - 500uA
Block Time - 2.5s
Delay Time - 5s
Sentry Angle < 110
Sentry Range -3m to 7m

How PIR Sensor Works

PIR Sensor itself has two slot. These slots are sensitive to Infrared. When heat source (human or animal) passing sensitive area, PIR sensor intercepts one half of sensor.So, it cause positive differential change between two slot. As well as , after leave warm body from sense area , the reverse happen. In this time PIR sensor generate negative differential change. So these changes are detected by PIR sensor.


PIR Setting

Trigger Mode Jumper

In this DYP-ME001 sensor we can't change Jumper setting. So It connect with H position by default.
But if we consider  HC-SR501 PIR sensor, we can change jumper setting also.

L position

when moving warm body in front of sensor , sensor start to turn on and off every second or so
(ex LED on and off continuously ). So we call this as non-retriggering or single trigger mode.

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);
}}