Introduction: TfCD Door Alarm

Picture of TfCD Door Alarm

Hello! This Instructable will teach you how to set up a door alarm that sends you a notification if someone opens your door, using the IFTTT (If This Then That) service. The notification will be sent to any device with the IF app installed.

What you'll need:

  • WeMoS D1 Mini
  • Hall Effect sensor
  • Arduino
  • Neodynium magnet
  • Cables
  • Computer

And also:

  • ESP8266 libraries
  • Arduino knowledge
  • An IFTTT account and connection to Maker channel from within IFTTT
  • IF app

Step 1: Step 1: Connecting Components

For this project, you'll need the following connections:

(Hall Effect) + -> (WeMoS) 3V3

(Hall Effect) - -> (WeMoS) GND

(Hall Effect) S -> (WeMoS) D5

Step 2: Step 2: Creating a Recipe

With your IFTTT profile connected to the Maker channel, you will be able to access your own unique secret maker key. Save this for later, it'll be needed for the Arduino sketch!

Create a recipe

  1. Click on "This"
  2. While in the Maker channel, click on "Receive a web request"
  3. Type "ESP" in the event name text box
  4. Click "Create Trigger"
  5. Click on "That" and select "IF Notification"
  6. Click "Send a notification"
  7. In the notification text box, type "Your door is {{Value1}}"
  8. Click "Create action", followed by "Create recipe"

And you're done! Your device with the IF app installed can now receive notifications whenever this recipe is triggered.

Step 3: Step 3: Firmware Setup

You'll need to install the ESP2866 library to upload to the ESP from the Arduino. To do that, you can follow the instructions found here.

You can find the sketch you need here, written by yours truly. To make it work, you'll have to change a few constants according to your own data:

const char* SSID= "YOUR SSID";
const char* PASS= "YOUR PASSWORD";

And IFTTT-specific definitions:

const char* IFTTT_URL= "maker.ifttt.com";

const char* IFTTT_KEY= "YOUR IFTTT_KEY";

const char* IFTTT_EVENT = "YOUR_IFTTT_EVENT";

Step 4: Step 4: Uploading the Sketch

The sketch is easily uploaded, but some settings have to be changed from standard Arduino boards.

  • Board: WeMoS D1 Mini
  • Flash Size: 4M (3M SPIFFS)
  • CPU Frequency: 80 MHz
  • Upload Speed: 921600

You might need to reset the ESP to place it into flash boot mode, allowing you to upload the sketch. And then you're set!

Step 5: Step 5: Set Up the Physical Components

Picture of Step 5: Set Up the Physical Components

Now you attach the physical parts to your door frame. We've done it with duct tape in the photos, but obviously you can use a more elegant solution.

Attach the magnet to the door and the sensor and board to the frame, as shown in the photos.

Step 6: Step 6: Try It Out!

Picture of Step 6: Try It Out!

You're done! Test your creation and tweak it further! Good luck!

Comments

Swansong (author)2016-12-21

Looks good! I hope you get an A on your project :)

About This Instructable

330views

6favorites

License:

More by liolss:TfCD Door Alarm
Add instructable to: