Home > News & Updates > Electronics News Updates > Arduino – Laser Tripwire Alarm System

Arduino – Laser Tripwire Alarm System

Summary of Arduino – Laser Tripwire Alarm System


This article details a DIY laser tripwire alarm system using an Arduino-compatible development board. The project involves assembling a junction box with a photoresistor sensor and a red dot laser diode to detect interruptions in the light beam. When the laser is blocked, a buzzer triggers an alarm. The setup includes wiring components to specific pins and uploading custom code that monitors analog readings to activate the alert when light levels drop below a threshold.

Parts used in the Laser Tripwire Alarm System:

  • SainSmart Leonardo R3 Development Board
  • Junction Box Enclosure
  • Red Dot Laser Diode Trip Wire
  • Buzzer Alarm
  • Photoresistor Sensor
  • 9v Battery Power Supply
  • Male to Female Breadboard Jumper Cable
  • 10k Resistor

Hello everyone,

In this instructable, we will be building a laser guided tripwire alarm system using a development board.

Step 1: Parts

Components used in this project:

Development board – SainSmart Leonardo R3

Enclosure – Junction Box

Trip wire – Red Dot Laser Diode

Alarm – Buzzer

Sensor – Photoresistor

Power supply – 9v battery

Wire – Male to Female Breadboard Jumper cable

Resistor – 10k

I used an improvised laser diode that was placed on a breadboard that was powered by a 9V battery. Alternatively, a laser pointer will also work well for this project.

Step 2: Assemble

Using a soldering iron, I made two horizontal holes on the junction box to house the photoresistor.

After threading the photoresistor through the junction box, I glued a piece of plastic around it.

This makes it easier to calibrate the sensor in various lighting conditions.

The positive pin from the loudspeaker connects to pin 13 on the development board.

The negative pin from the loudspeaker connects to pin 11 on the development board.

Step 3: Wiring

The photoresistor connects to the 5v pin on the development board.

The remaining pin connects to the analog 0 pin.

A connection between the analog 0 pin and the ground (GND) pin is also established using a 10k resistor.

Before placing the 9V battery inside the enclosure, I used double sided tape to separate it from the development board.

Step 4: Code

int PR = 0; //Analog 0 to Photoresistor
int Loud = 13; //Pin 13 to Loudspeaker

void setup() {

pinMode(PR, INPUT); //Photoresistor is set as an input

pinMode(13, OUTPUT);

pinMode(11, OUTPUT);

Serial.begin(9600);//set serial monitor at 9600 baud

}

void loop() {

int Read = analogRead(PR);// “Read” reads analog0 data

Serial.println(Read);// Print that data

if (Read < 120) //if the value is less than 120 (this can be modified based on your lighting condition),

Read more: Arduino – Laser Tripwire Alarm System

Quick Solutions to Questions related to Laser Tripwire Alarm System:

  • What components are required for this project?
    The project requires a SainSmart Leonardo R3 board, junction box, red dot laser diode, buzzer, photoresistor, 9v battery, jumper cables, and a 10k resistor.
  • How do you prepare the enclosure for the sensor?
    You must solder two horizontal holes into the junction box to house the photoresistor and glue plastic around it for easier calibration.
  • Which pins connect to the loudspeaker?
    The positive pin connects to pin 13 and the negative pin connects to pin 11 on the development board.
  • How is the photoresistor wired to the board?
    One pin connects to the 5v pin, the other to analog 0, and a connection between analog 0 and ground uses a 10k resistor.
  • Can I use a different power source for the laser?
    Yes, an improvised laser diode powered by a 9V battery works, or a standard laser pointer will also function well.
  • What happens if the analog reading is less than 120?
    If the value reads less than 120, the system detects the tripwire has been triggered based on lighting conditions.
  • Is there a way to adjust the sensitivity of the sensor?
    Yes, the threshold value of 120 can be modified in the code to suit various lighting conditions.
  • How should the battery be secured inside the enclosure?
    Use double sided tape to separate the 9V battery from the development board before placing them inside.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top