Houses nowadays have become smart. They are well-equipped with fantastical technology, which was only dreamt in science fiction. From automatic thermostats to Alexa, our homes do more than they did just a few decades ago. We even have advanced security systems now, but even these complex systems are build upon fairly simple systems. In this article, we look at an intruder alarm system, made using the 8051 Microcontroller. So, let's get started
Our intruder alarm system is going to perform this seemingly complex task using a simple solution. We consider all doors in a house are switches; so if a door is open, the switch is on and vice versa. This helps us because now we have a binary input to our system: 1 or 0. Our task is simply to keep checking, at regular intervals, if any door is open. If our program finds a door open, it'll trigger the alarm (which is just a buzzer) and an LED. We'll also display which door has been opened on an 7-Segment display. We also need to provide a clock to our microcontroller and a reset switch. Once our idea of our project is clear, we can get to work.
We're using the 8051 Microcontroller to take in the input from the switch at regular intervals and send output to various other components and the 7-Segment Display. Also used are the switches for the doors and the reset button. We'll be using a buzzer and a, preferably red, LED for the alarm system. The rest of the components include the capacitor and crystal capacitors that make up the clock. This clock will be used to provide the delay to the microcontroller.
Once we're done setting up things, we can get to the code. The 8051 Microcontroller uses C++ for coding in instructions. Our code has to provide a small delay before checking if any door is open, then it'll send the required signals across the circuits.
The logic behind the code is fairly simple. The first few lines are initialisation lines, they're used to define the pins on the microcontroller, so we can manage them later. After, initialising the constants, we can directly get to the main function. As we discussed earlier, the main function has some tasks it has to perform. Starting off with giving input to the 7-Segment display and the entire circuit, we have an IF statement, which tells the circuit what to do if any one of the door is open. For example, if door 2 is open, the program will turn the buzzer on, send a "1" signal to the display and turn the LED on.
And with that, our project is complete. It's always best to try and experiment by yourself, so it's highly recommended to go ahead and try this on your own and perhaps build up on this simple program to check its limits!
Want us to help you with the projects, write your inquiry here - Order Projects Check out our Free Arduino Projects Playlist - Arduino Projects Check out our Free Raspberry Pi Projects Playlist - Raspberry Pi Projects Check out our Free TinkerCAD Projects Playlist - TinkerCAD Projects Check out our Free IoT Projects Playlist - IoT Projects Check out our Free Home Automation Projects Playlist - Home Automation Projects Check out our Free NodeMCu Projects Playlist - NodeMCu Projects