Smart Dog Door Sensor/Alarm
I have two tiny, awesome, and less than optimally potty-trained dogs running around my house. While the little rascals have free reign to terrorize most of my home, we have put a dog fence preventing them from entering my carpeted basement. Sadly, this door has been left open for too long in the past, allowing the dogs to invade. To counter this, I added a sensor to the dog door that alerts me when it has been left open for more than 45 seconds. For added flare, I added an additional function to the door, which can be triggered from my phone, called alarm_mode. In alarm_mode, the door alerts me immediately when it's open, which will inform me that someone is entering the basement.
Supplies
- Argon
- Breadboard
- Hall Sensor
- Tape or Hot Glue
- Neodymium Magnet
Setting Up the IFTTT App
We're going to set up our IFTTT account, which is how we will be receiving notifications on our phone from our Argon.
- Head over to this link and follow the steps to make your account
Dog Door Left Open App
- Go to this link to create your first app
- Click on "If This"
- Search for "WebHooks"
- Click on WebHooks
- Click on "Receive a web request"
- Under Event Name, type "door_left_open"
- Click Create Trigger
- Click Then That
- Search for "notifications"
- Click on Notifications
- Click on "Send a notification from the IFTTT app
- Under Message, type "You left the dog door open"
- Click Create Action
Alarm Triggered App
- Go to this link to create your first app
- Click on "If This"
- Search for "WebHooks"
- Click on WebHooks
- Click on "Receive a web request"
- Under Event Name, type "opened_alarm_on"
- Click Create Trigger
- Click Then That
- Search for "notifications"
- Click on Notifications
- Click on "Send a notification from the IFTTT app
- Under Message, type "Alarm Triggered"
- Click Create Action
- Click Continue
Getting Your IFTTT Key
Next, we are going to get our unique IFTTT key.
- Go to this link
- Click on documentation
- Your key will be at the top of the page
- Save the key for future use
Start a Particle Project
If you don't already have a Particle account, you can create one here
- Click on Argon/Boron
- Click on Argon Wi-Fi + Mesh
- Follow Instructions to finish setting up your device.
Next, we'll create the project that the Argon is going to be running
- Click here to start a new project
- Enter a title under "Current App" (For the example I called it Instructables_Dog_Door)
- Copy and paste the code from this Google Doc into the project
Set Up Particle Webhooks
We are going to set up the WebHooks that will allow our Argon to talk to our phones.
First, we are going to set up our Alarm WebHook:
- Click on this link to make a new Particle WebHook
- In the Event Name Box, type "Alarm_Triggered"
- In the URL Box, copy the url below into the box
- https://maker.ifttt.com/trigger/opened_alarm_on/json/with/key/YOURKEY
- IMPORTANT: Instead of writing "YOURKEY", write down the IFTTT access token that we created in Step 2.
- Click the "Create Webhook" button
Secondly, we have to set up our Door_Left_Open WebHook
- Click on this link to make a new Particle WebHook
- In the Event Name Box, type "Door_Left_Open"
- In the URL Box, copy the url below into the box
- https://maker.ifttt.com/trigger/door_left_open/json/with/key/YOURKEY
- IMPORTANT: Instead of writing "YOURKEY", write down the IFTTT access token that we created in Step 2.
- Click the "Create Webhook" button
Create Your Unique Particle Access Token
Next, we'll generate a unique access token that will (later on) allow us to talk to our Argon through the IFTTT App
- Go to this link
- Scroll until you see the Create a token (browser-based)
- Type in your username and email in the text box
- IMPORTANT: In the "Expires In" box, select "Never" from the drop down menu
- Click the "Create token" button
- Write down the access token for later use
Create the Final IFTTT App
We're going to head back over to the IFTTT Create Page
- Click on "If This"
- Search for "Shortcuts"
- Click on iOS Shortcuts
- Click on "Shortcut automation started" //everything below needs to be changes
- Click Then That
- Search for "Webhooks"
- Click on Webhooks
- Click on "Make a web request"
- Under url, type "https://api.particle.io/v1/devices/DEVICE_ID/toggle/?access_token=ACCESS_TOKEN"
- Instead of "DEVICE_ID, type in your unique Argon device ID
- To Find Device ID, go to here
- Click on the devices button in the bottom left corner
- Click on your username
- Instead of "ACCESS_TOKEN", type in your unique particle access token we recorded in Step 5
- Click Create Action
- Click Continue
- Name the App Toggle
Setting Up Your Phone
- Install the IFTTT App
- Head over to the Shortcuts App
- Click the plus in the top right corner
- Click on Add Action
- Search for IFTTTT
- Click on "Trigger Applet"
- Select Toggle
The Easy Part
At this point, all the backend nonsense is complete. Now, we just gotta plug some things in.
Adhereing Breadboard to Dog Door
For our final step, we have to attach our machine to the door.
- Using either tape or glue, adhere the machine to the dog door frame
- Tape the Neodymium Magnet to the bottom left corner of the door
- Tape the PIR Sensor facing upwards directly under the magnet
Enjoy Using Your New Dog Door
Action at 00:48