Lasergate is a PoE-powered light-barrier device built on the ESP32-S3, meant to watch doorways or other openings and report when something passes through. Instead of a camera, it uses pairs of modulated lasers and LDRs. No image data, no object detection model, no privacy questions to answer.
This is a hobby project I'm building in my spare time, not a finished product. Firmware, mechanics and electronics are all still in flux.
Work in progress. What exists right now:
- Firmware scaffolding on ESP-IDF/FreeRTOS, targeting the ESP32-S3
- Application architecture in place: state machine, settings storage, HTTP API/web UI, HAL layers for GPIO, ADC, Ethernet, MQTT
- The actual module logic: laser pulsing, pattern verification on the LDR side, and a gate class that ties several modules together
- Modules calibrate themselves against ambient light rather than needing manual tuning.
- Both self-calibration routines (LDR threshold, pulse frequency) persist their results to NVS, so a module doesn't have to recalibrate after every reboot
- Decent unit test coverage by now, not just the low-level hardware wrappers, the module/gate/calibration logic gets exercised too, all running on a dev machine with no hardware attached
- Mechanical prototypes for the sensor modules
- A first electronics prototype: ESP32-S3 with a PoE HAT, breadboarded laser/LDR module
Each sensor is a laser/LDR pair, called a module. A gate is made up of however many modules you need to cover an opening. The main limit is the number of available GPIO (and ADC-capable) pins on the development board. Currently capped to four modules.
The laser is pulsed with a pseudo-random pattern instead of just being on or off, and the receiving LDR checks the incoming signal against the expected pattern rather than reading a plain brightness threshold. That should make the thing harder to fool with a flashlight or a well-timed hand wave than a basic light barrier would be. A long, narrow black tube in front of each LDR blocks stray light from the sides so the sensor mostly only sees its own laser. The alarm trigger condition (how many modules need to be blocked at once, and for how long) is meant to be configurable.
Planned: an HTTP API/webhook and CAN bus for linking multiple units together.
Currently working: a small HTTP-served web UI for basic and advanced settings, backed by a status/settings API. MQTT support is implemented but not yet used by the application.
| Fifth-iteration laser/LDR module prototype | Glare-shield tube prototype, ESP32 nodemcu (not yet S3) | First PoE board, ESP32-S3 with W5500 |
|---|---|---|
![]() |
![]() |
![]() |


