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

Project Steps

Make the connections

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.

Set up the laser

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.

The program

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.

Test n' troubleshoot

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!