Introduction: Arduino Security Box

Picture of 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);
  }
}

Video:
http://youtu.be/ts8XVgXQBco


Go to www.instructables.com/member/EGRobotics/ for more fun projects!

Comments

tsuyoshisano (author)2017-02-13

Hi, i would like to ask that if i replace the buzzer to an amplifier circuit for high volume. Will it still functioning?

jdelfinado (author)2013-03-19

Hi i did built this Alarm Circuit but i have a problem on the Piezo Buzzer, it dont Sound that loud like what shows in your video.
I've tried direct install the buzzer to a 12v just to check if the buzzer has the problem but it's not it is normal and loud, can someone teach me how to make the buzzer louder,

EGRobotics (author)jdelfinado2013-03-19

Hi jdelfinado,

Using an Arduino board it will never be as loud as a 12V source unless you run it through a transistor and the Arduino. I don't know which Piezo Buzzer you have but try checking it's datasheet for voltage range. How loud is it compared to when you plug it into the Arduino's 5V? It should be just slightly quieter because of the resistor. You can also remove the resistor to the Piezo to boost the volume, this should be fine as the digital pins put out very little power(Unless you are trying to route the 12V through it.) Other than that double check your circuit. Let me know what you discover. Good Luck!

EGRobotics

tyishistory (author)2013-03-14

Thanks for the help! I got it to work changing the light sensor value. This is a great project thanks for your input!

tyishistory (author)2013-03-12

So i built this and the alarm is always going off. Is the voltage from the 5v causing this and would I need to integrate in a pullup resistor to lower the voltage for this to work?

EGRobotics (author)tyishistory2013-03-12

Hi Tyishistory,

5V is the correct voltage. If you built it the same as shown above, the only reason I would see it continuing to Buzz would be that the box is not getting dark enough. Do an analog read on the sensor while it is in the box. If it is greater than 300 then be sure to to change the code to fit what was read:

if (sensorValue > 300) { // Change Light Sensitivity by changing this value.

You could also test to make sure no positive and negatives are switched. If the Buzzer turns off when a flashlight's beam is on the LDR then the 10K and LDR should be switched.

Let me know if none of those ideas work!

Good Luck!

For more ideas or help check out: www.egrobotics.com


About This Instructable

7,648views

32favorites

License:

Add instructable to: