Grove - PIR Motion Sensor

From Wiki
(Redirected from Twig - PIR Motion Sensor)
Jump to: navigation, search

Contents

Introduction

This is a simple to use PIR motion sensor with Grove compatible interface. The sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range. Simply connect it to Grove - Base shield and program it, when anyone moves in it's detecting range, the sensor outputs HIGH on its SIG pin. The detecting range and respons speed can be adjusted by 2 potentiometers soldered on its circuit board, The response speed is from 0.3s - 25s, and max 6 meters of detecting range.
Model:SEN32357P
PIR Motion.jpg

Features

  • Grove compatible interface
  • Wide supply voltage range: 3V–5V
  • 2.0cm x 4.0cm Grove module
  • Detecting Angle: 120 degree
  • Detecting Distance: max 6m
  • Adjustable detecting distance and holding time

Application Ideas

  • Motion sensor
  • Thief-guarding System
  • Switch
  • Industrial automation


Specification

Items Conditions Min Norm Max Unit
VCC - 3 - 5 Volts
Measuring Current Supply VCC=3V - - 100 uA
VCC=5V - - 150 uA
Measuring Range - 0.1 - 6 m
Holding Time - 1 - 25 S
Operating Temperature - -20 - 70 °C
Storge Temperature - -35 - 80 °C
Working Wave Length - 7 - 14 um
Detecting Angle - - 120 - degree

Usage

The following sketch demonstrates a simple application of sensing montion. When someone moves in its detecting range, it outputs High through its SIG pin and the LED lights, else it outputs LOW. Then you can use it to detect the motion of people.


Note: The first time you use this module, you should regulate the two potentiometer which are used to adjust the detecting distance and the holding time. And you also need to regulate the switch beside to the Grove connector to set the module in a retriggerable situation(H position) or an un-retriggerable situation(L position)

  • Connect the PIR Motion Sensor to Seeeduino through the Grove-Base Shield using the  Digital 2  interface and The LED  connect to Digital 4 of Grove - Base Shield.
  • Connect the Seeeduino to PC via a USB cable.

PIR Motion Sensor.jpg

  • Copy and paste code below to a new Arduino sketch.
 
/*******************************************************************************/
/*macro definitions of PIR motion sensor pin and LED pin*/
#define PIR_MOTION_SENSOR 2//Use pin 2 to receive the signal from the module 
#define LED	4//the Grove - LED is connected to D4 of Arduino

void setup()
{
	pinsInit();
}

void loop() 
{
	if(isPeopleDetected())//if it detects the moving people?
		turnOnLED();
	else
		turnOffLED();
}
void pinsInit()
{
	pinMode(PIR_MOTION_SENSOR, INPUT);
	pinMode(LED,OUTPUT);
}
void turnOnLED()
{
	digitalWrite(LED,HIGH);
}
void turnOffLED()
{
	digitalWrite(LED,LOW);
}
/***************************************************************/
/*Function: Detect whether anyone moves in it's detecting range*/
/*Return:-boolean, ture is someone detected.*/
boolean isPeopleDetected()
{
	int sensorValue = digitalRead(PIR_MOTION_SENSOR);
	if(sensorValue == HIGH)//if the sensor value is HIGH?
	{
		return true;//yes,return ture
	}
	else
	{
		return false;//no,return false
	}
}
  • Upload the code, Please click here if you do not know how to upload.<br>
  • Test the sensor if  it can sense your motion.

Note: The detecting distance can be adjusted by rotate the distance potentiometer. When you rotate the distance potentiometer clockwise, the detecting distance decreases from 6 meters to only several centimeters. And when you rotate it counter-clockwise to the end, the module will be too sensitive to be triggered by the atmosphere even there is no people moving before it. The holding time can also be adjusted by the Delay_time potentiometer, the value is about from  25s to 1s when you rotate it clockwise. The module can also be set as retriggerable or un- retriggerable. When the switch is in the H position, the module is retriggerable and is unretrigerred when the switch is in L position.
 

Version Tracker

Revision Descriptions Release
v0.9b Initial public release date

Resources

Support

If you have questions or other better design ideas, you can go to our forum or wish to discuss.

Personal tools
Namespaces

Variants
Actions
Structure
Seeed Products
Support
Toolbox