Glowing LED Burglar Alarming System
by BhaswarG in Circuits > Arduino
946 Views, 11 Favorites, 0 Comments
Glowing LED Burglar Alarming System
Hello friends, welcome back with another new Instructables. In this
Instructables I'll be teaching you how to make a Hidden Burglar Alarm System with a micro-controller called Arduino. It can be a very useful gadget. This small cube can be hidden into nearly anything, so that people doesn't come to know that it's a hidden alarm. I got this idea while making my obstacle avoiding robot for my school's maker fair's project. It took me 4 hours to make. Taking videos and pictures for each steps and then editing took me nearly a whole day.
For better guidance I've posted a video for you, taking you through each details step by step. Here is the link to my video:
https://www.youtube.com/watch?v=glU72GwpTGM
PLEASE DON'T FORGET TO VOTE FOR ME! :-)
How Does an Ultrasonic Distance Sensor Work?
As the name says, it's a sensor which can measure distance between two
objects. The sensor has two eyes like things. Near one of the eyes there will be a "T" which means "Transmitter". It sends out sound waves and if there's an object in front of it then the pulses will rebound and come back to the other eyes "R" which is the "Receiver". So it knows the time it took for the pulses to go and come back. In your program you have to change the time into distance. That is how this sensor works.
I hope you guys understood how this sensor functions. If you guys are facing any difficulties then please feel free to ask me in the comments below. I'll try and answer as quickly as possible.
Different Hardware Needed
Here are the components to make this project:
- Arduino Uno
- Ultrasonic distance sensore
- Mini breadboard
- USB cable
- Male to male jumper wires
- Buzzer
- 9v battery and connector
- 2 LEDs
- Some cardboard sheets
Let's Start Making!
Now get your mini breadboard and fix the ultrasonic sensor on it as the
schema shows. I have some real life photos of how I had done it. The circuit is quite simple, all you need to do is to copy the schema. Make sure each wiring is correct or else the circuit won't work.
Finishing Touch to the Circuit
After you finish making the circuit, you'll realize how messy the whole
wiring looks. So try and make it as com packed and neatly as possible, because if you've made any mistake in the circuit then it will be easy to find out what's the problem.
Let's Write the Code
Okay, so the coding part is a little complicated (if you're a beginner) or else if you know c++ then it's nothing tough. Here is the code, you can copy and paste in your Arduino software.
int buzzer = 7;
int numBlink = 7;
int timeOn = 100;
int timeOff = 100;
int led1 = 4;
int led2 = 3;
int trigPin = 6;
int echoPin = 5;
float duration;
float targetDistance;
float speedOfSound = 867.3;
void setup () {
Serial.begin (9600);
pinMode (trigPin, OUTPUT);
pinMode (echoPin, INPUT);
pinMode (led1, OUTPUT);
pinMode (led2, OUTPUT);
pinMode (buzzer, OUTPUT);
}
void loop ()
{ digitalWrite (trigPin, LOW);
delayMicroseconds (3000);
digitalWrite (trigPin, HIGH);
delayMicroseconds (15);
digitalWrite (trigPin, LOW);
duration = pulseIn (echoPin, HIGH);
duration = duration/1000000.;
duration = duration/3600.;
targetDistance = speedOfSound * duration;
targetDistance = targetDistance/2;
targetDistance = targetDistance*160934;
if (targetDistance <= 80)
for (int j=1; j<=numBlink; j=j+1) {
digitalWrite (buzzer, HIGH);
digitalWrite (led1, HIGH);
digitalWrite (led2, HIGH);
delay (timeOn);
digitalWrite (led1, LOW);
digitalWrite (led2, LOW);
digitalWrite (buzzer, LOW);
delay (timeOff);
}
else {
digitalWrite (led1, LOW);
digitalWrite (led2, LOW);
digitalWrite (buzzer, LOW);
}
Serial.println (targetDistance);
delay (500);
}
Cover Up the Circuit
Now once you've finished making the electrical part, we will move to make a covering for our box so that it's not obvious to strangers that it's some kind of electronic gadget. The main idea is to hide the circuit with cardboard. I used a rubber band to stick the Arduino with the cardboard base. You could even use double sided tape to stick the battery and the mini breadboard, but as I had finished my double sided tape I used ordinary scotch tape.
Voila!!!!
This is how it will look once you've completed. Now you can hide this smart device anywhere in your house. No one will be able to identify that's it's a burglar alarming system. Isn't it worth it? :-)
Here is a last picture where I had kept this gadget hidden between the stairs, so if someone's coming up then we will get alarmed.
If you found this Instructables helpful then please vote for me and favorite it. I'll be really happy if you do me this small favor.
Thanks :-)