A few weeks ago I saw a post in the home assistant subreddit, about a device that hides things you might not want someone to see when they break a laser tripwire, based on the VL53L0X time of flight laser rangefinder. This was a self contained unit that plugs into a usb port and send a keyboard shortcut.
At the time it seemed cool, and I decided to order a couple of breakouts and see if anything could be done to attach one to an esp, maybe via esphome. Anyway, I turned to the arduino environment in the end and mashed three libraries together with the example code and got one up and running. Then I remembered i’d ordered two, so I set about making a dual laser system, so that if they are placed so someone passing breaks one, then the other, you get an indication of direction as well as the trigger.
This is now working so although there is room for improvement, it works quite well. It’s much better than a PIR and seems to work well. So here’s the code:
https://github.com/pareidolialjebus/VL53L0X-MQTT-Tripwire
Wiring is easy, standard i2c bus with a couple of extra wires - the boards usually expose a “shutdown” pin, which turns the chip off to allow programming when there are multiple chips on the same bus. So I wired one each from D3 and D4 on the D1 Mini I was using, then set the pins in the code. Anyway, I drew a crude version in paint:
Anyway, thought someone might like it. I find it’s useful for switching lighting as you move from room to room, but only just scratching the surface. Could be used to detect mail coming through the letterbox, or to keep an eye on a closed door without having to damage it to mount something on it (say for renters).
I plan to keep at it for now and will be adding hardware to the prototype to allow calibration. At some point I’ll work on a better circuit diagram too
Here’s a pic of the prototype: