Arduino B.Tech/Diploma Beginner

Laser Light Security System Using Arduino with Alarm

Laser Light Security System Using Arduino wih Alarm . When any object will obstruct the LASER ray the buzzer alarm will start ringing. Laser Module KY-008

  • Suitable forB.Tech/Diploma Arduino students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Introduction
This project builds a
Laser Light Security System using Arduino
with an audible alarm. It uses a KY-008 laser diode module as the light source and an LDR (Light Dependent Resistor) as the detector. As long as the laser beam reaches the LDR, the system stays quiet. If anything blocks the beam, the Arduino detects the change and turns on the buzzer. The alarm keeps sounding until it is reset with a push button.
The same beam-break idea is used in museums, shops, warehouses, and home security setups. Commercial systems often use infrared (IR) beams that are harder to see. This DIY version uses a visible red 650 nm laser so the alignment and working principle are easy to understand and demonstrate.
Laser Light Security System Using Arduino with Alarm
Components Required
Arduino UNO board
Laser diode module KY-008
Buzzer
LDR (Light Dependent Resistor)
10 kΩ resistor
Push button switch
Breadboard
Connecting wires
Circuit Diagram
Circuit Connections
KY-008 Laser module:
Signal pin → Arduino digital pin 3; VCC → 5V; GND → GND
LDR sensor:
Connected as a voltage divider with a 10 kΩ resistor to analog pin A0 (so the Arduino can read light level)
Buzzer:
Positive/signal → Arduino digital pin 11; other side → GND
Push button:
One side → Arduino digital pin 12; other side → GND (uses Arduino internal pull-up)
Place the laser and LDR facing each other so the red beam falls directly on the LDR surface. Keep the distance short and stable for reliable detection.
Laser Diode Module KY-008
The KY-008 is a small laser transmitter module for Arduino projects. It contains a 650 nm red laser diode and a series resistor on a tiny board. When powered and enabled, it emits a focused red dot/beam. Treat it as a Class 2-type laser pointer source: never look directly into the beam, and do not point it at eyes or reflective surfaces toward people.
KY-008 Specifications
Operating voltage:
5 V
Output power:
about 5 mW
Wavelength:
650 nm (red)
Operating current:
less than 40 mA
Working temperature:
−10 °C to 40 °C (14 °F to 104 °F)
Dimensions:
about 18.5 mm × 15 mm
Working Principle
This security system works on the
beam-interruption
principle.
The KY-008 laser sends a narrow red beam toward the LDR.
An LDR is a resistor whose resistance falls when light intensity rises. With the 10 kΩ resistor it forms a voltage divider, so Arduino pin A0 reads a voltage related to light level.
When the beam hits the LDR, the analog reading stays low (bright condition).
When a person or object blocks the beam, the LDR becomes darker, the analog reading rises above the set threshold, and the Arduino sets an alarm state.
In alarm state, the buzzer sounds continuously.
Pressing the push button clears the alarm state and stops the buzzer so the system can arm again.
A laser is used because it produces a narrow, nearly straight beam of one wavelength, which makes beam break detection sharp and reliable over a short distance compared with a normal LED.
Source Code / Program
Upload the following sketch to the Arduino UNO. Open Serial Monitor at 9600 baud to watch the LDR readings and adjust
laserThreshold
if needed for your lighting conditions.

int
laserPin
=

;
// KY-008 signal pin
int
sensorPin
=
A0
;
// LDR voltage divider output
int
buttonPin
=

;
// Reset push button
int
buzzerPin
=

;
// Alarm buzzer
int
laserThreshold
=

;
// Alarm if analog reading goes above this
void
setup
(
)
{
pinMode
(
laserPin
OUTPUT
)
;
pinMode
(
buzzerPin
OUTPUT
)
;
pinMode
(
buttonPin
INPUT_PULLUP
)
;
Serial
begin
(
9600
)
;
}
boolean
alarmState
=
false
;
void
loop
(
)
{
if
(
!
alarmState
)
{
delay
(
1000
)
;
digitalWrite
(
laserPin
HIGH
)
;
// Turn laser ON
delay
(

)
;
unsigned
long
startTime
=
millis
(
)
;
while
(
millis
(
)
startTime
<
1000
)
{
int
sensorValue
=
analogRead
(
sensorPin
)
;
Serial
println
(
sensorValue
)
;
// Beam blocked / LDR dark → reading rises → trigger alarm
if
(
sensorValue
>
laserThreshold
)
{
alarmState
=
true
;
break
;
}
delay
(

)
;
}
digitalWrite
(
laserPin
LOW
)
;
// Turn laser OFF between checks
}
else
{
tone
(
buzzerPin

)
;
// Sound alarm (440 Hz)
// Press button (active LOW) to reset alarm
if
(
!
digitalRead
(
buttonPin
)
)
{
alarmState
=
false
;
noTone
(
buzzerPin
)
;
}
delay
(

)
;
}
}
Code Explanation
laserPin
sensorPin
buttonPin
, and
buzzerPin
define the hardware connections.
While not in alarm, the laser is turned on and A0 is sampled for about 1 second.
If the LDR reading crosses
laserThreshold
alarmState
becomes true.
In alarm state,
tone()
drives the buzzer until the button is pressed.
Because the button uses
INPUT_PULLUP
, a press reads as LOW and clears the alarm.
Video Demonstration
LASER based Security System with Alarm using Arduino & KY008
Watch this video on YouTube
You can also build a similar laser security system using a
555 Timer & LDR
or using a
Raspberry Pi Pico & LDR

Technologies used

ArduinoRaspberry PiBLE

Hardware components

  • Arduino
  • Raspberry Pi
  • LDR

Software & tools

  • Arduino IDE

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.