PIR Motion Sensor - Information pulled off the web
sku: SEN-08630
Description: This is a simple to use motion sensor. Power it up and wait 1-2 seconds for the sensor to get a snapshot of the still room. If anything moves after that period, the ‘alarm’ pin will go low.
Red wire is power (5 to 12V). Brown wire is GND. Black wire is open collector Alarm.
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.
The alarm pin is an open collector meaning you will need a pull up resistor on the alarm pin. The open drain setup allows multiple motion sensors to be connected on a single input pin. If any of the motion sensors go off, the input pin will be pulled low.
The connector is slightly odd but has a 0.1” pitch female connector making it compatible with jumper wires and 0.1” male headers.
———————
@cloverstreet: I’ve seen it detect motion reliably up to ~20ft away. There is no need to reset the alarm, it doesn’t latch. The alarm pin is debounced (deflapped?) internally, and seems to cycle off on the order of a second or so.
Also, a slight warning about the datasheet (at least for my unit): If you’re not paying attention, and use the three silver pin latches to orient the connector it’ll be backwards. As the description says, red is power, brown is ground, and black is alarm.
———
This says you can use it down to 5V but it does not appear to be stable to me at this voltage. The output is bouncing all over the place. When I change the input to 12V it works perfectly.
Good web site at :
http://itp.nyu.edu/physcomp/sensors/Reports/PIRMotionSensor
——————————————————————
Dual sensor PIR is the most widely used motion detection system. They’re false-triggered less often than ultrasonic.
Changing the cover on it can change the range they cover.
They only react to change so they can’t detect someone standing still in front of them.
When using more than one, they can be connected on the same input to Arduino, however the values need to be normalized. I found it better to connect them to different analog inputs.
The PIR motion sensor needs a direct and uninterrupted line of sight. It’s unable to detect through cloth or cardboard.It detects movement in front of it from about 8 feet away.
As you can see it needs a resistor going to power for the Alarm Pin. This keeps the value at around 1023 while no infrared has been detected.
Sample code in Arduino
This code makes the LED on digital pin 11 blink as soon as the sensor goes lower than 20. The regular value without movement is above 1021, upon detecting it, it goes low to 17 - 18.
‘ // example for the PIR motion sensor SE-10
‘
‘ int timer = 500;
‘ int alarmPin = 0;
‘ int alarmValue = 0;
‘ int ledPin = 11;
‘ void setup () {
‘ Serial.begin (9600);
‘ pinMode(ledPin, OUTPUT);
‘ pinMode(alarmPin, INPUT);
‘ delay (2000); // it takes the sensor 2 seconds to scan the area around it before it can
‘ detect infrared presence.
‘ }
‘ void loop (){
‘ alarmValue = analogRead(alarmPin);
‘ if (alarmValue < 100){
‘ blinky(); // blinks when the motion has been detected, just for confirmation.
‘ }
‘ delay(timer);
‘ Serial.println (alarmValue);
‘ delay (10);
‘ }
‘ void blinky() {
‘ for(int i=0; i<3; i++) {
‘ digitalWrite(11,HIGH);
‘ delay(200);
‘ digitalWrite(11,LOW);
‘ delay(200);
‘ }
‘ }
——————————————————————