Arduino Laser Security Alarm System Using LDR and Buzzer

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.ComponentQuantity
1Any Arduino Uno ➤ https://amzn.to/430CfOo1
2LDR Module ➤ https://amzn.to/431y6cT1
3Laser Module ➤ https://amzn.to/4obr9Qj1
4Active Buzzer Module ➤ https://amzn.to/4dYioUT1
5Jumper Wires ➤ https://amzn.to/430CfOo9 (M-F)
7USB Cable1

Circuit Connections

ComponentArduino Pin
LDR S PinA0
LDR VCC5V
LDR GNDGND
Buzzer SignalD8
Buzzer VCC3.3V
Buzzer GNDGND
Laser S PinD7
Laser VCC5V
Laser GNDGND

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

Your email address will not be published. Required fields are marked *

More Articles & Posts