Always running around and forgetting whether or not you shut your door? Connect your Adafruit Huzzah32 board to the internet so you can always know if you left the door open! 

In this project, you'll wire up a reed switch door sensor to a Huzzah32 and then learn how to use Adafruit IO WipperSnapper capability to make a door alarm without any code! WipperSnapper is a really easy way to set up your device to interface with loads of sensors and devices and send it to Adafruit IO. From there, your possibilities are basically endless.

WipperSnapper is an interface for Adafruit IO, our incredibly easy-to-use IoT platform, designed to turn any WiFi-capable board into an IoT device without programming a single line of code. 

Simply load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.

From there, you can add components to your board such as buttons, switches, potentiometers, sensors, and more! Components are dynamically added to hardware without the need for re-programming your board.

Parts

Angled shot of rectangular microcontroller.
Aww yeah, it's the Feather you have been waiting for! The HUZZAH32 is our ESP32-based Feather, made with the official WROOM32 module. We packed everything you love...
$19.95
In Stock
Top view of magnetic contact switch with three screws.
This sensor is essentially a reed switch, encased in an ABS plastic shell. Normally the reed is 'open' (no connection between the two wires). The other half is a magnet. When...
$3.95
In Stock
5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable
Our all-in-one 5V 2.5 Amp + MicroUSB cable power adapter is the perfect choice for powering single-board computers like Raspberry Pi, BeagleBone, or anything else that's...
Out of Stock
 6 pack of Clear Adhesive Squares
UGlu Dashes are perfect for a variety of small projects. These adhesive squares provide a stronger bond to most surfaces and are cleaner and easier to...
$0.95
In Stock

The wiring for this project is very simple. With your ESP32 Feather connected to WipperSnapper, unplug it from your computer's USB port and solder one wire from the door switch to pin #27 and the other wire to the GND pin. This reed switch isn't polar, so you can hook either wire up to either pin.

I shortened the wires before attaching them. This isn't necessary, but I found it looked better.

Now that you've connected them, clip the ends of the pins off from the bottom of the board. This will help your board sit more flush against the doorframe or wall.

Now, put some UGlu dashes where you want to mount the sensor. I found that putting two on the side that has the wires and one to two on the other side, and then another 2 under the Huzzah32 worked best. 

After attaching the adhesive, stick the three parts to the door. I've found it works better if you put pressure on it for a good 15 or 20 seconds after initially putting it on the door or door frame. Make sure that the two sides of the sensor are close when the door is closed or the sensor will think it's always open.

Then, plug your power supply into the wall and into your Huzzah32.

Now, head back to the device page for your Huzzah32 and make sure that the device status says Online.

Now that you've wired everything up and added your board to WipperSnapper, it's time to set the sensor itself up.

From the device page, click + New Component.

Then, click on the Reed Switch.

Call it whatever you want. I chose to call it door, but anything else should work as well. Set Reed Switch Pin to D27, make sure that Specify Pin Pull Direction? is selected, and set it to Pull Up. Also make sure that Return Interval is set to On Change.

Project Usage

Now, as you open and close the door, you should see the grey box in the sensor box go from "Open" to "Closed."

Adafruit IO Action Setup

Now, you can set up Adafruit IO to send you an email when the door is opened.

This optional step requires an active Adafruit IO Plus account. If you do not have one, visit https://io.adafruit.com/plus to power-up your Adafruit IO Free account to Adafruit IO Plus!
Triggers were renamed to Actions in Adafruit IO.

First, click the Create Action button.

Then, from the actions page, click + New Action.

Select Reactive Action.

Click on the Select Action Feed dropdown and select the feed for the reed switch. It will be slightly indented and should be directly under the name of your device.

Next to Is, select equal to.

In the comparison value text box, put 1.

Next to Then, select email me (IO+ only).

In the final box, select the name of your component, and press create. 

Now, when you open the door, you should get an email within a second or two like the one in this screenshot.

This guide was first published on Oct 01, 2021. It was last updated on Mar 08, 2024.