A PIR (passive infrared) detector is a sensor that is commonly used to detect the presence of a person or animal within a certain range. These detectors work by detecting the infrared radiation that is emitted by objects in their field of view. When an object, such as a person or animal, moves within the detection range of the PIR sensor, the sensor will detect the change in infrared radiation and trigger an alarm or other action.
PIR detectors are often used in home security systems, as they are able to detect the presence of an intruder without making any physical contact with the person. They are also commonly used in wildlife monitoring systems, as they can detect the presence of animals without disturbing them.
PIR detectors can be used with an Arduino, a popular open-source microcontroller, to create a simple and effective security or monitoring system. The Arduino can be programmed to trigger an alarm or send a notification when the PIR detector senses movement.
To use a PIR detector with an Arduino, the PIR sensor must be connected to the Arduino using wires. The PIR sensor has three pins: VCC, GND, and OUT. The VCC pin should be connected to the 5V power supply on the Arduino, the GND pin should be connected to the GND on the Arduino, and the OUT pin should be connected to a digital input pin on the Arduino.
Once the PIR sensor is connected to the Arduino, it can be programmed to trigger an action when motion is detected. This can be done using the Arduino programming language and the Arduino Integrated Development Environment (IDE).
In the Arduino sketch (program), the digital input pin that is connected to the OUT pin on the PIR sensor should be configured as an input using the pinMode() function. Then, the digital input pin can be read using the digitalRead() function to determine whether the PIR sensor has detected motion. If motion is detected, the Arduino can trigger an action, such as turning on an LED or sounding an alarm.
In conclusion, PIR detectors are a useful and versatile tool for detecting the presence of people or animals. They can be easily used with an Arduino to create simple and effective security or monitoring systems.