Introduction
Looking for a simple and effective Arduino security project? In this tutorial, we will build a Laser Security Alarm System using Arduino, an LDR (Light Dependent Resistor), and a Buzzer. This beginner-friendly project detects when an object interrupts a laser beam and immediately triggers an alarm.
Laser-based security systems are commonly used in museums, restricted areas, and smart home security solutions. This project demonstrates the basic principle behind such systems using affordable electronic components.
Whether you are a student, hobbyist, or Arduino beginner, this project is a great way to learn about sensors, analog inputs, and alarm systems.
Components Required
| Sr. No. | Component | Quantity |
|---|---|---|
| 1 | Any Arduino Uno ➤ https://amzn.to/430CfOo | 1 |
| 2 | LDR Module ➤ https://amzn.to/431y6cT | 1 |
| 3 | Laser Module ➤ https://amzn.to/4obr9Qj | 1 |
| 4 | Active Buzzer Module ➤ https://amzn.to/4dYioUT | 1 |
| 5 | Jumper Wires ➤ https://amzn.to/430CfOo | 9 (M-F) |
| 7 | USB Cable | 1 |
Circuit Connections
| Component | Arduino Pin |
|---|---|
| LDR S Pin | A0 |
| LDR VCC | 5V |
| LDR GND | GND |
| Buzzer Signal | D8 |
| Buzzer VCC | 3.3V |
| Buzzer GND | GND |
| Laser S Pin | D7 |
| Laser VCC | 5V |
| Laser GND | GND |
Arduino Code
// Laser Security System
int laserPin = 7;
int ldrPin = A0;
int buzzerPin = 8;
int threshold = 1;
void setup() {
pinMode(laserPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
// Turn laser ON
digitalWrite(laserPin, HIGH);
Serial.begin(9600);
}
void loop() {
int ldrValue = analogRead(ldrPin);
Serial.println(ldrValue);
// If laser beam interrupted
if (ldrValue > threshold) {
digitalWrite(buzzerPin, HIGH);
Serial.println("INTRUDER DETECTED!");
}
else {
digitalWrite(buzzerPin, LOW);
}
delay(100);
}


Leave a Reply