My Projects > Arduino Door Alarm

Arduino Door Alarm

Technologies Used: C, Arduino Uno, Breadboard Circuitry

Project Summary:

This was my first completed individual ECE project here at Georgia Tech. For my ECE Discovery Studio class, we were tasked to complete any project which allowed us to dive into something in this field. For this "Discovery Project", I decided to build a door alarm buzzer. I chose to do this because of its practical application to Electrical and Computer Engineering, and because of the ability to iterate on this idea. When doing this project, I ran through many ideas and made some changes along the way. Here's the outline of the design process and how everything went:

EMPATHIZE & DEFINE:

First, I defined the project and end goal I was going for. Build a door alarm for a dorm room that sets off a buzzer when the door is opened and creates some sort of visual cue.

IDEATE:

Originally, I decided to utilize some sort of hardware state machine as I learned in my digital design course. I also wanted easy-to-use hardware that can also be physically implemented on the door. I started with a classic state diagram to get ideas flowing:

For easy hardware that can be easily implemented, I decided to go with an Arduino Uno Microcontroller, which is a universally used microcontroller that also had proper dimensions to be mounted on a door. I decided to use pushbuttons for the peripherals for the trigger.

PROTOTYPE:

Paying a visit to the Georgia Tech ECE maker space, the HIVE, I acquired an Arduino Uno, an SPST pushbutton, and a kit that contained a buzzer, a small breadboard, some LED lights I could use for the visual cues, and jumper wires.

Learning about the layout of the Arduino Uno, I learned I could utilize Digital I/O pins to get data from the button and send data to the LEDs and buzzer. I did some research online on how to implement a state machine on Arduino. I downloaded the Arduino development environment onto my laptop to get started programming this alarm. I saw that the Arduino uses C, which is a language I got a lot of exposure to in my programming for hardware and software systems course, ECE 2035. I saw this as an effective way to apply what I learned in my class, so I decided to revisit the IDEATE stage.

REVISITING IDEATE:

Realizing that Arduinos use C and many Arduino applications use that, I decided to switch my approach from using a state machine to programming it in C. This way, it's simpler, applies my knowledge from ECE 2035, and is in line with the industry standard for Arduino applications.

CONTINUING PROTOTYPE:

With my new approach, I read up on the documentation for Arduino. With that, I built a sample first program, where the buzzer was a Digital Output on Pin 12, a single LED was a Digital Output on Pin 8, and the pushbutton was a Digital Input on Pin 13. I used these pins for ease of wiring based on the physical implementation.

For the physical implementation, I built a basic breadboard circuit, where I had a pushbutton straddling the middle, a buzzer on another row, and an LED on another row. Based on the specifications for the components online, I also used resistors for the buzzer and SPST as required. I then wired the output of the SPST to the Arduino, the input of the buzzer to the Arduino, and the input of the LED to the Arduino. The Arduino also provided a +5V source which I wired to the breadboard and a Ground source which I also wired to the breadboard. The components were wired to vcc and ground as required. I realized during building that the LED row could have more connections going out of it in parallel, so I connected 3 more LEDs across the board to give power to all from one source. The final circuit looked like this:

With this, I wrote the logic for the system in C, and the program was ready to be tested:

The code above simply checks if the pushbutton is pressed, and if it is, it sets off a tone on the buzzer, and the lights receive a high digital voltage. If it's not, the buzzer has no tone and the lights receive a low digital voltage. It was then time to move on to the next step, testing.

TESTING

With the circuit, I needed a way to mount it to my door. I decided to put the breadboard with the pushbutton perpendicular to the door frame, and attach a stick from the door so when it opens, it hits the pushbutton, setting off the alarm. This was the setup I used to test the alarm:

Finally, with everything set up and a few changes of the stick positioning, so it would hit the button, the door alarm successfully worked.

DEMONSTRATIONS + EXPLANATION

FUTURE

There are still a lot of things that can be done to make this alarm better, which I hope to continue iterating on. First and possibly most obviously, the alarm physical implementation could be better. This could be achieved with a case and a better triggering system than a stick on the door. Electronically, this could be improved by having the alarm stay on forever until disarmed, adding more or more powerful buzzers, or extending the capabilities of the lights so they're brighter and more visible. All of these ideas have potential for my next iterations of this project which I hope to implement and make better over my time here at Georgia Tech.