ky-008 Laser Tripwire Security Alarm
Introduction
This tutorial is an open source arduino project that teaches how to make Arduino LDR sensor Laser Tripwire Security Alarm using keyes ky-008 laser module, light sensor module and buzzer this project is very useful for school and indoor activities.
What Will I Learn?
HARDWARE
- Step 1: Gather all the Requirements
Requirements
- keyes - 008 laser module
- piezo buzzer
- Light sensor module
- resistor
- 1 Led
- 2 Breadboard /
- jumper wires
- Type B usb cable
- Arduino UNO R3 board
- PC
Difficulty
- Basic
Tutorial Contents
- Step 2: Build the circuit
Experimental Procedures
The arduino UNO R3
has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. 32k Flash Memory,source
codes and programs can be uploaded on to it from the easy Arduino computer program. which makes it a very easy way to get started working with embedded electronics. The name R3 is the third, and latest version of Arduino Uno Board
LDR Module
the LDr or light dependent resistor is device that is able to detect ambient and light intensity, it provides maximum possible contact area with the two metal films, the cadium sulfur track is used as the photoconductor it contains electrons when light is not contacted with it. As soon as light falls on the sensor, the electrons are liberated and the conductivity of the material increases. it has set of 2 legs, the positive leg in no particular position is connected to 22ok ohms resistor.
- connection to arduino
- Resistor 22ok ohms attach to LDR one leg
- The Black wire attach to LDR other (empty) leg → Arduino Gnd
- The Blue wire attach to LDR and resistor same column → Arduino A0
- The Red wire attach to resistor empty leg → Arduino 5V
laser Diode module
The laser ky- 008 module it resistor appears to be related to a control input and it's too high value (10K) to be a simple series resistor this laser we will use the laser 2-wire connections, current control is external, usually in the form of a current-limiting series resistor of small value which is the signal pin and the GND to circulate the current flow on the module.
- connection to arduino
Black wire to arduino GND
Sensor wire to arduino digital pin 7
piezo and LEd
The LED has 2 sets of leg the short one is the common cathode and the long leg will be the VCC, on this procedure place the led on the breadboard vertical rail or on the middle rail, on the long leg connect the 22ok ohms resistor then to digital pin 12 on the arduino. the long short leg should be conncted to GNd pin. the piezo buzzer is a typo mini speaker that produces beeping sound perfect for alarm ringtone, it converts electric power to produce sound. the short leg of the buzz is the common ground, the long is the vcc.
- connection to arduino'
- Buzzer + to pin 11 on Arduino
- Buzzer - to GND on Arduino
- Led + to pin 12 on arduino
- Led - to pin GND on Arduino
SOFTWARE
- Step 3: Dowload the Software and Libraries
If you’re ready to get started, click on the link below then select the version with your operating system.
Dowload the arduino Desktop IDE: https://www.arduino.cc/en/Main/Software
When the download is finished, un-zip it and open up the Arduino folder to confirm that click yes, there are some files and sub-folders inside. The file structure is important so don’t be moving any files around unless you really know what you’re doing.
- Step 4: Include libraries to arduino IDE
Once installed the Arduino desktop IDE. open the software then locate the SKETCH tab at the top of the software, navigate ADD ZIP LIBRARY >> then look for the downloaded libraries in the download folder. SELECT the zip file then wait for the process. include all the libraries fo liquidcrystal display.
- Step 5: Programming
source code
const int ledPin = 12;
const int buzzerPin = 11;
const int ldrPin = A0;
const int laserPin = 7;
void setup () {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ldrPin, INPUT);
pinMode( laserPin , OUTPUT);
digitalWrite( laserPin , HIGH);
}
void loop() {
int ldrStatus = analogRead(ldrPin);
if (ldrStatus < 700) {
tone(buzzerPin, 100);
digitalWrite(ledPin, HIGH);
delay(100);
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
delay(100);
Serial.println(" ALARM ACTIVATED ");
}
else {
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
Serial.println("ALARM DEACTIVATED");
}
Serial.println( ldrStatus );
//delay(10);
}
- Now, you can see if i remove the object that blocks the laser that passes through the LDR the alarm system should activated and the buzzer starts beeping. if you have important things that need to secure use tripwire laser security alarm.
I hope this Tutorial might help you on your future activity. thank you.
Posted on Utopian.io - Rewarding Open Source Contributors










Hey @lapilipinas, your contribution was rejected by the supervisor @espoem because he found out that it did not follow the Utopian rules.
Upvote this comment to help Utopian grow its power and help other Open Source contributions like this one. Do you want to chat? Join me on Discord.
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
The code is copied from a different source. Some can be found in http://jume-maker.blogspot.cz/2018/01/arduino-ldr-sensor-laser-tripwire.html
The tutorial (and others of the contributor too) lacks the tutoring part of the code. The text would benefit from rereading before submitting.
You can contact us on Discord.
[utopian-moderator]