Arduino security box
Arduino Security Box
This project creates a security system for a box or container. Place the LDR in a dark container. When
the container is opened the buzzer will sound letting everyone know that the container has been opened
if the container is quickly closed the buzzer will turn off but an LED will remain on letting the user
know someone opened the container. Reset the board to reactivate the alarm.
Components Needed:
1x Arduino
1x Bread Board
1x Speaker or Piezo Buzzer
1x LED
1x LDR (Light Dependent Resistor)
1x 100 or 220 Ohm Resistor
1x 220 Ohm Resistor
1x 10K Resistor
1x Box
Wires
Components can be found at http://egrobotics.com/store/
This Project uses and Arduino Board and LDR Add-on Kit
www.EGRobotics.com
The Code:
void setup() {
pinMode(13, OUTPUT);
delay(2000);
}
void loop() {
int sensorValue = analogRead(A0);
if (sensorValue > 300) { // Change Light Sensitivity by changing this value.
digitalWrite(13, HIGH);
analogWrite(3, 100);
delay(1000);
analogWrite(3, 150);
delay(1000);
}
else {
digitalWrite(3, LOW);
}
}
This project creates a security system for a box or container. Place the LDR in a dark container. When
the container is opened the buzzer will sound letting everyone know that the container has been opened
if the container is quickly closed the buzzer will turn off but an LED will remain on letting the user
know someone opened the container. Reset the board to reactivate the alarm.
Components Needed:
1x Arduino
1x Bread Board
1x Speaker or Piezo Buzzer
1x LED
1x LDR (Light Dependent Resistor)
1x 100 or 220 Ohm Resistor
1x 220 Ohm Resistor
1x 10K Resistor
1x Box
Wires
Components can be found at http://egrobotics.com/store/
This Project uses and Arduino Board and LDR Add-on Kit
www.EGRobotics.com
The Code:
void setup() {
pinMode(13, OUTPUT);
delay(2000);
}
void loop() {
int sensorValue = analogRead(A0);
if (sensorValue > 300) { // Change Light Sensitivity by changing this value.
digitalWrite(13, HIGH);
analogWrite(3, 100);
delay(1000);
analogWrite(3, 150);
delay(1000);
}
else {
digitalWrite(3, LOW);
}
}