📚 Course contents
Projects Hub, build 30 of 81
PIR Motion Alert with LCD Display (Arduino)
Introduction
In today's rapidly evolving world, security has become a primary concern for many homeowners and businesses. Every motion-activated security camera has two parts: one that notices that somebody moved, and one that takes the picture. In this project we will build the first part using Arduino: a motion detector that shows a message on an LCD.
An Arduino Uno does not have the memory or the speed for a camera. When you want to take pictures too, you need a board with a camera, such as the ESP32-CAM.
Working Principle
Every warm body gives out infrared light that we cannot see. The PIR (Passive Infrared) sensor notices when that infrared changes in front of it and sends a HIGH signal to the Arduino. The Arduino then displays "Motion Detected!" on the LCD screen for 2 seconds.
Things We Need
- Arduino Uno: To read the sensor and control the display.
- PIR (Passive Infrared) Motion Sensor: To detect motion.
- 16x2 LCD Display with I2C Module: To provide real-time feedback.
- Breadboard and jumper wires: For assembling the circuit.
Working of the System with Arduino
- Setting up the PIR Sensor: Connect the sensor's VCC and GND pins to 5V and GND on the Arduino. The sensor's OUT pin is connected to digital pin 2.
- Connecting the LCD: Connect VCC to 5V, GND to GND, SDA to A4 and SCL to A5.
- Coding the Arduino: The program reads the PIR sensor and, when there is motion, displays the message on the LCD.
Arduino Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // Set the LCD address and dimensions
const int pirPin = 2; // PIR sensor input pin
bool motionDetected = false;
void setup() {
lcd.init(); // Initialize the LCD
lcd.backlight();
pinMode(pirPin, INPUT);
Serial.begin(9600);
}
void loop() {
motionDetected = digitalRead(pirPin);
if (motionDetected) {
// Show the message on the LCD
lcd.setCursor(0, 0);
lcd.print("Motion Detected!");
delay(2000); // Display the message for 2 seconds
lcd.clear();
}
}Conclusion
You have built the motion detecting half of a security system. You can now add a buzzer, a light or a relay that switches on with the message. Remember to adhere to local laws and regulations when using surveillance equipment.

