Sahar Soleymaniniaz faghih
Published © GPL3+

Laser security system using Arduino UNO

A laser based intruder detection system built with Arduino UNO that triggers an alarm when the laser beam is interrupted.

BeginnerFull instructions provided24 hours146
Laser security system using Arduino UNO

Things used in this project

Story

Read more

Code

Laser code

Arduino
This Arduino code reads analog values from two input pins (A0 and A1) and turns an LED on or off based on those readings
void setup() { 
 pinMode(13, OUTPUT); 
 Serial.begin(9600); 
} 
 
void loop() { 
  int valA0 = analogRead(A0); 
  int valA1 = analogRead(A1); 
  Serial.print("A0: "); 
  Serial.print(valA0); 
  Serial.print(", A1: "); 
  Serial.println(valA1); 
  
  if (valA0 < 800 ||valA1 > 300) { 
    digitalWrite(13, HIGH); 
  } else { 
    digitalWrite(13, LOW); 
  } 
 
  delay(100); 
}

Credits

Sahar Soleymani
3 projects • 0 followers
niaz faghih
3 projects • 0 followers

Comments