Introduction: DIY | Easy Arduino Laser Tripwire Security System!

In this tutorial I will be teaching you how you can build your own Laser Tripwire Security System at home!

You will need the following components and materials:

  • LED light
  • Laser Module
  • Laser Sensor Module
  • Speaker or Piezo Buzzer
  • 2 Small Breadboards with sticky tape on the back
  • Arduino
  • Breadboard wires
  • USB Cable (to program the Arduino)

This project is very simple to build since we won't have to modify any parts.

You can watch the video tutorial and finished product right here -

Step 1: Aligning the Laser Modules

First off, we plug our laser module and sensor into the mini breadboards.
Make sure you align them properly, otherwise your alarm will start beeping as soon as you upload the code.

Step 2: Connecting the Speaker and LED to the Arduino

Picture of Connecting the Speaker and LED to the Arduino

We will plug our speaker into GND and Pin 7 of the Arduino.
The LED will go into GND and Pin 13 of the Arduino.

I provided a image with all pins tagged to make things easier for you.

Step 3: Connecting the Laser and Sensor to the Arduino

Picture of Connecting the Laser and Sensor to the Arduino

Starting off with the sensor, the pins should be connected like this:

Sensor - Arduino
OUT → Pin 2
VCC → 5V

And now the laser module:

Laser - Arduino
Middle → 5V
- → GND

I suggest using longer cables to connect the laser module, since you'd probably attach it to the other side of the room / door.

Once again I provided images to make things easier.

Step 4: Program Your Arduino

Connect the Arduino to your PC and program your Arduino using the code provided in this step.

You can change the alarm by editing the void "alarmTone" and the void "alarm".

If you don't want a delay or you need a longer delay in order to disable the alarm you can change the value "3000" in "delay(3000);" in the void "alarm".


gregfuji (author)2017-07-20

I'm looking for some code that could read four lasers 'laser 1 thru 4' if momentary 1 2 3 4 then do nothing- if momentary 4 3 2 1 then alarm. Any ideas?


AmritS19 (author)2017-07-16

Can someone please share the model number / make of the 3 wire laser sensor used in the module. Thanks!

DhasirarM (author)2017-04-15

thanks.its working

warriorsmen (author)2017-03-04

Nice work. I would like to know if this would work with an external laser pointer. e.g battery powered laser pointer??

arshad118ar (author)2017-02-11

sir please help me the alarm is going on the lazer is on the ldr module

LoganB22 (author)2016-09-08

I have my Keyes laser attached to a breadboard with jumpers coming from the YwRobot 545043 module at 5V using the USB connect. Brighter than 3.3 V. I guess I can just use the Arduino for the sensor part?

Neonon (author)2016-08-30

Hi I have to connect the laser on Arduino ? Or I can also laser to an external power source connection and only the laser sensor on the Arduino Connecting ?

Vwsurfer (author)2016-08-27

This is great, Iv made one similar from another post. Could you use two arduinos so the tripwire is outside and the alarm/speaker is inside? Bluetooth or wifi possibly?

RGBFreak (author)Vwsurfer2016-08-28

Yes! If you can think of it you can build it with Arduino, since the possibilities are endless!

I'd love to hear back from you if you manage to get it to work.

Matejic (author)2016-06-05

Great project!!!

Can you tell me what is a maximum distance from laser modul to the sensor modul?


RGBFreak (author)Matejic2016-06-05

Thanks! Around 20-30 meters max

Matejic (author)RGBFreak2016-06-05

Thanks for answer :)

dtassone (author)2016-06-05

Pretty neat project...any idea if fog could be detected using this?

RGBFreak (author)dtassone2016-06-05

Thanks! Not really sure, sorry

loptica62 (author)2016-06-05

in the code, the function " alarmTone(); " is being repeated from line 42 - 91....
So, is there any special reason why a "for loop" hasn't been implemented.... thanks in advance

RGBFreak (author)loptica622016-06-05

No. I'm just noob with Arduino lol

Lavoz24 (author)2016-05-31

if you go to they sell the whole kit for around $10 I think and it comes complete with a laser and mirrors.

MolecularD (author)Lavoz242016-06-01

You are missing the main point. Instructables is not about money, it's about fun of making things yourself!

Lavoz24 (author)MolecularD2016-06-02

The main point of instructables is to have fun making thing's on the cheap. Meaning, for as little or no money possible. Also, there are people out here who are new or have little knowledge as to where to source parts let alone put them together. Some can't read schematics and others would like to make these ibles as quickly and easily as possible just to say they've made it. Which is why I suggested the KipkayKits site. I'm not upset or anything as I understand what you mean but there's more than one point to instrucables.

I recall wanting to do have of these ibles but not knowing where to start even though all parts and instructions were on the page. I recall asking questions and getting even more confused because the answers were written in a language all its own sometimes and that is the Instructable language, the electronic and computer language. Heck, I was once told to get a basics in electronics course then come back and try to do the ible when I have a better understanding. None of it is fair and we as EE,PC Engineers and Engineers in general should be more than willing to help the new person on instructable. This is why I suggested KipkayKits. They help you and explain to you in detail what you need to know. They will stay online with you and keep at it until you learn or at least understand the concept of what you're trying to do. It's not about making money. I sure as heck am not making anything by telling people to check out the site or even buy something from it except satisfaction in knowing if they do they will get kits on the cheap or at least low costing, they will learn because Kipkay offers videos as well as step by step instructions and you could go online,type in your question and have Jonathan,Gadgetron,Josh or one of the many other moderators that are on hand to help you as well as others who have completed their kit and are more than willing to help. This is the reason why I would always tell people about KipkayKits. It helped me ALOT, it's helped others and I'm certain they will always be there to help when needed. Their kits are easy to read and understand, they have 3 different kit options from novice to expert and as I said before, they will always help you when you get stumped. If you get a kit and a part is missing or doesn't work, they send you another no questions asked. This is why I suggested KipkayKits. Not because of the money aspect of it but because I read a few comments asking where could they find the parts for this ible and no one responded so I did. And because I responded I have someone tell me I'm missing the point,LoL,smh. It's ok, I get your point and I hope you understand mine. Thank you for the comment.

Have a great day.

Claudio1960 (author)2016-05-31

Hello, only one point, if i send a second beam on the receiver and i break the first beam, what happen ? the output change or not ? if no, is possible to send a coded beam and change the status if a received beam have an'other code ?

Thanks from Claudio

RGBFreak (author)Claudio19602016-05-31

No this isn't possible without modifying the code. I think you could have the lasers flash onto the receiver and have the receiver read the amount of flashes in a certain period of time. Once the amount of flashes is lower than it should be the alarm goes off. The period could be 100ms for example, so it won't take a while to trigger the alarm.

Claudio1960 (author)RGBFreak2016-05-31

Wich kind of modify you mean? Software, hardware?

RGBFreak (author)Claudio19602016-05-31

The code, by that I mean the software

khubbell1 (author)2016-05-31

Say I wanted to make 10-20 of these and do a sort of spy-themed room where people have to get to the other side without triggerimg the alarm. I would have to pump fog or something into the room for them to see it, but would that interfere with the laser? Do you think it would be enough to cause a false trip?

RGBFreak (author)khubbell12016-05-31

I think it depends on the amount of smoke. But one tip: Use mirrors. That's waaay cheaper and does the same ;)

Thanks for your interest!

Rodling (author)2016-05-25

How about a part number and supplier for the laser detector and Laser module. Thanks good job

RGBFreak (author)Rodling2016-05-25

All the parts are from Aliexpress

For the USA readers, I've found Dalbani Electronics in Miami, FL a good source.

They have everything from Arduino to Video and everything in between. Good pricing when buying lots fo more than one...

Quester-59 (author)Rodling2016-05-31

Believe it or not, I obtained a 10 Pack of Laser modules for under $10.00 bucks [American} from AMAZON. and I bet you can find all of your other electronic needs there as well.

John T MacF Mood (author)2016-05-31


What kind of range can you reliably detect motion
over? Can an IR laser be substituted so as to be invisible to the
potential intruder?

I'm thinking of building three or four to
give myself zoned detection... Paint the boxes using woodland camo
except of course keeping the openings clear for the beam. I keep getting
night intruders (sometimes animals), and for a time a guy was (I swear, really!) was night golfing in my yard, he left over a dozen Slazenger #4's in my yard, all new. It's bugged me for a long time... I've detected some minotr tampering with my cars too.

Lol! The laser can easily travel over 80 meters. I don't think you can use a IR laser though since the receiver is basically just a LDR. Maybe you could use a IR receiver instead? Not sure! Would love to know if it works, but unfortunately I don't have a IR laser module. If you decide to try it let me know! Thanks for your interest! :)

Will do, nice work too... I think I'll start experimenting with IR laserrs and see what I can acquire.

Let me know if you can get it to work! I'm interested to see if it works. Good luck!

666sebas999 (author)2016-05-30

Do I get crystals and fiber optics when I disarm it?

WailinSoul (author)2016-05-21

Try reflecting the laser back using a small mirror so you can build all component's in one housing.

RGBFreak (author)WailinSoul2016-05-21

Made that a few minutes ago! Will post an V2.0 soon! :)

WailinSoul (author)RGBFreak2016-05-22

looking forward to seeing your work, great instructable btw.

RGBFreak (author)WailinSoul2016-05-22

Thank you!

rmercado4 (author)2016-05-21

Can't see attached coding

RGBFreak (author)rmercado42016-05-21

Why not? What does it tell you?

About This Instructable




Bio: Hi there visitor! First of all thank you for checking out my profile! My name is Youri. I study Technical Computer Science in the Netherlands ... More »
More by RGBFreak:DIY Fidget Spinner Accelerator for UNDER $2!Cheap Flying Ghost Halloween Prank!DIY | RGB LED Shades Controlled By Arduino
Add instructable to: