Laser System (using Flashlight)

by sagar.rupapara.14 in Circuits > Sensors

1250 Views, 15 Favorites, 0 Comments

Laser System (using Flashlight)

10917477_859976654066747_2129661891_n.jpg
10917546_859976647400081_1551065854_n.jpg

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.

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)

Connection and Coding

10904185_859976644066748_2013234841_n.jpg

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.

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.