Laser System (using Flashlight)

Introduction: Laser System (using Flashlight)

Hello everyone. I would like to thank Instructables and Intel for selecting me with 249 others for free Intel Edison kit. I am sure you all have seen Laser Security System in spy movies. Have you ever wondered about making your one on your own? Well this instructables is about making your own Laser Security System. I choose this because (you have to admit it sounds cool and) it is very easy and can be made by anyone new to Arduino. I will be making this using Intel Edison but you can use this on Arduino Uno too. I have used LED as the indicator when the difference in light intensity is more than 100. LED will light up for 3 seconds. Lets get started.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Gathering Supplies

What will you need?

  • Intel Edison and expansion board
  • Groove Arduino motor shield
  • Groove Light sensor
  • Groove LED
  • Flashlight ( Laser Pointer recommended though it would be hard to setup)

Step 2: Connection and Coding

First of all you need to go through steps mentioned in Intel Getting Started. Now open a new window in Arduino software. Code which is almost self-explanatory is

const int pinLight = A0;
const int pinLed = 7;

void setup() { pinMode(pinLed, OUTPUT); //set the LED on Digital 12 as an OUTPUT }

void loop() { int InitialValue= analogRead(pinLight); delay(500); int FinalValue = analogRead(pinLight); //the light sensor is attached to analog 0 int diff = FinalValue - InitialValue; if((diff>=100)||(diff<(-100))) //if difference is more than 100 { digitalWrite(pinLed, HIGH); delay(3000); digitalWrite(pinLed, LOW); } }

Hardware connection is simple. Attach motor shield to expansion board. Connect Light sensor to 'A0' and LED to 'D7', just like shown in the picture. (Important step:- Hold it in your hand and laugh like a mad scientist. Stop once it feels awkward) Now setup everything. Light should fall on thing with snake like pattern on light sensor, so if you have laser pointer it should fall on that thing and that is why laser pointer is hard to setup.

Step 3: Future Considerations

Once you play with the code more you can also add in log using memory card when someone entered and exited your room. Also you could replace LED with Buzzer ( I have to admit that I used buzzer when experimenting until my annoyed roommate got angry with me). Advantage of LED is that person who broke in doesn`t know that you know about him. I admit that photo quality isn`t that good and I am really sorry for that. Feel free to comment if you don`t understand anything or want help with something similar.

Protected Contest

Participated in the
Protected Contest

Be the First to Share


    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest