Arduino Laser Alarm

3,642

17

9

Introduction: Arduino Laser Alarm

About: I'm a maker who loves lasers.

Parts:

  • 1X 5v Buzzer
  • 1X 3v LED (Any colour)
  • 1X 10K resitor
  • 1X 1k resitor
  • 1X photoresistor
  • 1X laser
  • 1X Arduino (any board)
  • 1X breadboard
  • 1+ jumper wires

Things you may want to add:

  • siren light
  • relay to control any thing
  • mirrors

Step 1: Breadboard:

First make sure your Arduino is turned OFF.

Plug two jumper wires into the power row on the breadboard, plug one end of the Buzzer into GND and the other into Pin 7.

The led is plugged into GND and Pin 13 with a 1K resistor and the Photoresistor into GND and the other end has a 10K resistor is plugged into 5v.

Then plug in a jumper wire from the same pin were the Photoresistor and 10K resistor meet into Pin AO.

Step 2: Upload Code to Arduino

Plug your board into your computer and upload.

You may need to adjust the code to work with your lighting.

Step 3: Things You May Want to Add

Siren light:

Take your light apart and remove all unneeded things inside and glue an LED in and plug the wires into were it was before.

______________________________________________________________________________________________

Relay:

Plug your relay into GND, 5v and Pin12

______________________________________________________________________________________________

The code for relay and a servo is above

______________________________________________________________________________________________

Mirrors:

Place the laser some were then place a mirror were the laser shines and do this till you like it, But make sure to aim it at the Photoresistor at the end.

Step 4: Setup

Place the laser some were and aim it at the Photoresistor.

Turn one your Arduino and your done!

Be the First to Share

    Recommendations

    • Mason Jar Speed Challenge

      Mason Jar Speed Challenge
    • Bikes Challenge

      Bikes Challenge
    • Remix Contest

      Remix Contest

    9 Discussions

    0
    DhruboC
    DhruboC

    4 years ago

    Can I use an IR photodiode

    0
    Mike-X
    Mike-X

    Reply 4 years ago

    ??????????

    https://www.instructables.com/id/IR-laser-person-counter/

    0
    DhruboC
    DhruboC

    4 years ago

    Is the relay optional.

    0
    Mike-X
    Mike-X

    Reply 4 years ago

    Yes, the relay(s), mirror(s) and light(s) are optional

    0
    Stylesgarcia3
    Stylesgarcia3

    4 years ago

    i cant upload th code

    0
    Mike-X
    Mike-X

    Reply 4 years ago

    Try copying & pasting this:

    //Laser Tripwire sketch

    #include <Servo.h>

    Servo myservo;

    int Servoval;

    #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() {

    myservo.attach(9);// plug the servo into digital 9

    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<5) // if the sensor goes below 100...

    {

    digitalWrite(LED, LOW); //turn off LED

    myservo.write(0);

    digitalWrite(Buzzer, LOW); //turn off buzzer

    }

    else if (val>10)

    {

    myservo.write(0);

    digitalWrite(LED, HIGH); //else, keep LED on

    digitalWrite(Buzzer, LOW); //else, keep Buzzer on

    delay(100);

    digitalWrite(LED, LOW);

    digitalWrite(Buzzer, HIGH);

    delay(50);

    digitalWrite(Buzzer, LOW);

    delay(500);

    myservo.write(180);

    delay(700);

    }

    }

    0
    Mustafa Moussa
    Mustafa Moussa

    5 years ago

    Where is the code may I ask?

    0
    Mike-X
    Mike-X

    Reply 5 years ago on Introduction

    The code is an Arduino file on step 2

    0
    tomatoskins
    tomatoskins

    5 years ago on Introduction

    I love this idea! Thanks for sharing! Anything with lasers is awesome!