Hackster will be offline on Monday, September 30 from 8pm to 10pm PDT to perform some scheduled maintenance.
Techatronic
Published

How to make a laser security Alarm using arduino

Arduino based Laser security alarm

IntermediateFull instructions provided6 hours4,179
How to make a laser security Alarm using arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Laser Diode, 655 nm
Laser Diode, 655 nm
×1
LDR, 5 Mohm
LDR, 5 Mohm
×1
Buzzer
Buzzer
×1
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

circuit

c

Code

Code

C/C++
code
void setup() {
  // put your setup code here, to run once:
pinMode(2, INPUT_PULLUP);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(6, OUTPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
int m = digitalRead(2);
Serial.println(m);
delay(100);
if(m==1)

{
  
  //Serial.print("LASER ON");
  digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(6, LOW);
  delay(500);
  
  }


else

{
  
 // Serial.print("LASER OFF");
  digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);

  delay(500);
  
  
  
  }

  

}

Credits

Techatronic

Techatronic

72 projects • 125 followers
Electronic engineer

Comments