Difference between revisions of "Pyroelectric Infrared Sensor"
(Created page with "{| style="width: 800px;" |- | ==Outline== Infrared pyroelectric sensor can detect the movement of the human or animal body issued by the infrared and output switch signal, whi...") |
|||
Line 46: | Line 46: | ||
===Preparation=== | ===Preparation=== | ||
− | *Setup | + | *Setup 1: Connect the PIR and the Hub D6. |
[[file:mCookie-PIR-sensor.JPG|600px|center]] | [[file:mCookie-PIR-sensor.JPG|600px|center]] | ||
− | *Setup | + | *Setup 2: Stack the CoreUSB, Hub and PIR together and connect them to the computer with a USB cable. |
[[file:mCookie-Sound-pc.JPG|600px|center]] | [[file:mCookie-Sound-pc.JPG|600px|center]] | ||
Line 81: | Line 81: | ||
When the infrared pyroelectric sensor detects the movement of the living body in the detection range, the output pin will output high level voltage, which is 5V. when the infrared pyroelectric signal is detected to be gone for 2.3-3s, it will output low level voltage, which is 0V. So we can quickly build a moving human detection project based on this characteristic. | When the infrared pyroelectric sensor detects the movement of the living body in the detection range, the output pin will output high level voltage, which is 5V. when the infrared pyroelectric signal is detected to be gone for 2.3-3s, it will output low level voltage, which is 0V. So we can quickly build a moving human detection project based on this characteristic. | ||
===Program Debugging=== | ===Program Debugging=== | ||
− | * | + | *"#define sensorPin 6": Define sensor interface |
− | * | + | *Use"digitalRead(sensorPin);"to read sensor change and therefore, to judge if there is human movement. |
==Application== | ==Application== |
Latest revision as of 06:41, 30 September 2016
ContentsOutlineInfrared pyroelectric sensor can detect the movement of the human or animal body issued by the infrared and output switch signal, which can be applied to projects that need to detect the movement of human body.
Infrared Probe OverviewThe sensor uses the digital integration with the human pyroelectric infrared detector AM412 integrated.
Specification
DevelopmentEquipment
Preparation
Experiment: Detect Human Movement
#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 infrared pyroelectric sensor detects the movement of the living body in the detection range, the output pin will output high level voltage, which is 5V. when the infrared pyroelectric signal is detected to be gone for 2.3-3s, it will output low level voltage, which is 0V. So we can quickly build a moving human detection project based on this characteristic. Program Debugging
Application
Video |