Introduction: Arduino - Laser Tripwire Alarm System

Hello everyone,

In this instructable, we will be building a laser guided tripwire alarm system using a development board.

Youtube Version:

Step 1: Parts

Components used in this project:

Development board - SainSmart Leonardo R3

Enclosure - Junction Box

Trip wire - Red Dot Laser Diode

Alarm - Buzzer

Sensor - Photoresistor

Power supply - 9v battery

Wire - Male to Female Breadboard Jumper cable

Resistor - 10k

I used an improvised laser diode that was placed on a breadboard that was powered by a 9V battery. Alternatively, a laser pointer will also work well for this project.

Step 2: Assemble

Using a soldering iron, I made two horizontal holes on the junction box to house the photoresistor.

After threading the photoresistor through the junction box, I glued a piece of plastic around it.

This makes it easier to calibrate the sensor in various lighting conditions.

The positive pin from the loudspeaker connects to pin 13 on the development board.

The negative pin from the loudspeaker connects to pin 11 on the development board.

Step 3: Wiring

The photoresistor connects to the 5v pin on the development board.

The remaining pin connects to the analog 0 pin.

A connection between the analog 0 pin and the ground (GND) pin is also established using a 10k resistor.

Before placing the 9V battery inside the enclosure, I used double sided tape to separate it from the development board.

Step 4: Code

int PR = 0; //Analog 0 to Photoresistor
int Loud = 13; //Pin 13 to Loudspeaker

void setup() {

pinMode(PR, INPUT); //Photoresistor is set as an input

pinMode(13, OUTPUT);

pinMode(11, OUTPUT);

Serial.begin(9600);//set serial monitor at 9600 baud

}

void loop() {

int Read = analogRead(PR);// "Read" reads analog0 data

Serial.println(Read);// Print that data

if (Read < 120) //if the value is less than 120 (this can be modified based on your lighting condition),

{

digitalWrite(Loud, HIGH); //speaker turns on

digitalWrite(11, LOW);

}

else //if the value is greater than 120

{

digitalWrite(Loud, LOW);// speaker will turn it off

digitalWrite(11, LOW);

}

delay(1000);//run every second }

Code in Google Drive

Step 5: Done

Once the sensor is calibrated to your prefered setting, you can upload the code and close the junction box.

This version is is calibrated to work in low light conditions.

Although I used 9V batteries for this project, you can also use 5V wall adapters as a permanent solution.

If you want to see this project in action, please click on the link.

Comments

author
UNSEPARABLE+TECHSCIENTIFICS made it!(author)2017-07-17

Congratulations colleague!!!

author
iphillips1 made it!(author)2016-06-23

Would it be possible to make one with a Raspberry Pi, so you could include some more advanced scripts (txt or email notifications), rather than just the buzzer?

author
TheRadMan made it!(author)2016-06-19

@TX: Perhaps the same Ardy could CW "modulate" the Laser Diode and then discriminate on the detector. Could this prevent he laser pointer spoofing-defeat you mentioned? It may mean that the Laser Diode has to be co-located with the Arduino and then a mirror or reflector would be used at the far end for a round trip . I am thinking of using this with a Nano and BluTooth or ZigBee or even Wifi from the lane to the farmhouse; perhaps even two beam pairs to tell in which direction the vehicle or pedestrian is travelling.

author
Consider+My+Solution made it!(author)2016-06-19

Rad, that's a good direction to take this author's presentation. I'd encourage you to try it in your shop before you hide all your valuables behind your laser protection "wall." :D

author
Consider+My+Solution made it!(author)2016-06-19

As a simple desktop demonstration, this is a great project for learning.

However, as an author, you owe it to your readers to advise them how ambient light affects your laser triggering.

For instance, what if a "bad guy" shines a flashlight on your sensor and then walks through the area of the beam? Will your alarm sound?

author
Dennisv15 made it!(author)2016-06-19

Please dont make this sound as work by taking all the fun out of it :(

author
Consider+My+Solution made it!(author)2016-06-19

Be nice, Dennis. No sad faces allowed. :)

There are already people commenting about creating their own property perimeter alarms. Shouldn't the author comment about whether (or how) that would work?

author
Dennisv15 made it!(author)2016-06-19

Well...being an author myself I say if this author thinks its fun to dig in deeper then yes please do. But no strings attached, its a hobby!

author
Zabagar made it!(author)2016-06-19

convoluted. Terrible directions.

author
doctorlock made it!(author)2016-06-19

this project may be great for aurdino but a infrared laser ldr,light dependant resistor, and a small pc board and 9v battery is simple. circuita abound foe the circuit to recieve the ir light is simple and cheap without ardino and low cost

author
Raphango made it!(author)2016-06-19

Nice!! =D

author
John+T+MacF+Mood made it!(author)2016-06-19

Very nicely done sir!

author
chela2 made it!(author)2016-06-15

Great project, What is the max distance between sensor and laser

author
John+T+MacF+Mood made it!(author)2016-06-19

I've seen visually 500 mW red lasers at over 800 feet, so I think with the right calibration (perhaps a variable resistor) you could go that far, and with mirrors you could circle your yard. (Depending of course on if you have a huge yard, build two or three...)

author
wingmaster1212 made it!(author)2016-06-19

Just depends how strong your laser is. When just the laser is on see how far it beams out to, then if needed you could also change the code to account for lack of strong light by changing that 120 value in the code to something different to make it more easily read the laser. You'll probably also want to make the photo resistor have more shade around it though.

author
blake.muchmore made it!(author)2016-06-15

looks awsome, i would also love to see a silent version

author
John+T+MacF+Mood made it!(author)2016-06-19

Or perhaps, put a wired buzzer inside your home for checking the border (perimeter) of your property. I was thinking of a project like this using IR lasers so the "intruder(s)" would not see the laser...

author
fredfow3 made it!(author)2016-06-16

Remove the buzzer, add a light.

author
AraC3 made it!(author)2016-06-19

Couldn't you get all these parts from a garage door laser safety unit? Those are cheap to free.

author
RobDeVoer made it!(author)2016-06-16

I bet a lot of people will have no problem following this tutorial while learning how to do more with their Arduino. Thanks.

author
blyamur made it!(author)2016-06-15

Why such complexity with Arduino, when everything is done simply on the photoresistors and relays.Shooting from a gun on sparrows.

author
HarryWiggs made it!(author)2016-06-15

OK...what is your idea? Post it so we can see it!

author
blyamur made it!(author)2016-06-15

The idea was written in the comments. And implementation is successfully used for photographing the drops. Drop crosses the beam, the camera releases the shutter.

0t0SkZy9i4o.jpg
author
diy_bloke made it!(author)2016-06-15

Good reply. Actually using an arduino isnt 'complexity' but ease and surely with prices of Arduino's so low, why not?
Sure you can do it without a n Arduino as blyamur says, but you need a relay to hold on the beeper after somoene breaks the beam, you need to trim your resister value such that the relay will attract (i.e. get the proper voltage) and of course you need a reset button to make the signal stop. Dont want a reset button but want it to automatically go off after a while? OK, add a 555 witch some resistors and capacitors.
Hmm getting quite complex. Maybe go back to using Arduino

About This Instructable

41,435views

516favorites

Bio: Youtube: www.youtube.com/channel/UCh5aXlcWXmVQ4ipj0y3qjbw?&ab_channel=SimpleCircuits
More by Simple-Circuits:USB Powered Laptop ChargerArduino - Laser Tripwire Alarm SystemT.A.P Bot 2.0 - The Wireless S.W.I.P.E Bot
Add instructable to: