Introduction
PIR motion sensor module is used to measure the distance, it contains two potentiometers which makes the circuit more easily adjust the sensitivity. When detect someone has enter the detectable area, it outputs high level, when people is out of the range area, it delays for several seconds in high level automatically and then turn to low level. This sensor has two kinds of trig way:
A. Unrepeatable trig way: when detect IR and output high level, it will stay in this status for several seconds, then turn to low level.
B. Repeatable trig way: After output high level, during the delay time, if detect IR, the output will stay for high level, after the IR disappeared, the module will continue stay in high level for several seconds, then turn to low level (delay time begins from the latest IR disappeared).
This module also has the locking function, the locking time is default to be 200ms, after finish a whole output (high level turns to low level), it can set a locking time, during this time, the sensor won’t accept any signal.
For the sensor is rectangle, the long side I define it as AB and the short side I define it as CD, sensor will be more sensitive when detect people parallel to the AB line than people who move in the way vertical to the AB.
Technical data
Input Voltage: DC 4.5-20V
Static current: 50uA
Voltage output: high level is 3.3V and low level is 0V
Blockage time: 0.2S
Measuring angle: 110 degree
Measuring distance: max 7 m
Digital output
Features
Repeatable Trigger
Wide range of operating voltage
Low-power, static current is 50μA, especially suit for the electrical product which need powered by the dry battery
Better anti-interference
Delay time can be adjusted from 0.3 to 18S
Usage
[code]
/*
* Connect the output pin to Arduino's digital port of pin 2.
* Arduino has a indicated led which connect to the pin 13.
*/
const int PIRPin=6; //define digital pin 6 as PIRPin
const int ledPin=13;
int PIR_value;
void setup() {
pinMode(PIRPin, INPUT); //set PIRPin as input pin
pinMode(ledPin, OUTPUT); //set ledPin as output pin
}
void loop() {
PIR_value=digitalRead(PIRPin); //Read the output of module.
if(PIR_value==HIGH) //Judge the output of module
{
digitalWrite(ledPin, HIGH); //If the module output high, the led on.
}
else
{
digitalWrite(ledPin, LOW); //If the module output low, the led off.
}
}
[/code]
Resource