Arduino Laser Tripwire
![PICT0189.JPG](/proxy/?url=https://content.instructables.com/FF7/9007/GIWZLX0D/FF79007GIWZLX0D.jpg&filename=PICT0189.JPG)
Hey, there makers, hackers, and just plain inventors! This instructable is a fun and easy Arduino project for beginners (or advanced) that shows you how to make...ahem...drum roll please!
An Arduino Laser Security System! Bah, Bah, Bah,Baaaaaaaahhh! It uses simple electronic components, and an easy-to-use sketch. Basically what happens, is the laser shines on a photoresistor that sends an output to the Arduino. When the beam is interrupted, the arduino tells the buzzer to buzz, and the LED to light. So, without further ado, lets get started!
P.S. I wuz having trouble getting a video on here if it doent work, go to this link:
http://www.youtube.com/watch?v=YBTUJaXDccI
An Arduino Laser Security System! Bah, Bah, Bah,Baaaaaaaahhh! It uses simple electronic components, and an easy-to-use sketch. Basically what happens, is the laser shines on a photoresistor that sends an output to the Arduino. When the beam is interrupted, the arduino tells the buzzer to buzz, and the LED to light. So, without further ado, lets get started!
P.S. I wuz having trouble getting a video on here if it doent work, go to this link:
http://www.youtube.com/watch?v=YBTUJaXDccI
Materials
![PICT0144.JPG](/proxy/?url=https://content.instructables.com/FEY/7P56/GJ23A5OK/FEY7P56GJ23A5OK.jpg&filename=PICT0144.JPG)
This is an easy project, and requires a small amount of materials/tools. They are:
Materials:
Altoids Tin x 2 (one big, one small)
Arduino
Battery cord
3 volt button cell battery
Wire (any gauge will do)
Circuit board
Photo resistor
Buzzer
Laser diode
Stay-on push button
Switch
LED
10k resistor
Tools:
Wire cutter
Soldering iron
Nail
Hammer
Hot glue gun/glue sticks
Materials:
Altoids Tin x 2 (one big, one small)
Arduino
Battery cord
3 volt button cell battery
Wire (any gauge will do)
Circuit board
Photo resistor
Buzzer
Laser diode
Stay-on push button
Switch
LED
10k resistor
Tools:
Wire cutter
Soldering iron
Nail
Hammer
Hot glue gun/glue sticks
Laser Housing
![PICT0147.JPG](/proxy/?url=https://content.instructables.com/FNT/66N3/GIWZM6C0/FNT66N3GIWZM6C0.jpg&filename=PICT0147.JPG)
Okay, let start! Begin by nailing two holes into the side of the smaller Altoids tin. make them as low as possible, so that the top doesn't get in the way.
Solder and Install Laser
![PICT0149.JPG](/proxy/?url=https://content.instructables.com/F46/1EFG/GIYWWNG5/F461EFGGIYWWNG5.jpg&filename=PICT0149.JPG)
![PICT0152.JPG](/proxy/?url=https://content.instructables.com/FU5/WNZ6/GIYWWNGW/FU5WNZ6GIYWWNGW.jpg&filename=PICT0152.JPG)
![PICT0154.JPG](/proxy/?url=https://content.instructables.com/F14/0PV2/GIWZM6DI/F140PV2GIWZM6DI.jpg&filename=PICT0154.JPG)
![PICT0156.JPG](/proxy/?url=https://content.instructables.com/FOM/UV78/GIWZLX5W/FOMUV78GIWZLX5W.jpg&filename=PICT0156.JPG)
![PICT0160.JPG](/proxy/?url=https://content.instructables.com/FL1/B3VW/GIWZM6DH/FL1B3VWGIWZM6DH.jpg&filename=PICT0160.JPG)
Solder together the laser diode, the stay-on push button, and the button cell battery. Install them in the two holes you made earlier with hot glue.
Reciever Housing
![PICT0164.JPG](/proxy/?url=https://content.instructables.com/FVN/V926/GJ27Z096/FVNV926GJ27Z096.jpg&filename=PICT0164.JPG)
![PICT0170.JPG](/proxy/?url=https://content.instructables.com/FBK/Z1WE/GJ289PNV/FBKZ1WEGJ289PNV.jpg&filename=PICT0170.JPG)
Nail two holes in the bigger Altoids tin (one on each side in opposite corners). Now cut a piece of foam or rubber and place it on the bottom of the Altoids tin to insulate it.
Reciever Schematic
![Laser Tripwire circuit.bmp](/proxy/?url=https://content.instructables.com/FMI/GOP2/GJ282Y35/FMIGOP2GJ282Y35.bmp&filename=Laser Tripwire circuit.bmp)
Solder together your photo resistor,LED, Buzzer, and 10k resistor according to this schematic.
The Sketch
This is the sketch for the Arduino. Copy and paste it into the sketch environment. Then upload it to the Arduino.
//Laser Tripwire sketch
#define LED 13 //LED is connected to pin 13
#define Buzzer 7 //Buzzer is connected to pin 7
#define Sensor 0 //Photoresistor is connected to pin 0
int val = 0; //val is used to store state of input pin
void setup() {
pinMode(LED, OUTPUT); //sets digital pin as output
pinMode(Buzzer, OUTPUT); //sets digital pin as output
pinMode(Sensor, INPUT); //sets analog pin as input
}
void loop() {
val = analogRead(Sensor); //read input value of sensor and store it
if (val<100) // if the sensor goes below 100...
{
digitalWrite(LED, HIGH); //turn on LED
digitalWrite(Buzzer, HIGH); //turn on buzzer
}
else if (val>100)
{
digitalWrite(LED, LOW); //else, keep LED off
digitalWrite(Buzzer, LOW); //else, keep Buzzer off
}
}
//Laser Tripwire sketch
#define LED 13 //LED is connected to pin 13
#define Buzzer 7 //Buzzer is connected to pin 7
#define Sensor 0 //Photoresistor is connected to pin 0
int val = 0; //val is used to store state of input pin
void setup() {
pinMode(LED, OUTPUT); //sets digital pin as output
pinMode(Buzzer, OUTPUT); //sets digital pin as output
pinMode(Sensor, INPUT); //sets analog pin as input
}
void loop() {
val = analogRead(Sensor); //read input value of sensor and store it
if (val<100) // if the sensor goes below 100...
{
digitalWrite(LED, HIGH); //turn on LED
digitalWrite(Buzzer, HIGH); //turn on buzzer
}
else if (val>100)
{
digitalWrite(LED, LOW); //else, keep LED off
digitalWrite(Buzzer, LOW); //else, keep Buzzer off
}
}
Install Reciever Circuit and Arduino
![PICT0179.JPG](/proxy/?url=https://content.instructables.com/F41/I119/GJ285KMR/F41I119GJ285KMR.jpg&filename=PICT0179.JPG)
![PICT0184.JPG](/proxy/?url=https://content.instructables.com/F79/GRW0/GJ27Z0KF/F79GRW0GJ27Z0KF.jpg&filename=PICT0184.JPG)
Make your connections to all the pins on the Arduino, then insert it into the Altoids tin. Make sure to cut two holes in the top of the Altoids tin for the buzzer and LED. You also will need to bend the photo resistor to align with your hole.
Finishing Touches
![PICT0187.JPG](/proxy/?url=https://content.instructables.com/F5H/O5IP/GJ285Q8S/F5HO5IPGJ285Q8S.jpg&filename=PICT0187.JPG)
![PICT0190.JPG](/proxy/?url=https://content.instructables.com/F6U/1H1E/GJ285Q8E/F6U1H1EGJ285Q8E.jpg&filename=PICT0190.JPG)
The last step is to solder the switch and battery to the cord coming from the Arduino. Congratulations! You have just successfully made an Arduino Laser Tripwire! Have fun, and catch people in the act!