Difference between revisions of "Sensor-PIR"
From Microduino Wiki
m (Fengfeng moved page Microduino-PIR to Sensor-PIR) |
(→Preparation) |
||
Line 55: | Line 55: | ||
===Preparation=== | ===Preparation=== | ||
− | *Setup | + | *Setup 1: Connect the PIR to the D6 of the Hub. |
[[file:mCookie-Passive Infrared-sensor.JPG|600px|center]] | [[file:mCookie-Passive Infrared-sensor.JPG|600px|center]] | ||
− | *Setup | + | *Setup 2: Assemble the CoreUSB, Hub and the PIR together, then connect them to the computer. |
[[file:mCookie-pir-pc.JPG|600px|center]] | [[file:mCookie-pir-pc.JPG|600px|center]] | ||
Revision as of 10:27, 26 August 2016
Language: | English • 中文 |
---|
Microduino-PIR is a pyroelectric infrared sensor that can detect infrared rays sent from moving human body or animals. It can output switch signals and be used in various occasions that need to detect moving human body. ContentsFeatures
Specification
Document
DevelopmentEquipment
Preparation
Experiment: Detect If there is person moving
#define sensorPin 6
int state;
void setup()
{
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}
void loop()
{
state = digitalRead(sensorPin);
if (state == 1)
Serial.println("Somebody is in this area!");
else
Serial.println("No one!");
delay(500);
}
When the PIR is detecting the moving persons, it'll output high level in the output pin, which is 5V. And when it detected the PIR signal gone, it'll output low level(0V) after 2.3-3s delay. Therefore, we can according to that to establish a moving person detection project according to that. Program Debugging
Application
ProjectPurchaseHistoryImage
|