polyhedra64
Published © GPL3+

Dynamic Laser Tripwire/Alarm

A Dynamic Tripwire/Alarm System

BeginnerShowcase (no instructions)144
Dynamic Laser Tripwire/Alarm

Things used in this project

Hardware components

Laser Diode, 655 nm
Laser Diode, 655 nm
×1
LDR, 5 Mohm
LDR, 5 Mohm
×1
5 mm LED: Red
5 mm LED: Red
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Untitled file

C/C++
Upload once wired
const int threshold = 920;
const int Laser = 9;
const int Led/Buzzer = 12;
bool Alarm = false;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(Laser, OUTPUT);
  digitalWrite(Laser, HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
  int Value = analogRead(A0);
  Serial.println(Value);
  if(Value < 800){
    tone(12, 4000);
  }else if(Value > 800){
    noTone(12);
  }
 
  
}

Credits

polyhedra64
4 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.