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

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
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
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...
$8.25
In Stock
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.50
In Stock
WipperSnapper is BETA software

WipperSnapper is in beta and actively being developed to add functionality, hardware, and fix bugs.

We encourage you to try out WipperSnapper with the understanding that it is not final release software and is still in development.

If you encounter any bugs, glitches, or difficulties during the beta period, or in this guide, please file an issue on the Adafruit IO support page.

Sign up for Adafruit.IO

Adafruit IO is a platform designed by Adafruit to displayrespond, and interact with your project's data. You will need an Adafruit IO account to use the Adafruit.io Wippersnapper platform.

If you do not already have an Adafruit IO account set up, head over to io.adafruit.com to link your Adafruit.com account to Adafruit IO.

Install ESP32 USB Driver

First, install the SiLabs CP2104 Driver on your computer. This driver is required for your computer to communicate with the ESP32.

Enable Web Serial

We've developed a web-based tool for you to install WipperSnapper on your ESP32. This tool uses the Web Serial functionality of Google Chrome.

You will have to use the Google Chrome browser for this to work.

Safari, Firefox, and other browsers are not supported at this time because this tool requires Web Serial and only Chrome is supporting it to the level needed at present.

At this step, you'll need to enable the Serial API, which is really easy.

Visit chrome://flags from within Chrome. Find and enable the Experimental Web Platform features

Restart Chrome

Install WipperSnapper on ESP32

In the Chrome browser, visit the WipperSnapper NVM Tool website.

On the top right of the webpage, click the Connect button. You will get a pop-up with a list of USB devices. Select the USB port belonging to your ESP32.

You may want to remove all other USB devices so only the ESP32 board is attached, that way there's no confusion over multiple ports! 

The Javascript code will now try to connect to the ROM bootloader. It may timeout for a bit until it succeeds. On success, you will see that it is Connected and will print out a unique MAC address identifying the board.

Once you have successfully connected to the ESP32, a form will appear with a spot to enter your credentials.

To obtain your Adafruit IO credentials, navigate to the Adafruit IO WipperSnapper page and click "My Key". A modal will pop up with your Adafruit IO username and the active key.

Your network credentials are not saved to a server, this script is run locally on your browser.

Navigate back to the WipperSnapper ESP32 installation page and enter your network and Adafruit IO credentials.

Click Install WipperSnapper.

You should see WipperSnapper being flashed to your ESP32. Hang tight and stay on this tab, the process takes a little over a minute. Do not disconnect your ESP32 from USB until the installation has been completed.

Once the tool completes the installation, the top form will collapse and you'll see a message in the log indicating that the operation is complete.

Navigate to https://io.adafruit.com/wippersnapper and press the RESET button on your ESP32.

You should see a new modal pop-up with a picture of your ESP32! Give it a name and click Continue.

Congrats, your board is registered with WipperSnapper! The LED(s) or NeoPixel(s) will periodically flash to alert you that the board is still connected to Adafruit.io WipperSnapper.

Next, let's add some components to your board and start playing around! 

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 Trigger 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!

First, click the Create Trigger button.

Then, from the triggers page, click + New Trigger.

Select Reactive Trigger.

Click on the Select Trigger 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 2021-09-27 12:32:27 -0400.