Grove - PIR Motion Sensor User Manual Release date: 2015/9/22 Version: 1.0 Wiki: http://www.seeedstudio.com/wiki/Grove_-_PIR_Motion_Sensor Bazaar: http://www.seeedstudio.com/depot/Grove-PIR-Motion- Sensor-p-802.
Document Revision History Revision Date Author Description 1.
Contents Document Revision History ·········································································2 1. Introduction ·······················································································2 2. Specification ······················································································3 3. Usage ······························································································4 3.1 3.2 3.3 4.
Disclaimer For physical injuries and possessions loss caused by those reasons which are not related to product quality, such as operating without following manual guide, natural disasters or force majeure, we take no responsibility for that. Under the supervision of Seeed Technology Inc., this manual has been compiled and published which covered the latest product description and specification. The content of this manual is subject to change without notice.
1. Introduction This is a simple to use PIR motion sensor with Grove compatible interface. This sensor allows you to sense motion, usually human movement in its range. Simply connect it to Grove - Base shield and program it, when anyone moves in its detecting range, the sensor will output HIGH on its SIG pin.
2. Specification Operating Voltage: 5V Operating Current(VCC = 3V): 100uA Operating Current(VCC = 5V): 150uA Measuring Range: 3m by default (support 0.
3. Usage 3.1 With Arduino The following sketch demonstrates a simple application of sensing motion. When someone moves in its detecting range, it will output High through its SIG pin and the LED will light. Otherwise, it will output LOW. Then you can use it to detect the motion of people.
void turnOnLED() { digitalWrite(LED,HIGH); } void turnOffLED() { digitalWrite(LED,LOW); } /***************************************************************/ /*Function: Detect whether anyone moves in it's detecting range*/ /*Return:-boolean, true is someone detected.
/* Grove-PIR-Motion-Sensor The following sketch demonstrates a simple application of sensing motion. When someone moves in its detecting range, it will output High through its SIG pin and the LED will light. Otherwise, it will output LOW. Then you can use it to detect the motion of people.
void setup() { pinMode(PIR_MOTION_SENSOR, INPUT); /* declare the sig pin as an INPUT */ pinMode(RED_LED, OUTPUT); /* declare the red_led pin as an OUTPUT */ _handle_led(OFF); } /* the loop() method runs over and over again */ void loop() { if(isPeopleDetected()) { _handle_led(ON); /* if we detect a people, turn on the led */ } else { _handle_led(OFF); /* found nobody, turn off the light */ } } /* judge if there is a people around */ boolean isPeopleDetected() { int sensor_val = digitalRead(PIR_MOTIO
# Connect the Grove PIR Motion Sensor to digital port D8 # SIG,NC,VCC,GND pir_sensor = 8 grovepi.pinMode(pir_sensor,"INPUT") while True: try: # Sense motion, usually human, within the target range if grovepi.digitalRead(pir_sensor): print 'Motion Detected' else: print '-' # if your hold time is less than this, you might not see as many detections time.sleep(.2) except IOError: print "Error" 5. Run the demo. sudo python grove_pir_motion_sensor.
4. Resources Grove - PIR Motion Sensor Eagle File v1.2 Grove - PIR Motion Sensor v1.