Function of the Module
- Please refer to Pyroelectric Infrared Sensor
- As a digital input sensor, it can only detect "0" and "1", that is "Yes" and "No".
- It'll last about 4s after detecting human body.
Overview
To use pyroelectric infrared sensor to detect if there is person moved and check data in the serial monitor.
Bill of Material
Hardware Buildup
- Setup 1:Connect the PIR sensor with the pin 6 port of the Hub. Accessible Hub pins: 0,2,4,6,8,10 and 12.
- Setup 2:Connect the CoreUSB, Hub and the Sound sensor to the computer with a USB cable.
[file:mCookie-pir-pc.JPG|600px|center]]
Mixly Programming
- Step1:Since using serial monitor, we need to find "Serial Communication" from "Communication" item.
- Step2:"Serial Communication" description.
- Step3:PIR sensor is an input device and the returned data is digital quantity, based on which we can find and drag out the digital input and output from "Input/Output".
- "Analog Input" description.
- Overall code description.
Debugging
- Step1:Select the right board card(Core USB 32U4) and COM port(Recognized automatically by default).
- Step2:Open the serial monitor.
- Step3:Check if the serial baud rate is the same with the pre-set one.
- Step4:Check the data: When there is human around it, the data is "1" and the status will keep about 4s.
|