Alarm system (Burglar alarm) based on P89v51rd2 8051 microcontroller
Burglar alarms have become standard equipment in stores and other businesses, and they're becoming increasingly common in private homes as well. If you've ever shopped for a home security system, then you know there are a wide variety of options available. These systems range from do-it-yourself kits you can pick up for $10 to sophisticated whole-house security networks that must be installed by professionals. But, as it turns out, most alarm systems are actually built around the same basic design concepts.
We know that in an embedded system (mainly robotics), basic flow is like this. We get physical input from environment with help of semiconductors, then we process it(processing very deeply or sometimes not much processing) and then finally doing some actions with help of any actuators.
In this case, Its like gettting an input either from any mechanical switch (connected to door), Radars, ultrasonic sensors, motion detectors, programmed cameras (OPENCV) or IR sensors too. Yes! In this tutorial, we will use an IR sensor for learning the concept so that beginners can become comfortable with programming environments and can easily think of higher projects implementation WITHOUT INVESTING MUCH MONEY. Because unless you(as a learner or student) are not sponsered by any university or professor, its a bit costlt to practice robotics and robotics comes easy, only if you implement them on hardware rather than working on PC on any software simulator.
For that reason, i have decided to take IR sensor on input side. Now comes the processing unit which is already 8051 microcontroller development baord, on which i have my full focus in this article. By the way, I highly recommend you to check my 8051 articles where i have explained basic theory like pin diagram/descriptions and working of 8051 architecture with the complete programming environment setup.
Moving on to output side, here i have again selected a very small and cheap alarm. Not alarm, but in fact a high current buzzer. Because, if you can trigger a buzzer, then you can also trigger any alarm by just getting some knowledge of electrical systems and relay which we will definately talk about some day. In Burglar alarm, usually there are 3 types of actuator actions:
1. Triggering loud alarms
2. Flashing lights
3. Calling emergency numbers (requires GSM/3G extension to this project)
But we will use a high current buzzer, so you can think of it as an alternative to first choice. Now for further information i want you to see the video embedded here. In this video, i have explained the working of this project.
I hope that, you have clear understanding about the circuit through this video. I have not given a seperate circuit diagram to you people because i want you to understand the working and not just see and make circuits. But after this video, you could still not figure out how to make circuit on this board or at your custom board then for that, i have made a small PDF file for all the steps you should follow, while making this circuit. you can download this file from here. With this, you can also download the codes of 8051 microcontroller interfacing and specially the code for this project on this git link.
A bit code explaination
Below given code snippet of this project.
Here you can see some initialization where Port 1 is used for LEDs and some macro variables are used for apin to which alarm is connected. In while loop, there is only passing of input data to alarm and LEDs. There is no much data processing by 8051 in this version of alarming system.
But my main aim, is to give you enough knowledge to configure 8051 microcontrollers for input, output and a systematic code arrangement.
I hope this article helped you. Please feel free to comment below or contact me, for any query. :)