Picture of Arduino Laser Trip Wire

For this dandy little project you'll need:

  • Arduino - I'm using an Arduino Uno
  • a 3 x 4 keypad
  • a 16 x 2 LCD screen
  • a laser module/sensor
  • a light dependent resistor (LDR)
  • a buzzer
  • 3 x 220 ohm resistors
  • 1 x 10K resistor
  • 1 x 10k potentiometer (optional, it's to adjust the LCD screen brightness)
  • an LED
  • and a ton of wires!

Step 1: LCD + Keypad

So, first thing I did was to get the LCD and keypad working together.

For this I pretended that it was some sort of arm/disarm (or entry/exit) thing.

My code for this part is at:

Getting the LCD wired up was tricky as most wiring diagrams for it don't show the last two pins wired up and these are required for the back light. Check my snazzy Fritzing wiring diagram to see how I wired up my LCD screen, pot (for adjusting brightness) and keypad. The pins for them all are also mentioned in my code.

NOTE: pin 1 isn't used as whenever I wired something to pin 1 I experienced weirdness. Not sure why. I expect it's something to do with the pins data uses?

If you don't have the keypad.h library you'll need to grab it from here:

Remove these adsRemove these ads by Signing Up
iharper3 months ago
Can you enter a code to disarm it when the beam hasn't been broken to allow access
ronnietucker (author)  iharper3 months ago

Yes, you can arm/disarm it at any time. In my code the beeper only sounds when the beam is broken.

Bugsley4 months ago

Is this programmed with Ubuntu IDE? Just getting started with Arduino and looking for an IDE.

ronnietucker (author)  Bugsley4 months ago

I just used the vanilla Arduino package that's in the repos for programming this.

sudo apt-get update && sudo apt-get install arduino arduino-core

That'll install the lot for you. Good luck!


papajon4 months ago

Very nice, Ronnie. I'll be trying it and staying tuned for more. Thanks. I voted.

ronnietucker (author)  papajon4 months ago
Many thanks for the vote.

If you've got any problems with it drop me a message/email and I'll try and help you.