Building a laser trip wire

You may have seen Wallace and Gromit's short film, The Wrong Trousers, where the penguin uses a contraption to control Wallace in his sleep, making him break into a museum to steal the big shiny diamond. The diamond is surrounded by laser beams, but when one of the beams is broken, the alarms go off and the diamond is protected with a cage!

In this project, I'm going to show you how to set up a laser beam and have our Raspberry Pi alert us when the beam is broken— aka a laser trip wire. For this, we're going to need to use a Waveshare Laser Sensor module (www.waveshare.com), which is readily available to buy on Amazon for around £10 / $15.

The module comes complete with jumper wires, that allow us to easily connect it ...

Get Raspberry Pi for Secret Agents - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.