---
title: "Arduino Door Alarm With Text Alerts"
url: "https://maker.wiznet.io/nagamma06/projects/Arduino-Door-Alarm-With-Text-Alerts/"
markdown_url: "https://maker.wiznet.io/nagamma06/projects/Arduino-Door-Alarm-With-Text-Alerts/md"
type: "UCC: User Created Content"
author: "nagamma06"
author_url: "https://maker.wiznet.io/nagamma06/"
original_author: "nagamma06"
original_url: "https://www.instructables.com/Arduino-Door-Alarm-With-Text-Alerts/"
published: "2022-04-03"
language: "en"
hardware: ["Arduino UNO", "Arduino Uno Ethernet Shield", "LEDs", "SPST Switches", "Momentary Push Button", "LCD Screens", "Passive Buzzer", "Magnetic Reed Switch"]
likes: 0
views: 181
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Arduino Door Alarm With Text Alerts

> Arduino Door Alarm With Text Alerts

Original author: nagamma06 (source: https://www.instructables.com/Arduino-Door-Alarm-With-Text-Alerts/)

## Components

- **Arduino UNO** x 1 ([docs](https://www.farnell.com/datasheets/1682209.pdf))
- **Arduino Uno Ethernet Shield** x 1
- **LEDs** x 3
- **SPST Switches** x 2
- **Momentary Push Button** x 1
- **LCD Screens** x 2
- **Passive Buzzer** x 1
- **Magnetic Reed Switch** x 1
- Software: **twilio.com**

## Article

## Step 1: Set Up Arduino Uno and Breadboard

[![Set Up Arduino Uno and Breadboard](https://content.instructables.com/ORIG/F1I/AQV1/JASJLNHQ/F1IAQV1JASJLNHQ.jpg?auto=webp&frame=1&width=834&height=1024&fit=bounds&md=9d41ce09fbf215898e367605e7bd8963)](https://content.instructables.com/ORIG/F1I/AQV1/JASJLNHQ/F1IAQV1JASJLNHQ.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=9d41ce09fbf215898e367605e7bd8963)

## Step 2: Add the Ethernet Shield

[![Add the Ethernet Shield](https://content.instructables.com/ORIG/FES/QA1U/JASJLNHI/FESQA1UJASJLNHI.jpg?auto=webp&frame=1&width=834&height=1024&fit=bounds&md=67686a13652e2dfc8d426f4f29ed4a49)](https://content.instructables.com/ORIG/FES/QA1U/JASJLNHI/FESQA1UJASJLNHI.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=67686a13652e2dfc8d426f4f29ed4a49)

Plug the Ethernet Shield into the top of the Arduino.

## Step 3: Connect the Power and Ground Rail

[![Connect the Power and Ground Rail](https://content.instructables.com/ORIG/FLM/NJ86/JASJLNHA/FLMNJ86JASJLNHA.jpg?auto=webp&frame=1&width=800&height=1024&fit=bounds&md=0fe565a04993ae1c03090b0d210d9f24)](https://content.instructables.com/ORIG/FLM/NJ86/JASJLNHA/FLMNJ86JASJLNHA.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=0fe565a04993ae1c03090b0d210d9f24)

Connect the power rail to the 5v pin and the ground rail to the ground pin on the Arduino

## Step 4: Connect the Reed Switch

[![Connect the Reed Switch](https://content.instructables.com/ORIG/F83/46OK/JASJLNFU/F8346OKJASJLNFU.jpg?auto=webp&frame=1&width=866&height=1024&fit=bounds&md=3ee3c045f05ace4ab6ccda40a2d37f7c)](https://content.instructables.com/ORIG/F83/46OK/JASJLNFU/F8346OKJASJLNFU.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=3ee3c045f05ace4ab6ccda40a2d37f7c)

Connect the COM terminal on the switch to the ground rail and the Normally Open (NO) terminal to pin 8 on the Arduino

## Step 5: Add the LEDs

[![Add the LEDs](https://content.instructables.com/ORIG/FJ5/O4SZ/JASJLNEH/FJ5O4SZJASJLNEH.jpg?auto=webp&frame=1&width=866&height=1024&fit=bounds&md=648655823a56f8c2430d81a5b1bef839)](https://content.instructables.com/ORIG/FJ5/O4SZ/JASJLNEH/FJ5O4SZJASJLNEH.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=648655823a56f8c2430d81a5b1bef839)

Connect a red, yellow, and green LED to the ground rail and a resistor to each positive lead of the LED and connect the red one to pin 6, the yellow to pin 5, and the green to pin 4.

## Step 6: Add the Buzzer

[![Add the Buzzer](https://content.instructables.com/ORIG/FTS/LOK4/JASJLNEG/FTSLOK4JASJLNEG.jpg?auto=webp&frame=1&width=840&height=1024&fit=bounds&md=43e266eb57f3a6dd6faea50a3ff13a7b)](https://content.instructables.com/ORIG/FTS/LOK4/JASJLNEG/FTSLOK4JASJLNEG.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=43e266eb57f3a6dd6faea50a3ff13a7b)

Connect the negative pin of the buzzer to the ground rail and the positive pin to pin 12 on the Arduino.

## Step 7: Connect the Switches

[![Connect the Switches](https://content.instructables.com/ORIG/FX1/F4S4/JASJLND0/FX1F4S4JASJLND0.jpg?auto=webp&frame=1&width=840&height=1024&fit=bounds&md=a76be32a93cf2d00a37fae0992bea6de)](https://content.instructables.com/ORIG/FX1/F4S4/JASJLND0/FX1F4S4JASJLND0.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=a76be32a93cf2d00a37fae0992bea6de)

Connect the switch for the message toggle to pin 11 and the switch for the sound toggle to pin 10. Connect the other leg on the switch to the ground rail for each switch.

## Step 8: Add the Push Button

[![Add the Push Button](https://content.instructables.com/ORIG/FUR/NY1D/JASJLNBK/FURNY1DJASJLNBK.jpg?auto=webp&frame=1&width=840&height=1024&fit=bounds&md=df5b82a7e589261337e05e3e956e54a8)](https://content.instructables.com/ORIG/FUR/NY1D/JASJLNBK/FURNY1DJASJLNBK.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=df5b82a7e589261337e05e3e956e54a8)

Connect one leg of the button the ground rail and the other to pin 2 on the Arduino.

## Step 9: Connect the First LCD Screen

[![Connect the First LCD Screen](https://content.instructables.com/ORIG/FJ5/0QB8/JASJLNB1/FJ50QB8JASJLNB1.jpg?auto=webp&frame=1&width=840&height=1024&fit=bounds&md=37664b4dcc196b7aa11e9537fdd398c3)](https://content.instructables.com/ORIG/FJ5/0QB8/JASJLNB1/FJ50QB8JASJLNB1.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=37664b4dcc196b7aa11e9537fdd398c3)

Connect the VCC pin to the power rail, the GND pin to the ground rail, the SCL pin to A5, and the SDA pin to A5 on the Arduino.

## Step 10: Add in the Second LCD Screen

[![Add in the Second LCD Screen](https://content.instructables.com/ORIG/FIG/C7U2/JASJLN9H/FIGC7U2JASJLN9H.jpg?auto=webp&frame=1&width=952&height=1024&fit=bounds&md=c78a831c330a5ff3bb241dd745c7be91)](https://content.instructables.com/ORIG/FIG/C7U2/JASJLN9H/FIGC7U2JASJLN9H.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=c78a831c330a5ff3bb241dd745c7be91)

Connect the LCD screen to the same rail as the first one.

## Step 11: Mount the Reed Switch

[![Mount the Reed Switch](https://content.instructables.com/ORIG/FYA/8K6T/JASJLKCY/FYA8K6TJASJLKCY.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=a31b8fc498885cc8de2b7230252683ff)](https://content.instructables.com/ORIG/FYA/8K6T/JASJLKCY/FYA8K6TJASJLKCY.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=a31b8fc498885cc8de2b7230252683ff)

Put the piece with the terminals on the frame of the door. Place the magnetic portion to the door right under the switch so it will still toggle the switch. You can use a multimeter or listen to see if the switch activates when the door is opened or closed.

## Step 12: Upload the Code

Upload the code to the Arduino.

### Attachments

- [![download {{ file.name }}](https://content.instructables.com/static/image/file.default.gif)ArduinoDoorAlarm.ino](https://content.instructables.com/ORIG/FG4/8UXN/JASJLYMN/FG48UXNJASJLYMN.ino)
  [Download](https://content.instructables.com/ORIG/FG4/8UXN/JASJLYMN/FG48UXNJASJLYMN.ino)

## Step 13: Set Up the Alert Messages

First create a?[twilio.com](http://twilio.com/)?account, you can use the free version. Just create a project and a phone number and write down the Account SID and Auth Token. Upload the Twilio PHP Master to your web server from?<https://packagist.org/packages/twilio/sdk> Upload the alert.php code to the same directory. You will have to change the file extension to remove the .txt from the end. Open the script and change lines 10 and 11 to the Account SID and Auth Token. Change line 17 to your phone number and line 20 to the phone number you got from Twilio. Change line 22 to the text that you want to receive.

### Attachments

- [![download {{ file.name }}](https://content.instructables.com/static/image/file.default.gif)alert.php.txt](https://content.instructables.com/ORIG/FI6/ON6X/JASJM1PA/FI6ON6XJASJM1PA.txt)
  [Download](https://content.instructables.com/ORIG/FI6/ON6X/JASJM1PA/FI6ON6XJASJM1PA.txt)

## Step 14: Use the Alarm

[![Use the Alarm](https://content.instructables.com/ORIG/FJN/93FZ/JASJLK36/FJN93FZJASJLK36.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=588abb2b9337e356f9eb12415c6741b4)](https://content.instructables.com/ORIG/FJN/93FZ/JASJLK36/FJN93FZJASJLK36.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=588abb2b9337e356f9eb12415c6741b4)

Set the switches to if you want to receive an alert text or have the alarm sound and arm the system with the push button. When the door is opened, the alarm will go off until the button is pressed to reset the system.

---

Source: https://maker.wiznet.io/nagamma06/projects/Arduino-Door-Alarm-With-Text-Alerts/
