-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaser_security_system.ino
More file actions
42 lines (40 loc) · 1.05 KB
/
laser_security_system.ino
File metadata and controls
42 lines (40 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
///********* AUTHOR :: Param Parekh *********///
/*
Project::Laser based Security System is a type of security and alarm system that uses laser light and a light sensor. A security system protects our homes, offices, banks, lockers etc.Here,We try to implement L.S.S(Laser security System) using Arduino,LDR sensor and Laser sensor.
componenets Used:
1) Laser Tx Module KY-008
2) LDR(light dependent Module)
3) Buzzer
4) LED(green)
5) ARDUINO UNO
*/
int laser=2;
int buzzer=3;
void setup()
{
pinMode(A0,INPUT);
pinMode(laser,OUTPUT);
Serial.begin(9600);
pinMode(7,HIGH);
}
void loop()
{
int i=analogRead(A0);
digitalWrite(laser,HIGH);
delay(100);
Serial.println(i);
if(i>=100)
{
digitalWrite(7,HIGH);
delay(100);
tone(buzzer,1000);
delay(100);
}
else
{
noTone(buzzer);
delay(1000);
digitalWrite(7,LOW);
delay(100);
}
}