Motion Detector with PIR Sensor

Not rated 11,963

Circuit Image

This project utilizes the PIC18F25K20 microcontroller to detect changes in a sensor's state and emit sound from a speaker or piezo buzzer. The microcontroller also monitors the battery voltage during startup. The algorithm is straightforward, employing an interrupt-on-change mechanism to detect variations in the PIR sensor's output. Upon power-on, the circuit introduces a delay to the microcontroller to prevent malfunction. Resistor R6 and capacitor C1 form an RC delay filter, which can be calculated to determine the delay.

This electronic circuit is designed around the PIC18F25K20 microcontroller, which serves as the central processing unit. The microcontroller is programmed to monitor a passive infrared (PIR) sensor, which detects motion by measuring changes in infrared radiation. When the PIR sensor detects movement, it triggers an interrupt, allowing the microcontroller to respond swiftly.

The initial battery voltage check at startup is crucial for ensuring that the system operates within its specified voltage range. This feature helps prevent unexpected behavior due to low battery conditions. The microcontroller's firmware includes a routine to read the analog voltage level from the battery, ensuring that it is sufficient for operation.

The use of an RC delay filter composed of resistor R6 and capacitor C1 is essential for stabilizing the signal from the PIR sensor. This filter smooths out transient spikes or noise that may occur when the sensor detects motion. The time constant of the RC circuit, calculated using the formula τ = R × C, determines the duration of the delay. This delay is critical for allowing the microcontroller to settle into a known state before processing sensor inputs, thereby reducing the likelihood of erroneous readings that could lead to circuit malfunction.

The output from the microcontroller is directed to a speaker or piezo buzzer, which provides an audible alert when motion is detected. The design ensures that the sound output is both timely and reliable, enhancing the effectiveness of the motion detection system. Overall, this project integrates key electronic components and principles to create a robust motion detection and alert system.this project use PIC18F25K20 microcontroller to detect if the sensor change state and it will emit a sound from the speaker or piezo, the MCU also detect the voltage of the battery in the startup, the algorithm it s very simple use an interrupt on change to detect the change on the PIR sensor. Power On - when circuit start, a delay come to MCU ge nerate a unknowed state, to avoid circuit malfunction, R6 and C1 make a RC delay filter, calculate delay with: 🔗 External reference