Arduino Laser Tripwire

42,956

132

41

I absolutely love doing anything related to electronics, computers, and software. I can often be ...

Intro: Arduino Laser Tripwire

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





Step 1: Materials

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

Step 2: Laser Housing

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.

Step 3: Solder and Install Laser

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.

Step 4: Reciever Housing

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.

Step 5: Reciever Schematic

Solder together your photo resistor,LED, Buzzer, and 10k resistor according to this schematic.

Step 6: 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
    }
}
   

Step 7: Install Reciever Circuit and Arduino

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.

Step 8: Finishing Touches

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!

Share

    Recommendations

    • Optics Contest

      Optics Contest
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge
    • Audio Contest 2018

      Audio Contest 2018

    41 Discussions

    0
    None
    kidokwan

    2 years ago

    hey, this is a great idea. Can the code be modified somehow to activate a small servo motor instead of an LED and buzzer? I want to activate a servo to turn instead of a led and buzzer. Any code for this somewhere?

    0
    None
    _PJ007

    4 years ago on Introduction

    i want to do it with a Gsm Module... Can you give suggestions and programs for making so for perimeter protection

    0
    None
    atharva12

    4 years ago on Introduction

    hi you can make this a lot cheaper watch this

    Thanks KipKay

    0
    None
    rondacosta

    5 years ago on Introduction

    very nice 'able.
    Two things: First, no laser diode, no project. Therefore, if you do not provide any info on the heart of the circuitry, it becomes a novelty to only talk about,,,,
    Second, the Purpose was to provide perimeter security (?). how far can you put the beam source from the detector circuitry and trip it? if no information, it may not be worth trying just to try. Any help o these questions?

    1 reply
    0
    None
    Adum24rondacosta

    Reply 5 years ago on Introduction

    Hey rondacosta, thanks for checking out my project! As for the laser diode, I merely pulled it out of a toy, but they sell ones at dollar stores for a buck that will suffice. If you wanted to buy one on ebay or something, I would not be able to tell you specifics, sorry. Again, I pulled it out of a toy, so, I didn't really know the specifications. In regards to the distance between the diode and the detector circuitry, I never really tested it, but I'm sure it could go more than a few feet. Seeing as its only really suppose to go in one doorway, it shouldn't really be an issue. I hope this answers your questions!

    0
    None
    HavocRC

    5 years ago on Introduction

    You should make the code so that once the beam is broken the alarm stays on for like say 5 seconds. Then it could actually be useful as a burglar alarm!

    Just a suggestion!

    2 replies
    0
    None
    Adum24HavocRC

    Reply 5 years ago on Introduction

    Thanks for the suggestion. That does make more sense :D I made this a while ago, so there are many improvements that could be made.

    0
    None
    HavocRCAdum24

    Reply 5 years ago on Introduction

    Haha, I could see burglars going, "Alright, JUMP AS FAST AS YOU CAN!" Haha, I like this project. I think I'll make it today :D

    0
    None
    Snortimer

    5 years ago on Introduction

    Nice 'ible! I plan on using a laser tripwire for Halloween next year, and this is a great start on how to do it! As per a suggestion below (and which I had thought of), I'll probably mount the laser in an enclosure with a laser, so that all of the electronics are together, and use a mirror to guide the light. If I get ambitious, I might add a prism and monitor different light colors to detect exactly where my victi... Er, "subject" is. Then I can trigger some fun stuff, as the noise sensors don't work the way I'd like. Also, one thing doesn't have a sensor at all, and just runs continuously (so annoying).

    4 replies
    0
    None
    SnortimerSnortimer

    Reply 5 years ago on Introduction

    Plus, by monitoring different wavelengths this way (or just aiming different beams at different sensors), I could use one Arduino (more likely just the ATmega328p) to control a few different baddies. Of course, I'd have to somehow mount mirrors outside with some precision.

    0
    None
    Adum24Snortimer

    Reply 5 years ago on Introduction

    NIce! I like your line of thinking!! Yeah I made this a while ago, so there are obviously many improvements that I see now looking back on it. I hope your project goes well!

    0
    None
    GameNoxAdum24

    Reply 7 years ago on Introduction

    I want to get Arduino but if I buy 1 other projects will say I need a different type. Should I just buy any one?