Building a laser tripwire alarm with Arduino is an enjoyable electronics project that allows you to create a configurable security system on a budget. The alarm uses an infrared transmitter and receiver to create a laser beam which when broken, triggers an audible alarm.

This project is relatively simple to construct using common electronic components, while providing the satisfaction of creating a functional gadget with real-world applications. With some tweaks, this alarm system can be scaled up to cover larger areas and interface with other devices.

In this comprehensive guide, I will cover:

So if you're looking for an electronics project that's affordable, educational, and practical, building a laser tripwire alarm with Arduino is a great choice!

Benefits of a Laser Tripwire Alarm

Here are some of the main benefits that make a laser tripwire alarm a worthwhile DIY security project:

For the cost of a few basic electronic components, you can construct a capable tripwire alarm for your room, house or any location that needs a simple security system. The versatility and educational aspects make this an ideal beginner Arduino project.

Required Components and Tools

Constructing the laser tripwire alarm requires just a few main components, many of which you may already have on hand:



The cost of these components purchased individually would be around $45 maximum, but you likely have many of these parts on hand already. The key items are the Arduino board, infrared set, and outputs for the alarm itself.

Circuit Diagram and Connections

The electronic circuit for the laser tripwire alarm is quite simple, with just the IR set, Arduino, outputs and power wired together. Here is a diagram showing how to connect the components:

How to Build a Low-Cost Laser Tripwire Alarm with Arduino

The infrared transmitter and receiver diodes should be positioned across the area to monitor, aligned roughly parallel to each other. The transmitter sends a modulated beam of IR light which is detected by the receiver.

When the beam is broken, the receiver output drops low, triggering the alarm sequence in the Arduino code. The alarm can activate LEDs, buzzers, or other output components to indicate the tripwire has been crossed.

The resistors limit current through the IR diodes and Arduino pins. The component values are not critical, experiment to find what works best. Ready-made IR sets may include the resistors required.

Arduino Laser Tripwire Code

The Arduino sketch monitors the receiver diode pin state to detect when the beam is interrupted. Here is basic example code to activate a buzzer alarm when the tripwire is triggered:

const int receiver = 2; //IR sensor pin
const int buzzer = 9; //Buzzer pin

void setup() {
pinMode(receiver, INPUT);
pinMode(buzzer, OUTPUT);

void loop(){
if(digitalRead(receiver) == LOW){ //Beam broken

tone(buzzer, 1000); //Activate buzzer

tone(buzzer, 500);

noTone(buzzer); //Deactivate buzzer

delay(100); //Repeat loop

This simple sketch can be expanded further to create more complex alarms, integrate other sensors, or connect automated responses. The receiver pin state check just needs to trigger your desired alarm sequence.

Constructing and Testing the Tripwire

With the circuit assembled and code uploaded, positioning and testing the tripwire is straightforward:

For best reliability, the IR transmitter and receiver should have a clear straight line path between them. Start testing at short distances under 1 foot and slowly increase separation once the alarm is functioning properly.

The alarm will be more sensitive to obstructions with higher power IR emitters, focused optics, and closer sensor spacing. Experiment with components and positions to cover the required detection area.

Enhancements and Expansions

While the basic single tripwire alarm is functional, there are many possible enhancements to improve reliability, flexibility, and functionality:

The core principles and code remain the same while expanding the features and functionality of the system. By integrating new technologies and outputs, this simple Arduino project can grow into a complete monitored security network.


Constructing a laser tripwire alarm with Arduino provides an affordable introduction to practical electronics and microcontroller programming. The sensing capabilities integrate seamlessly with other systems, allowing you to detect intrusions and activate responses automatically.

With the information in this guide, you should have a full understanding of the circuit, components, code and construction steps necessary to build your own security tripwire. The basic alarm can be assembled in an afternoon with common parts, then expanded over time by adding new features and capabilities.

So grab your Arduino and infrared sensors, and start experimenting! This hands-on learning experience will improve your electronics skills while producing a functional gadget to keep your spaces protected.