Introduction: Notification Flag - Great Intro to Wi-Fi, IFTTT & Huzzah ESP8266
I am always missing important things ... so I created Flag. An Internet of Things (IoT) device to notify or remind me of these important things!
Now with a quick glance over to my desk I can see if ...
- I have an email
- I was mentioned in a tweet
- I have an upcoming google calendar event
- It's time to call mum
- My team scored
- I forget to eat
- I need to exercise
...or almost anything else. For this Instructables I will be notifying myself when I receive emails.
This is project is a great introduction to Wi-Fi connected devices and the Internet of Things.
We will be using...
IFTTT.com (an API gateway) to trigger...
io.adafruit.com (an IoT cloud data service) to trigger...
MQTT (the connection between the internet and your board) to trigger...
Feather Huzzah (an Arduino compatible WIFI microcontroller) to trigger...
A servo motor which will...
Notify us!
Step 1: Required Components
For the low low price of only $37.50 or less!
You will need...
Materials:
Micro Servo $10
Pushbutton $1
Resistor (any value)
Tiny Breadboard $4 (or protoboard)
Jumper Wires $2
Project Box $3.50
Lithium Battery (optional)
Velcro (optional)
A Little Flag (we will make this)
Tools:
Computer with Arduino IDE installed
Soldering Iron and Solder
Large and Small Philips Screw Drivers
Scissors
Glue Stick
Wire Cutters
Desktop Printer
Step 2: Setup Huzzah for Arduino IDE and Connect to WIFI
To get started lets test our microcontroller.
Follow this tutorial from Adafruit: https://learn.adafruit.com/adafruit-feather-huzzah...
This tutorial will allow us to use the Feather Huzzah on the Arduino IDE and ensure we have all the necessary USB drivers installed.
Step 3: Signup to Io.adafruit & IFTTT
To trigger the wifi microcontroller we will be using Adafruit's io.adafruit and IFTTT.
Create an io.adafruit account and setup a new switch labled flag.
Create a new dashboard.
Create a toggle switch in the dashboard labled 'flag'. Leave the default settings for the toggle ON and OFF (we will refrence this text in the code so take note of character case).
Create an IFTTT (If-This-Then-That) account
Under the 'My Applets' tab select a new applet.
Under 'IF' choose an IFTTT trigger to raise your flag.
Under 'THAT' search Adafruit and reference the io.adafruit toggle switch you created earlier.
You can test your trigger by checking the toggle switch on your io.adafruit page. We will be communicating the position of this toggle with our Huzzah Wi-Fi board.
Step 4: Connect to Your Huzzah to Io.adafruit
To connect your Huzzah to your io.adafruit account we will need to use MQTT.
Follow this tutorial: https://learn.adafruit.com/mqtt-adafruit-io-and-yo...
Following this tutorial will ensure we have all the necessary libraries installed.
Step 5: Circuit Diagram
Construct the circuit illustrated to connect the servo and momentary button to the Huzzah board.
The momentary switch may require soldering. This is a good tutorial if you are new to soldering.
The resistor can be any value.
Step 6: Program Your Huzzah
The code we are using is based on Adafruit's ESP8266 sample code. I have divided it into relevant sections if you need to modify it for your project.
Remember to replace the text in the code containing your:
- Wifi network name
- Wifi network Password
- io.adafruit username
- io.adafruit key (this can be found on your io.adafruit dashboard as pictured)
Attachments
Step 7: Make a Flag
Download the flag image above. Print, fold, glue, cut and attach your flag to the servo with the screw included in the servo pack.
Or even better ... Use the illustrator file to create your own notification flag unique to your IFTTT trigger. Please share if you do!
Step 8: Enclose Your Circuit
Enclose your circuit in a container of your choice.
I used this project box from radioshack and drilled holes to hold the servo and button. Use callipers to measure the size of the components and drill appropriately sized holes.
In order to fit the components inside the small box I replaced the breadboard with a tiny protoboard and soldered the leads. This isn't necessary depending on the size of your enclosure
Please share the enclosure you make with me! Or If you 3D print an enclosure please upload the file and I will include it in the Instructable.
Step 9: Done!
You're done! Stick your Flag to the back of your computer, to the fridge, sit it on your desk or wherever ... and never miss anything important again!
Let me know what you use Flag for in the comments below!

Runner Up in the
Arduino Contest 2016

Participated in the
IoT Builders Contest
14 Comments
5 years ago
Great project! I'm a beginner and this was just what I was looking for. However, I was stuck for a long time with one problem; my servo was behaving erratically, moving back and forth at random. Google search results pointed to a problem with the power source and/or grounding, but after trying a number of things (different USB port, lipoly battery, different resistors between power and ground) — the (super basic) solution was to run the power from the USB pin, rather than the feather's 3.3v output. Hope this saves someone some time. Thanks!
6 years ago
Having an issue with the flag activating at a specific time. It seems like if it sits idle (especially overnight) it does not respond. After I reset the power, it works fine. I ran some tests, it will still work after 4 hrs idle, but after 8 hrs it seems to stop. Have you seen this issue? Any input is appreciated. Thanks again!
Reply 6 years ago
I've had some issues with the Huzzah disconnecting from wifi after extended periods of time. Can you check if the board is still connected to wifi after it begins sitting idle? I might need to alter the code to reconnect to the network every 4 hours. Cheers.
Reply 6 years ago
Same thing happened again this morning. It still appears to be connected to the internet. When I open the serial monitor, this is what I get:
Connecting to MQTT... Not authorized to connect
Retrying MQTT connection in 5 seconds...
Not authorized to connect
Retrying MQTT connection in 5 seconds...
Not authorized to connect
Retrying MQTT connection in 5 seconds...
Soft WDT reset
ctx: cont
sp: 3ffef660 end: 3ffef850 offset: 01b0
Maybe an issue with the MQTT connection?
Reply 6 years ago
Sorry for the trouble! I will try to replicate the issue and look into it in a couple of weeks. Hopefully it is an issue that can be fixed in the code and not something inherent in MQTT. What IFTTT trigger are you using?
Reply 6 years ago
I am using a simple Date and time trigger. It was working fine for a couple of days, but now kind of spotty, works when it wants to . I tried adding code to ping the MQTT server to keep it alive, but not sure if it made a difference. Sometimes it doesn't even activate when I turn it on from the adafruit io dashboard. Sorry, I'm a newbie at this, but having a lot of fun!
Reply 6 years ago
I will look at that next time it happens. One thing I did notice was the IP address changed the last time I reconnected. Thanks!
6 years ago
Voted!! Great idea and great instructions =D
6 years ago
This looks like such a fun project! I just ordered my first Arduino and have been looking for a good first project (that is also useful). This looks like it will be that project. Will report back when I have a working model!
Reply 6 years ago
Awesome Blaine! Let me know if you need any help.
6 years ago
tienes el codigo de esa programacion
6 years ago
Cool project, Louis! Your code uses two tabs, of which we are only shown one, could you attach your complete code folder as a zip file? Be sure to use placeholders instead of your personal wifi info or AIO key. I also spied a few typos ("Huzzar", "bellow", missing period), might want to give the copy another once-over!
Also I voted for you in the Arduino and IoT contests! To get more votes, you might include a temporary note in your introduction asking folks to consider voting for the project.
Reply 6 years ago
Thanks Becky! I've amended your notes, included the zip file and fixed the error in the circuit diagram.
6 years ago
that is genius! you could also make it ringa a bell or somethjng, just an idea