Site icon Circuit Ideas for You

Laser Light Alarm Circuit using Arduino

This article is for simple Laser Light Alarm Circuit using Arduino.

A laser light shines on an LDR and when someone blocks the laser beam, the LDR changes its value and then Arduino reads this change and turns ON the buzzer to make alarm sound.

A reset button stops the alarm.

Also, the system uses low-cost components, remains easy to build, and works well for homes, school labs and small projects.

Arduino Code:

/* Laser Security System with Laser Control */

int ldrPin = A0;
int buzzerPin = 8;
int resetPin = 7;
int laserPin = 9; // new laser control pin

int threshold = 500;
int alarmState = 0;

void setup() {
pinMode(buzzerPin, OUTPUT);
pinMode(resetPin, INPUT_PULLUP);
pinMode(laserPin, OUTPUT); // set laser pin as output

digitalWrite(laserPin, HIGH); // turn laser ON
}

void loop() {
int sensorValue = analogRead(ldrPin);

if(sensorValue > threshold) {
alarmState = 1;
}

if(digitalRead(resetPin) == LOW) {
alarmState = 0;
}

if(alarmState == 1) {
digitalWrite(buzzerPin, HIGH);
} else {
digitalWrite(buzzerPin, LOW);
}

delay(50);
}

Coding Explanation:

Circuit Working:

Laser Light Alarm Circuit Diagram using Arduino

Parts List:

ComponentsQuantity
Resistors
10k 1/4 watt1
LDR1
Semiconductors
Arduino UNO1
Laser Diode KY008 Module1
5V Buzzer1
Push Button Alarm Reset Switch1

Laser module gives one straight beam to the LDR.

When light hits LDR, its resistance becomes low and when beam breaks then LDR resistance becomes very high; then LDR and 10k resistor make simple voltage divider.

After that, the Arduino reads this voltage on the analog pin; moreover, if the voltage rises above the set value, the Arduino determines that something is blocking the laser beam.

Then Arduino turns ON buzzer pin and alarm starts and further, reset button goes to one digital pin of Arduino.

Finally, when the user presses the button, the Arduino stops the buzzer and clears the alarm state.

Formula:

Below is the Voltage divider formula:

Vout = Vin * (R2 / (R1 + R2))

where,

How to Build:

To build a Laser Light Alarm Circuit using Arduino follow the below steps for connection:

Conclusion:

To conclude, this project for Laser Light Alarm Circuit using Arduino is simple for beginners and it uses few cheap parts.

Also, the laser and LDR create an effective tripwire, and the Arduino easily controls the alarm.

Furthermore, this circuit helps users learn about sensors, inputs, and outputs, and they can improve it by adding more sensors or a wireless alert.

Exit mobile version