Overview
Is someone sneaking into your lab or workshop? Are family members raiding your secret chocolate drawer? Are your colleagues taking all your shiny new Adafruit components without asking first?
Using Adafruit IO, you can get notified by Email or SMS (paid Adafruit IO plans only) when a door or drawer opens.
In this guide, you will create a door detector project by uploading Adafruit's open-source Wippersnapper firmware to a Raspberry Pi Pico WH, connecting it to Adafruit IO, and using the Adafruit IO web interface to add a door sensor component to your board. Next, you'll create a new Action on Adafruit IO to email you when the door opens. Finally, you'll customize and configure the Action to send a message to your inbox.
This project can be built without programming or soldering!
Required Parts:
The microcontroller board chosen for this project is the Raspberry Pi Pico WH, a powerful little beast with 2MB of flash and the RP2040 as the main processor. In addition, it comes with 2.4GHz Wireless networking support (the W in the model name), and pre-soldered pin headers (the H in WH).
Wippersnapper supports a wide variety of microcontroller boards, so feel free to try an alternative combination.
To complete the no-soldering promise, it's recommended to use a screw-terminal companion board for the pico:
Or if you prefer your own headers and the Terminal PiCowbell to require soldering, then pickup this one instead:
Next, the main star of the show is the humble Reed Switch, or Magnetic contact switch as it's commonly known.
A pre-wired magnetically activated switch in one piece, and a matching magnet in the other piece, this gives a really easy way to detect two surfaces meeting. It can be used for so many things, from the obvious door or window being open, to the more secretive hidden cupboard or interactive puzzle in an escape room; the limit is your imagination.
If they are out of stock then try a local retailer/distributer, DigiKey, or last resort grab some from Amazon (MC-38):
To power the system use a good quality USB Micro-B ended data cable. This is required for installing the firmware, be careful not to use a charge-only cable, but one can be used later during final physical deployment.
Alternatively the VSYS pin can accept 1.8volts to 5.5volts, which is internally used by the Switched-Mode Power Supply (SMPS) to generate the 3.3V for the RP2040 and its GPIO. To easily locate the VSYS pin look at the pin silkscreen labels on back of the Terminal PiCowbell (or check the pinout photos in the product learn guide).
For now, it's best to power the device with a mains-powered USB adapter to avoid worrying about battery recharging, but you could explore using a 3xAA battery case with switch and JST-PH 2 pin connector.
Page last edited May 14, 2025
Text editor powered by tinymce.
Assembly
Attaching the components is relatively straightforward; just be careful to align the rows of pins slowly together when mating the two boards. I find it easiest to rest one set first against their mating socket, not yet inserted, and then slowly lower the other half into place and verify that alignment, re-adjusting if necessary.
- Verify that the Pin labelled 1 on the Pico WH aligns with the Pin labelled 1 on the Terminal PiCowbell, then connect the boards together carefully (insert both pin rows at the same time with even force)
- The next steps require a small flat headed screwdriver (approximately 2mm)
- Attach one wire of the Magnetic Contact Switch to the screw terminal for Pin
GPIO 13(or chosen pin)
- Attach the other wire of the Magnetic Contact Switch to a ground pin terminal (labelled
GND)
If not using a USB cable to power the Pico, then wire your connector into the Terminal PiCowbell, for example the Male JST-PH 2-pin connector wires to VSYS and GND (do not connect the battery yet).
On the next page, the firmware (software) will be installed onto the microcontroller, and then afterwards move on to configuring the Wippersnapper device and switch component, and finally setup an automated Action to send the notification message.
Page last edited May 14, 2025
Text editor powered by tinymce.
Install WipperSnapper
What is WipperSnapper
WipperSnapper is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device without programming a single line of code. WipperSnapper connects to Adafruit IO, a web platform designed (by Adafruit!) to display, respond, and interact with your project's data.
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, so you can immediately start interacting, logging, and streaming the data your projects produce without writing code.
Sign up for Adafruit.io
You will need an Adafruit IO account to use WipperSnapper on your board. If you do not already have one, head over to io.adafruit.com to create a free account.
Add a New Device to Adafruit IO
Log into your Adafruit IO account. Click the New Device button at the top of the page.
After clicking New Device, you should be on the board selector page. This page displays every board that is compatible with the WipperSnapper firmware.
In the board selector page's search bar, search for Pico W. Pick either the Pico W or Pico 2W as needed.
Click the Choose Board button to bring you to the self-guided installation wizard.
Follow the step-by-step instructions on the page to install Wippersnapper on your device and connect it to Adafruit IO.
If the installation was successful, a popover should appear displaying that your board has successfully been detected by Adafruit IO.
Give your board a name and click "Continue to Device Page".
You should be brought to your board's device page.
Feedback
Adafruit.io WipperSnapper is in beta and you can help improve it!
If you have suggestions or general feedback about the installation process - visit https://io.adafruit.com/support, click "Contact Adafruit IO Support" and select "I have feedback or suggestions for the WipperSnapper Beta".
Troubleshooting
If you encountered an issue during installation, please try the steps below first.
If you're still unable to resolve the issue, or if your issue is not listed below, get in touch with us directly at https://io.adafruit.com/support. Make sure to click "Contact Adafruit IO Support" and select "There is an issue with WipperSnapper. Something is broken!"
First, make sure that you selected the correct board on the board selector.
Next, please make sure that you entered your WiFi credentials properly, there are no spaces/special characters in either your network name (SSID) or password, and that you are connected to a 2.4GHz wireless network.
If you're still unable to connect your board to WiFi, please make a new post on the WipperSnapper technical support forum with the error you're experiencing, the LED colors which are blinking, and the board you're using.
Try hard-resetting your board by unplugging it from USB power and plugging it back in.
If the error is still occurring, please make a new post on the WipperSnapper technical support forum with information about what you're experiencing, the LED colors which are blinking (if applicable), and the board you're using.
"Uninstalling" WipperSnapper
WipperSnapper firmware is an application that is loaded onto your board. There is nothing to "uninstall". However, you may want to "move" your board from running WipperSnapper to running Arduino or CircuitPython. You also may need to restore your board to the state it was shipped to you from the Adafruit factory.
Moving from WipperSnapper to CircuitPython
Follow the steps on the Installing CircuitPython page to install CircuitPython on your board running WipperSnapper.
- If you are unable to double-tap the RST button to enter the UF2 bootloader, follow the "Factory Resetting a WipperSnapper Board" instructions below.
Uploading this sketch will overwrite WipperSnapper. If you want to re-install WipperSnapper, follow the instructions at the top of this page.
Moving from WipperSnapper to Arduino
If you want to use your board with Arduino, you will use the Arduino IDE to load any sketch onto your board.
First, follow the page below to set up your Arduino IDE environment for use with your board.
Then, follow the page below to upload the "Arduino Blink" sketch to your board.
Uploading this sketch will overwrite WipperSnapper. If you want to re-install WipperSnapper, follow the instructions at the top of this page.
Factory Resetting a WipperSnapper Board
Sometimes, hardware gets into a state that requires it to be "restored" to the original state it shipped in. If you'd like to get your board back to its original factory state, follow the guide below.
Page last edited May 14, 2025
Text editor powered by tinymce.
Configure Wippersnapper
This guide page assumes that you have Wippersnapper installed, your board is Online, and you are currently looking at the boards Device Info page. If you need to locate the page, visit io.adafruit.com/devices and click on your board to be taken to the device page.
From the boards device page, use the New Component button to bring up the New Component dialog.
Wippersnapper supports a wide variety of components, currently over 100 input and output devices.
To quickly find your Magnetic Contact Switch, referred to as a 'Reed Switch' in the component picker, type Magnetic into the search bar, then select the Reed Switch component from the search results.
Now on the Create Reed Switch Component dialog, select the pin used for the switch e.g. GPIO 13.
Now select the On Change option for Return Interval, as opposed to Periodically (on a time schedule).
Finally select the checkbox for Specify Pin Pull Direction? and then choose Pull Up from the dropdown, followed by clicking the Create Component button. The dialog should look like the image below:
Now you'll be welcomed with the new component displayed on the boards device page.
Notice the graph symbol and settings cog in the top right of the component panel, click the first to be taken to the components feed page, and the second to go to the configuration options (Edit Component dialog).
You will probably find that the Closed and Open labels for the component are the wrong way compared to the current switch state. That's no problem, use the settings cog to reconfigure the reed switch component, and update the labels and icons to your preferred options.
The reason is that the default label for 0 volts (or a Low digital signal) is "Closed" assuming a Normally Closed switch, while it's recommended to do the the opposite (a Normally Open switch) as it's the one usually stocked.
Electrically this is connecting the reed switch between ground (0 volts) and the input pin (Pin 13), and the input pin has a pull up resistor enabled raising it up to 3 volts if nothing is attached. This means the input pin will sink to 0 volts when it becomes attached to ground as the switch is closed / activated (assuming a Normally Open switch).
At this point it's worth mentioning that a devices configuration can be exported (then those exports can be imported by other users even on a different device), or use the new Magic-Config option to automatically configure any components built-in to your microcontroller board (like the built in button and LED).
You can find each of these options under the Auto Config button at the top of the device page.
Here I've exported the config for my device. Notice the icon names are actually font-awesome glyphs!
{
"exportVersion": "1.0.0",
"exportedBy": "tyeth_demo",
"exportedAt": "2025-05-02T17:08:03.857Z",
"exportedFromDevice": {
"board": "rpi-pico-w",
"firmwareVersion": "1.0.0-beta.100"
},
"components": [
{
"name": "Reed Switch",
"pinName": "D13",
"type": "reed_switch",
"mode": "DIGITAL",
"direction": "INPUT",
"period": 0,
"pull": "UP",
"isPin": true,
"visualization": {
"offLabel": "Open",
"offIcon": "fa6:solid:door-open",
"onLabel": "Closed",
"onIcon": "fa6:regular:door-closed"
}
}
]
}
Now that you have the contact-sensor wired up and sending data to Adafruit IO, you can move on to creating an automated reactive Action to send you a notification when the sensor is triggered.
Page last edited May 14, 2025
Text editor powered by tinymce.
Create an Action
Visit the Actions page on Adafruit IO, using the navigation menu at the top (or "burger" menu in the top left of a smaller display).
Click the button to create a New Action.
A dialog will pop up.
Give your action a Name for your action, along with an optional Description.
Click the Create button to set up your action.
Why should I give my action a name and description?
- Both of these will be displayed in the actions list, along with being used for searching/filtering actions in the list.
- Notice how my actions without descriptions in the screenshot above are very unclear as to their exact functionality. Don't make the same mistake!
- We support an extended character set, so feel free to use emojis ⁉️
Once created, you'll be forwarded to the Edit Action page.
From here you'll add the required trigger block(s) in the top section of the diagram (labelled Triggers: on the main "root" block in the diagram), followed by the main actions blocks in the Actions section of the diagram (labelled Actions: on the main root block).
Once the diagram has been altered then the additional option for Save changes appears, and the Run Now button will become the Save and Run button.
Finally by running the Action using the Run Now button you will see if everything is working as intended, and it also gives some useful information to help diagnose any issues with your action diagram (like previous outputs).
Triggers are important for two reasons. First, they define the condition(s) to match that cause the action to fire.
Second, actions have a cooldown period. So every time an action matches the trigger, it's action blocks are executed and then the cooldown is activated (currently 5 seconds), at which point the trigger conditions will be ignored until the cooldown period is over.
Triggers themselves don't affect the cooldown period, and therefore it makes more sense to have any pre-requisite conditions of your automation (like a dial changing to a certain position) in the trigger section of the diagram.
If you do it the other way with the trigger matching any data, and then have your condition in the main action body instead of the trigger section, it results in rapid trigger events being ignored if they come within 5 seconds of the last event.
Now you've understood the why, it's time to look at how...
Pick the Triggers category from the toolbox / side panel. The first trigger is for scheduled actions, and using the Blue bordered Cog button can be adjusted from "Every" to "At" (for a specific minute/hour etc). The next two should be obvious, as a new data point comes in to a feed that you select it will trigger the action, and then if a feed matches a certain value in the second case.
The main trigger worth reading about / explaining for this project is the third data related one, which offers the Starts drop-down, where I've moused-over (hover) to show the tooltip. It allows you to trigger based on the previous value compared to the new incoming one.
The last two blocks are for the conditions, the first (blue background) is for numerical comparisons, and the final one (teal green background) is for comparing text values (notice the paragraph block). Use these with the trigger blocks that require them (swap numeric with text blocks if needed).
Setting up the Trigger
You will want to select (click on) the trigger block that says When [ Feed ] gets data matching [ = [ 0 ]] and it will collapse the toolbox and the block will be on the diagram.
Move it into position (click and drag) to get in into the top Triggers: section of the root block in the diagram.
Use the Feeds dropdown inside the trigger block you've placed to select the Feed name that matches your Wippersnapper Device and Reed Switch component (if you only have one feed it will be selected already).
Change the number conditional, enter the value 1 in the value box (assuming your switch sends the value of 1 when the door contact switch opens - otherwise use zero) and leave the operator selected on Equals (=).
Setting up the Notification Block
There are currently three ways to send a notification from Adafruit IO:
- via an email to the address registered (and verified) in your Adafruit account settings
- via a text message (SMS) to your registered and verified phone number (settings -> services)
- and finally using a webhook to a third-party service (sends a message to a web server).
The SMS option is reserved for paying customers of Adafruit IO (and phone numbers in the USA and Canada only). The IO+ paid upgrade to Adafruit IO offers far more generous limits along with additional Power-Ups like SMS's and Apple WeatherKit® (available as a block in the Weather section).
Grab (click and drag) the Email block from the Notifications section of the toolbox/side panel, and drop it into the Actions: section of the main "root" block. It should lock into place and no longer be greyed out once correctly situated. The child blocks will stop being "shadow" blocks (dimmed) when they get a value populated.
The Email block is initially composed of template blocks shown by the double opening curly braces {{, with text or paragraph blocks nested inside the template blocks.
This allows variables and other things to be substituted for placeholders, for example using {{ user.name }} would be replaced with your name. You can try sending an email (or use the Log block under the Utility category) with {{user}} and {{feeds}} and {{vars}} in the email body as a template to see the available options.
Enter a subject and body for the email, anything that feels appropriate, maybe try using the placeholders...
Notice the template blocks (denoted by the {{ label) have become solid now, along with the string block denoted by ", and paragraph block supporting multiple lines denoted by the P block label.
Click the Save button to update the Action, when asked just choose Enable and Save.
When you first create an action, it will be disabled / turned off. This is to protect you (and us) from accidentally leaving under-construction actions running, imagine an accidental rocket launch!
The first time the action is saved, you'll be asked if you wish to enable the action at the same time, alternatively, it can be toggled on and off from the Actions list page.
Running the Action and Seeing the Output
Using the Save and Run button, or Run Now button, causes a forced run to immediately take place.
This skips the triggers entirely (no waiting for a trigger to receive data, or slow schedules)!
A results dialog is presented showing the the output of the action, along with a few previous runs.
Click the Run Now button and the action should report the output, in addition to sending your email!
Now return to the Actions list page and find your action in the list.
Click on the information icon at the end of the row to view more details about the Action's last run.
Page last edited May 14, 2025
Text editor powered by tinymce.
Usage
This should be a relatively quick final testing process as the action has already been tested.
I like to have either the Wippersnapper device page open (so I can see it's components and status), or the feed page for the switch, or both! Sometimes the IO pages get stale (they use a live connection) so it's a good idea to refresh the tab/window if it's been open for a while or isn't showing data.
Then open the door (or whatever) to trigger the magnetic contact switch, then watch the status change on the device page and a new data point arriving on the feed page.
Very shortly afterwards an email will be winding it's way into your inbox, it can take a few seconds for the phone to check for new emails (as you can see below in the video), but expect that ping momentarily...
Your work here is done, nice one!
Maybe it's time to look through the Wippersnapper Essentials pages for your board!
You can find a handy Docs link beneath each board on the main Devices page.
Alternatively you could explore some crazier ideas with Actions on Adafruit IO.
Have a look at some of the other projects we have available on Learn.adafruit.com for inspiration, or checkout some community Playground notes.
Troubleshooting 🔬
These kinds of Actions are relatively new for Adafruit IO, so if you run into trouble, have a quick go at troubleshooting yourself and then pop over to the forums and let us know as much as you can tell us about the issue.
If I were you, I would probably duplicate the action in a new one (disabling the first one) and see if it works, then, also adding data manually to trigger it, failing that, break the problem (and action) down into smaller chunks.
Check the logs from the Run Now button inside the Edit action page, and use the information (ℹ️) button on the Actions list page for a more detailed overview. See the end of the previous page for details.
Lastly, also verify the hardware and expectations with a multimeter!
Page last edited May 14, 2025
Text editor powered by tinymce.