Laser Trip Wire
Tired of unwanted visitors sneaking through your bedroom? Want to booby trap the refrigerator so you know when your roommate is mooching your food? Just want to scare your pet as they run around the house? A laser tripwire is a cool and high tech way to both guard your space, and also get a little fun building it in the process. For this project you will need:
- Arduino and USB cable
- Prototyping board / Breadboard / Non-Solder Project board / PCB board (if you don't mind spending the components)
- One red LED and one green LED
- Some jumper wires
- One piezo buzzer (such as this one)
- One photoresistor (I used this one)
- One 1k Ohms resistor (colour code: Brown, Black, Red)
- 9V Battery Pack with 2.5mm centre-positive barrel jack (or another external power source for the arduino unless you plan to run it while it's attached via USB to your computer)
- Optional laser pointer (though the project will allow you to build and run this without a laser just fine.)
Building it
In essence, this is a very simple project to assemble. It consists of a very simple voltage divider in where the first resistor is replaced by the photoresistor. As the light affecting the photoresistor changes, so does its resistence. Therefore the voltage out of the divider changes as well and this change is understood as light detection. Also in the project are three simple circuits for the two LEDs (running: digital pin, LED, ground) and the buzzer (digital pin, buzzer, ground). When a drop in light is detected by the software on the Arduino, it sets of the buzzer. Below is a schematic diagram of the project and a reference picture of my own build.
Diagram:
My Build:


Usage
Upon powering up the device, it gives a three second grace period by default before it goes into security mode. If you plan on using a laser pointer to create a tripwire, set this up prior to turning the device on, but if you just want to use the ambient light of the room it is in simply turn it on. When the device boots, it immediately takes a reading of the current brightness on the photoresistor and sets that as the baseline level-- if the brightness drops an equivalent of 50 Ohms across the photoresistor, the alarm goes off! If this happens, the device sets off the buzzer for three seconds before rearming itself again. One thing I noted in my first prototype is that my red LED was significantly brighter than my green LED. Therefore, after taking the baseline brightness reading and arming, the red LED lit up and saturated the photoresistor with bright light rendering a higher tolerance for light change. However this wasn't a problem when using a laser tripwire.
