+1 500 000 products in offer

7000 packages per day

+300 000 clients from 150 countries

Quick Buy Favourites
Cart

Make your own Laser gate security system

Date of publication: 21-08-2026 🕒 5 min read

This project turns a simple laser and light sensor into a functional security gate.

The idea is straightforward: a laser beam is aimed at a light-dependent resistor (LDR). As long as the beam hits the sensor, everything is quiet.

The moment the beam is interrupted – for example, when someone walks through it – a buzzer will sound continuously until the beam is restored.

It’s a great beginner-friendly project that uses inexpensive modules and requires only minimal wiring.

What you can Build with a Laser Module and a LDR #arduino #electronics #engineering #diy

Hardware you need:

1. How it works

The laser module creates a narrow beam of light aimed directly at the LDR sensor. The LDR changes its resistance depending on how much light it receives.

During normal operation, with the laser beam points directly on the sensor, the resistance stays low. If something blocks the beam, LDR’s resistance increases sharply.

The Arduino constantly checks the sensor’s output. When it detects the light level dropping below a certain threshold, it activates the buzzer that will keep buzzing until the light returns. This makes it perfect for doorways, hallways, or other places where you want to detect motion or passage.

2. New Arduino Nano

Arduino Nano R4 is a small but powerful board that keeps the familiar Nano shape while adding new features. It uses a Renesas RA4M1 microcontroller running at 48 MHz with 256 kB of flash memory. It has a USB-C port for power and programming, more precise analog and digital inputs, and even a built-in real-time clock.

It’s perfect for this project because it runs on 5V, works with common sensors and modules, and is small enough to fit almost anywhere. You can get it with or without header pins, depending on how you want to connect it.

3. Laser and LDR modules

The OKY3301 laser module is a compact, 5V diode emitter that projects a stable red beam – easy to align and low-power, perfect for continuous operation.

The LDR module typically includes both analog and digital outputs, with a built-in potentiometer to adjust the digital threshold. When the laser beam illuminates the LDR, its digital output indicates “beam present.” Block the beam, and the output flips, signaling “beam broken.” This clear-cut switching behavior makes it ideal for triggering the alarm reliably.

4. Assembly

Start by placing the Nano R4 on a breadboard for easy prototyping. Mount the laser so it points directly at the LDR sensor surface – make sure both are fixed securely to prevent misalignment. Wire the laser’s VCC to the Nano’s 5V and its GND to the common ground.

Connect the LDR’s VCC and GND similarly, and feed its digital output into one of the Nano’s digital input pins, such as D2. Then attach the buzzer – its positive lead goes to another digital output pin (like D9), and its negative to the ground.

With power applied, align the beam so it strikes the LDR, and adjust the potentiometer until the Nano reads “beam present” reliably. Upload the code, and you’re set –block the beam, hear the buzzer; restore the beam, and the alarm stops.

You can download the code for this project here: LINK

5. Final thoughts

Once everything is aligned and wired, the laser gate will respond instantly – triggering a continuous beep whenever someone walks through the beam and stopping when it’s restored.

The setup requires minimal work, yet is effective. From here, you could expand it by adding visual indicators (LEDs), network alerts via Wi-Fi or Bluetooth, or even trigger a camera when the beam breaks.

You could even build a 3D-printed housing to make the system portable and more flexible.

Transfer Multisort Elektronik (TME) is one of the world’s largest global distributors of electronic components, electrotechnical parts, workshop equipment, and industrial automation. The catalog includes over 1,500,000 products from 1,300 leading manufacturers. TME’s modern logistics centers in Łódź and Rzgów (Poland), with a combined area of over 40,000 m², ship nearly 6,000 packages daily to customers in more than 150 countries.

TME also invests in the development of knowledge and skills of young engineers and electronics enthusiasts through the TME Education project, and supports the tech community by organizing the TechMasterEvent series, promoting innovation and experience exchange.

READ ALSO