You are on page 1of 7

Laser Alarm System

[~Danganan, Paul Kelly ~ Alemania, Albert ~ Yu, Jasper Howard ~ Bernardino, Ruzelle~]

This project entitled Laser Alarm System is based on the thought of home security.
When the project was announced to us, all of us immediately thought of a laser tripwire alarm
but we had no clue on how to build one, we tried several circuits but failed, in the end we
incorporated the use of a microcontroller, an Arduino, because it being readily available to us,
meant that it was a convenience for the group. Also, being an electronics engineering student,
we wanted to expose ourselves into building or creating things that we can apply into our homes
and into our lives.
Materials Used

Description Quantity Price


220 ​Ω​ Resistor 4 8 php
10k ​Ω 2 4 php
Laser Pointer 1 20 php
Light Emitting Diode(LED) 4 20 php
Universal PCB 1 80 php
Tact Switch(Push Button) 1 7 php
Piezoelectric Buzzer 1 10
Arduino Mega 2560 1

Built It

Here are the steps on building this project.


STEP1. Breadboard

Assemble the components like in the picture above.


Where:
The( + )terminal of the LEDs are as follows:
Green-Pin 5, Orange-Pin 4, White-Pin 8, Red-Pin 7.

The( - )Terminal of the LEDs should be connected in series with the 220​Ω Resistor and into the
ground.

For Tact Switch and LDR:

One leg should be connected into the Supply and the other Leg connected into a 10kΩ Resistor
and into the ground.

in parallel with the LDR and the 10kΩ resistor would be a connection going to Pin A0

in parallel with the Switch and the 10kΩ resistor would be a connection going to Pin 6

For the Buzzer


(+) Terminal - Pin 12

(-) Terminal - Ground


Step 2. Upload the code into the Arduino
const int triggeredLED = 7; if (isTriggered){ int sample = 0;

const int triggeredLED2 = 8; for (int i = lowrange; i <= highrange; i++) int baseline = 0;

const int LED = 4; { const int min_diff = 200;

const int GreenLED = 5; tone (speakerPin, i, 250); const int sensitivity = 50;

const int inputPin = A0; } int success_count = 0;

const int speakerPin = 12; for (int i = highrange; i >= lowrange; i--) digitalWrite(RedLED, LOW);

const int armButton = 6; { digitalWrite(GreenLED, LOW);

boolean isArmed = true; tone (speakerPin, i, 250); for (int i=0; i<10; i++){

boolean isTriggered = false; } sample += analogRead(inputPin);

int buttonVal = 0; digitalWrite(triggeredLED, HIGH); digitalWrite(GreenLED, HIGH);

int prev_buttonVal = 0; delay(50); delay (50);

int reading = 0; digitalWrite(triggeredLED, LOW); digitalWrite(GreenLED, LOW);

int threshold = 0; delay (50); delay (50);

const int lowrange = 2000; digitalWrite(triggeredLED2, HIGH); }

const int highrange = 4000; delay (50); do

void setup(){ digitalWrite(triggeredLED2, LOW); {

pinMode(triggeredLED, OUTPUT); delay (50); sample = analogRead(inputPin);

pinMode(triggeredLED2, OUTPUT); } if (sample > baseline + min_diff){

pinMode(RedLED, OUTPUT); delay(20); success_count++;

pinMode(GreenLED, OUTPUT); } threshold += sample;

pinMode(armButton, INPUT); void setArmedState(){ digitalWrite(GreenLED, HIGH);

digitalWrite(triggeredLED, HIGH); if (isArmed){ delay (100);

delay(500); digitalWrite(GreenLED, HIGH); digitalWrite(GreenLED, LOW);

digitalWrite(triggeredLED, LOW); digitalWrite(RedLED, LOW); delay (100);

calibrate(); isTriggered = false; } else {

setArmedState(); isArmed = false; success_count = 0;

} } else { threshold = 0;

void loop(){ digitalWrite(GreenLED, LOW); }

reading = analogRead(inputPin); digitalWrite(RedLED, HIGH); } while (success_count < 3);

int buttonVal = digitalRead(armButton); tone(speakerPin, 220, 125); threshold = (threshold/3) - sensitivity;

if ((buttonVal == HIGH) && (prev_buttonVal == delay(200); tone(speakerPin, 196, 250);


LOW)){
tone(speakerPin, 196, 250); delay(200);
setArmedState();
isArmed = true; tone(speakerPin, 220, 125);
delay(500);
} }
}
}
if ((isArmed) && (reading < threshold)){
void calibrate(){
isTriggered = true;}
STEP 3

Transfer Everything into PCB and assemble into a container

Additional Notes

The Laser alarm system can be powered using a 9v battery using the Vin pin on the
arduino. The laser alarm system when started self calibrates first so there should be light
pointed or light reflected onto the LDR when turning it on. It has an arm and disarm function,
once the laser is tripped there you can’t reset it unless you kill the supply or push the
arm/disarm button

Conclusions

I think that our Project is super cool. It has blinkers that synchronizes with the buzzer. As home
alarm system, anybody with an arduino could make it. I think we there is room for improvement
in the build like integrating IR Sensors to replace the push buttons.

Websites and Resources

http://www.instructables.com/id/Arduino-Laser-Alarm/

http://www.instructables.com/id/Arduino-Tutorial-Laser-Security-System/

Make:Getting Started with Sensors

“Measure the World with Electronics,Arduino, and Raspberry Pi” by : Kimmo Karvinen & Tero
Karvinen

You might also like