Introduction: 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

Components can be found at
This Project uses and Arduino Board and LDR Add-on Kit

The Code:

void setup() {
  pinMode(13, OUTPUT);
void loop() {
  int sensorValue = analogRead(A0);
if (sensorValue > 300) { // Change Light Sensitivity by changing this value.
    digitalWrite(13, HIGH);
  analogWrite(3, 100); 
  analogWrite(3, 150); 
  else {
       digitalWrite(3, LOW);


Go to for more fun projects!