Main Menu

Secondary Menu

Arduino Door Alarm

We were challenged to create a device with a useful application in our engineering STEM skills class at Governor's School for Science and Engineering 2017. This instructable will guide the reader through the process of making an Arduino controlled door alarm. This device will play a song when the designated microswitch is triggered. The device is encased in a wooden box to hide and protect from its outside environment.

Step 1: Materials and Tools

Materials

Arduino UNO

Breadboard

4 330 omega resistors

1 10K omega resistors

12 jumper cables

2 Female jumper cables

4 multicolored LED's

1 DICGU Microswitch

1 piezzo buzzer

1 Battery pack

4 AA Batteries

Arduino Computer Cable (To upload code)

Step 2: Preparation

Make sure that the Arduino Application is installed on your computer.

Find here: https://www.arduino.cc/en/Main/Software

Step 3: Making the Project: Wiring the Arduino

The first major step of the project is to connect each component in the correct corresponding location on the Arduino and breadboard.

There are five major steps to wiring the Arduino correctly:

Resistors

Cables

LEDs

Buzzer

Power

Step 4: Resistors

1. 10K Resistor

A. Place one end in H14 and the other in a "+"

2. 330 Resistor #1

A. Place one end in B3 and the other in any "-"

3. 330 Resistor #2

A. Place one end in B6 and the other in any "-"

4. 330 Resistor #3

A. Place one end in B9 and the other in any "-"

5. 330 Resistor #4

A. Place one end in B12 and the other in any "-"

Step 5: Cables

Each cable will have listed its two locations on the Arduino/breadboard.

GND to any "-"

5V to "+" on right

PIN 7 to E4

PIN 8 to G14

PIN 9 to J3

PIN 10 to E10

PIN 12 to E1

PIN 13 to E7

From 1 on switch to F14

From 3 on switch to any "-"

From any left "-" to any right "-"

Step 6: LEDs

There are four LEDs that can be employed if light is desired.

Blue LED

Positive (long leg) to C1

Negative (short leg) to C3

Red LED

Positive to C4

Negative to C6

Green LED

Positive to C7

Negative to C9

Yellow LED

Positive to C10

Short to C12

Step 7: Buzzer

This is the final step of the physical assembly.

Buzzer "-" to G1

Buzzer "+" tp G3

Right "-" to J1

Step 8: Power

A portable source of power is used to ensure that the project will not require a constant computer connection to stay running. A battery holder is attached to the Redboard. Then, four AA batteries are inserted, giving a constant power of about 6V.

Step 9: Making the Project: Coding

The following code gives the Arduino the ability to perform the intended task. This code is based of the Arduino tutorial for a buzzer. However, it also has included the code for lights and a designated song. Insert this code into an open Arduino page to insert the code for the project.

/******************************************************************

* SparkFun Inventor's Kit * Example sketch 11 * * BUZZER * * This sketch uses the buzzer to play songs. * The Arduino's tone() command will play notes of a given frequency. * * This sketch was written by SparkFun Electronics, * with lots of help from the Arduino community. * (This sketch was originally developed by D. Cuartielles for K3) * This code is completely free for any use. * Visit http://learn.sparkfun.com/products/2 for SIK information. * Visit http://learn.sparkfun.com/products/2 to learn about the Arduino. * * Version 2.0 6/2012 MDG * Version 2.1 9/2014 BCH *****************************************************************/

Step 10: Final

Compile the code on the computer. Then, send the code to the Arduino. Afterwards, disconnect the computer, allowing the device to depend on the battery source. If wanted, the device can be encased in a box. In several of our pictures, there are ideas where the device is in a capsule to protect it. However, this is not required for the purpose of the door alarm. This concludes the tutorial.