Introduction: Arduino IR Home Alarm System

This project is to make an alarm system using an Arduino Uno and various other components. The function of the keypad is to arm after entering a passcode. When the IR beam is broken the alarm will go off and not stop until the correct passcode is entered. When leaving to re-arm simply enter the passcode to arm it. The passcode could also be changed if anyone has figured out the passcode. 

Supplies

Supplies:

·        (1) Arduino uno

·        (1) Piezo speaker buzzer

·        (1) Power rail

·        (1) 9v barrel to battery clip

·        (1) 9v battery

·        (1) Adafruit 3 x 4 telephone style keypad

·        (1) I2C LCD screen

·        (1) IR break beam sensor

·        (5) Extension wires (female to male)

·        (4) Velcro squares

·        (2) Hot glue stick

·        (1) Hot glue gun

·        (1) 3D printer

·        (1) 3D Printer Filament 

Step 1: Code

The final code for the alarm system can be found below.

Step 2: 3D Printed Parts

This project only required 2 printed parts. The STL files can be found below, I decided to use PLA in my printed parts. Don’t forget to generate the supports in the slicer program you’re using. The picture is the baseplate being printed. the pictures shown are what the 2 parts will look like.

Step 3: Assembly

The assembly of the alarm system is as follows.

1.      Attach wires to the I2C LCD, Keypad, and piezo speaker.

2.      Place LCD, keypad, and speaker in cover. (See first picture)

3.      Place Arduino on cover.

4.      Place power rail inside the cover on the left wall, below the hole for the IR break beam wires

5.      Wire the ground and 5v to the power rail.


6.      Connect LCD: on the back of LCD are 4 pins (GND, VCC, SDA, SCL), connect the GND to ground on the power rail and the VCC to 5v on the power rail. SDA gets wired to analog pin A4, and SCL gets wired to analog pin A5.


7.      Connect the Keypad: Looking at the back of the keypad, with the pins at the top going from left to right:

  •       First pin: un-used
  •       Second pin: connected to digital pin 2.
  •       Third pin: connected to digital pin 3.
  •       Fourth pin: connected to digital pin 4.
  •       Fifth pin: connected to digital pin 5.
  •        Sixth pin: connected to digital pin 8.
  •       Seventh pin: connected to digital pin 9.
  •       Eighth pin: connected to digital pin 10.

8.    Connect Piezo speaker: connect the ground wires to ground on the power rail and connect the other to digital pin 7. (see Second Picture)

9.      Attach extension wires to IR break beam sensor: find length needed for specific use and trim wires accordingly and attach to the IR break beam sensor.

10.  Connecting the IR break beam sensor: wire the ground from the sensor to the ground on the power rail and the positive to the 5v on the power rail. Next connect the sensor wire to digital pin 12. Make sure the 2 sensor ends are outside of cover, so it can be attached to door, drawer etc... (See third picture)

11.  Connect the 9v to the battery clip and attach it to the Arduino to test all components to see if they work correctly once they’ve all been tested, disconnect power from the Arduino board.

12.  Once everything is connected and has been tested take any adhesive of your choosing, I chose Hot glue and glued down the speaker, LCD, and the keypad.

13.  To connect the Arduino, put Velcro on the bottom and in the slot on the cover to hold it down so that it can be removed in the future if needed. Make sure the Arduino has the barrel jack connected and that the battery is disconnected from the battery clip.

14.  9v battery: put Velcro on battery and slot for battery in the case. I put Velcro on the back of the 9v so that in the process of assembly it won’t come off and is easily replaceable. finishing up the assembly of the cover (See last picture)

15.  Mounting: Once you are confident in the wiring connections and the adhesive, attach the baseplate to the wall or flat surface you plan on putting the alarm system. You can use mounting tape or the holes for screws. Once the baseplate is secured, connect the battery clip to the battery and slide the cover over the baseplate onto the grooves.

Step 4: Video

This is the final product and a video of the Alarm system working. the first video shows arming the alarm, tripping the alarm and lastly deactivating it. The second video shows resetting the password, remember that can only be done when the alarm is not armed.