“人体红外热释传感器”的版本间的差异
853387039@qq.com(讨论 | 贡献) (→设备) |
(→实验:检测有无运动的人) |
||
(未显示2个用户的8个中间版本) | |||
第22行: | 第22行: | ||
**感应角度:100° | **感应角度:100° | ||
**感应距离:7米 | **感应距离:7米 | ||
− | |||
− | |||
*尺寸 | *尺寸 | ||
**板子大小:20mm*10mm | **板子大小:20mm*10mm | ||
第40行: | 第38行: | ||
|[[mCookie-Hub/zh]]||1||传感器转接板 | |[[mCookie-Hub/zh]]||1||传感器转接板 | ||
|- | |- | ||
− | |[[Microduino- | + | |[[Microduino-Passive Infrared/zh]]||1||红外热释电运动传感器 |
|} | |} | ||
*其他硬件设备 | *其他硬件设备 | ||
**USB数据连接线 一根 | **USB数据连接线 一根 | ||
− | [[File: | + | [[File:Passive Infrared.jpg|600px|center]] |
===准备=== | ===准备=== | ||
− | *Setup | + | *Setup 1:将人体红外传感器和Hub的D6接起来。 |
− | [[file:mCookie- | + | [[file:mCookie-Passive Infrared-sensor.JPG|600px|center]] |
− | *Setup | + | *Setup 2:将CoreUSB,Hub,Pir连接在一起。通过USB数据线将接入电脑。 |
− | [[file:mCookie- | + | [[file:mCookie-pir-pc.JPG|600px|center]] |
− | === | + | ===实验:检测有无运动的人=== |
*打开Arduino IDE,将下列代码复制到IDE中。 | *打开Arduino IDE,将下列代码复制到IDE中。 | ||
<source lang="cpp"> | <source lang="cpp"> | ||
+ | #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); | ||
+ | } | ||
</source> | </source> | ||
− | * | + | *在Arduino IDE的工具(Tools)→端口(Serial Port)里面选择正确的端口号。 |
− | [[file:upload.JPG| | + | [[file:upload.JPG|600px|center]] |
− | * | + | *编译完成后直接下载程序。 |
− | [[file:mCookie-pir-res.JPG| | + | [[file:upload-pir.JPG|600px|center]] |
+ | *下载完毕你可以打开串口监视器,显示的提示即反应了当前传感器检测的状态。 | ||
+ | [[file:mCookie-pir-res.JPG|600px|center]] | ||
*结果 | *结果 | ||
− | + | 当红外热释电运动传感器在检测范围内检测到运动的生命体时,在输出引脚会输出高电平,电压为5V,当检测到红外热释电信号消失时,延迟2.3~3秒后,输出低电平,电压为0V。因此我们可以根据这个特点来快速的建立一个运动人体检测的应用。 | |
+ | |||
===程序调试=== | ===程序调试=== | ||
− | * | + | *“#define sensorPin 6”定义传感器接口 |
− | * | + | *使用“digitalRead(sensorPin);”函数来读取传感器的变化,从而判断是否有运动的人体。 |
+ | |||
==应用== | ==应用== | ||
*入侵报警器 | *入侵报警器 |
2015年11月5日 (四) 06:20的最新版本
概述红外热释电运动传感器能检测运动的人或动物身上发出的红外线,输出开关信号,可以应用于各种需要检测运动人体的场合。
探头概述传感器采用数字一体化集成人体热释电红外探头AM412。
规格
开发设备
准备
实验:检测有无运动的人
#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);
}
当红外热释电运动传感器在检测范围内检测到运动的生命体时,在输出引脚会输出高电平,电压为5V,当检测到红外热释电信号消失时,延迟2.3~3秒后,输出低电平,电压为0V。因此我们可以根据这个特点来快速的建立一个运动人体检测的应用。 程序调试
应用
视频 |