ESP32 Motion Detection System Using PIR Sensor, LCD & LED
by mansiramteke139 in Circuits > Sensors
223 Views, 1 Favorites, 0 Comments
ESP32 Motion Detection System Using PIR Sensor, LCD & LED
In this Project, I build a Motion Detection System using ESP32 and PIR Motion Sensor. The PIR sensor detects movement by sensing changes in infrared radiation from the human body.
When motion is detected, the ESP32 displays a warning message on the 16*2 LCD display and turns on an LED indication.
When no motion is detected, the LCD shows that the area is safe.
This project is useful for learning about motion sensors, microcontrollers and security system basics.
Supplies
Components list:
- ESP32 DEV MODULE
- PIR Motion Sensor (HC-SR501)
- 16*2 LCD Display
- I2C Module
- Breadboard
- Jumper wires
About PIR Sensor
PIR Sensor:
PIR Sensor (Passive Infrared) sensor is used to detect motion of humans or animals by sensor changes in infrared radiation emitted by warm bodies. When a person moves in front of the sensor, the PIR module detects the change in infrared energy and send the signals to the microcontroller.
PIR sensor are widely used in security system, automatic lighting, motion detectors, and smart home automation because they are low power and easy to use.
Important
There are difference between PIR Sensor and Ultrasonic Sensor:
- PIR SENSOR detects infrared radiation from body heat whereas ULTRASONIC SENSOR works on sound waves.
- PIR SENSOR detects the human and animal whereas ULTRASONIC SENSOR detects distance of object.
- The output of PIR SENSOR is in HIGH or LOW depends on the Motion Detection and in ULTRASONIC SENSOR output can be seen in cm depends on the Distance Measurement.
Connections
PIR SENSOR - ESP32
GND - GND
OUT - GPIO 27
VCC - VIN (5V)
LCD (I2C) - ESP32
GND - GND
VCC - VIN (5V)
SDA - GPIO 13
SCL - GPIO 14
LED - ESP32
LED + - GPIO 2
LED - - GND
- Before Uploading the code, install the library LiquidCrystal_I2C Library from the Arduino Library Manager
CODE
Downloads
OUTPUT
WOKRING
- The PIR Sensor continuously monitor infrared radiation in its surrounding.
- When a human moves in front of the sensor.
- The PIR Sensor send a High Signals to the ESP32, Indicating motion detection.
- The lcd displays MOTION DETECTED and turn on the LED.
- If no movements is detected, the sensor sends LOW signals.
- Then LCD will show No MOTION, AREA SAFE and turn off LED.
CONCLUSION
Such systems are commonly used in security alarm, automatic lighting systems, and smart automations.