Find all your DIY electronics in the MakerShed. 3D Printing, Kits, Arduino, Raspberry Pi, Books & more!

Make: Projects

The Arduino Controlled Laser Security System

An arduino that runs a code that tells if someone trespassed your property...

The Arduino Controlled Laser Security System

An arduino that runs a simple sketch can become a laser security system. The hardware is pretty easy.

Related

Steps

Step #1: Make the connections

PrevNext
The Arduino Controlled Laser Security System

Use the breadboard (or protoshield) to connect one leg of the photoresistor to Analog Input 0, and the other leg to +5v. Then, take the 10K resistor and connect one leg to GND (ground) and the other to Analog Input 0. Also, I wired an LED to Digital I/O pin 13 to show when the laser beam is broken. Hook the negative end of the LED to ground as well.

Step #2: Set up the laser

PrevNext
The Arduino Controlled Laser Security SystemThe Arduino Controlled Laser Security SystemThe Arduino Controlled Laser Security System

Remove the end cap and take out the batteries. Inside, there should be a spring, connect one of the alligator clips to this spring. Most laser pointers have a completed circuit when the end cap is on, so connect the other alligator clip to some metal on the actual metal housing of the laser pointer. Connect one of the alligator clips to GND, and the other to digital I/O pin 4. Finally, you can use tape to secure the button down, so the laser pointer is always on.

Step #3: The program

PrevNext
The Arduino Controlled Laser Security System
  • Copy and paste this into the IDE:
  • void setup() { pinMode(4, OUTPUT); pinMode(13, OUTPUT); } void loop(){ digitalWrite(4, HIGH); if(analogRead(0) < 750){ digitalWrite(13, HIGH); } else{ digitalWrite(13, LOW); } }
  • Then click upload.

Step #4: Test n' troubleshoot

PrevNext
The Arduino Controlled Laser Security SystemThe Arduino Controlled Laser Security SystemThe Arduino Controlled Laser Security System
  • Run the program and see how it goes! When the laser is hitting the photoresistor, the LED is off. When the laser isn't hitting the photoresistor, the LED is on. Troubleshooting: First off, you have to make sure that the laser pointer is on. If it is not, check the following: -That the on button really is on. -That you didn't connect the alligator clips the opposite way they should be. To fix this, change one from GND to Pin 4, and the other from Pin 4 to GND.
  • There are other things you can do to change it up a little bit. You can add a 3 volt siren instead of the LED or use a 3 volt wireless transmitter to make an alarm on your phone or whatever you want. Happy Making!

blog comments powered by Disqus

Related Supplies at Maker Shed

Follow

Get every new post delivered to your Inbox.

Join 26,145 other followers