$10 DIY Wifi Smart Button / Switch
SimpleIOThings is the easiest and cheapest way to build DIY IoT projects with no coding or soldering required!
DIY IoT project with no soldering or coding required!
This tutorial will teach you how to build a Wifi Smart Button for about $10 dollars. You won’t have to code anything, and you won’t have to solder or buy expensive electronics equipment. Any services you are asked to use will be 100% free. Its that easy. Lets get started!
Sometimes you just need to communicate with the push of a button. What if I told you it was possible for about 10 bucks? With a wifi connected smart button you could:
– Excuse yourself from a conversation by sending a text or phone call to your own phone.
– Quickly call store/business security for help.
– Invite a reliable friend to come over and watch Netflix with you.
Whatever your particular snap communication need is, a wifi enabled smart button that can help you send a smartphone notification, SMS, email, and even an automated phone call at the press of a button.
The cool thing is, you can build one of these for about 10 dollars. I know you’ve seen these types of tutorials on the internet before, and usually they say something like, just buy a breadboard, soldering iron, breakout board, serial adapter, etc. etc. and after you’ve spent about $50 dollars you can build a cheap Internet of Things (IoT) device. Well, sorry internet. We nerds sometimes forget that most people don’t really have these things lying around. That’s why I built this website around the idea that IoT devices can be built without coding knowledge, soldering, or complicated prototyping.
STEP 1: Gather Your Materials
Its a good idea to buy your parts first because on the sites where the merchandise is cheapest (Ebay or Aliexpress) shipping times are rather lengthy. Depending on where you live in the world, it might take some time for your components to reach you so its better to do this sooner in the process than later. Here’s a list of things needed for this project. FYI, I’ve included some affiliate links to the cheaper places you could buy these components. I’ve done my best to ensure the ads display the lowest price goods that are relevant to this project, and if you buy through them you’ll be helping me maintain this site. Thanks! 😉
(FYI, if you’re just seeing text below with no images, its probably because you have an adblocker on. I know ads suck, but in this case they were actually a creative way to continuously update the page with the lowest cost parts. Prices change, so if I used static links and pics, the link would quickly become outdated. Please consider turning off adblock for this site for the best experience.)
1 x ESP8266 Development Board
AliExpress.com Product – 2015 New product Wireless module NodeMcu Lua Wifi Nodemcu WIFI Network Development Board Based ESP8266,High quality products
1 x DIY Project Box Enclosure 100x60x25mm
2 x Female to Female Jumper Wires
1 x Tactile Push Button (Cap optional)
1 x MicroUSB cable (10′ Cable Recommended)
1 x USB Wall Charger
These are tools needed to build the IoT device in this tutorial, but aren’t necessarily required.
1 x Pair of Pliers
1 x Hack Saw
1 x Tube of Superglue
Great. Now like I said, its gonna take a while for your stuff to get to you, so in the meantime lets setup some digital infrastructure that we can use once your stuff arrives.
STEP 2: Setup Your IFTTT Account & Recipes
The Wifi Smart Button, and all of the devices on SimpleIOThings, uses a service called If This Then That (IFTTT). You can find a full tutorial on how to sign up and configure digital communications for your IoT devices in the Getting Started: Setup IFTTT post. Once you completed it, you should have completed the following:
- Signed up for an IFTTT account
- Downloaded the IFTTT App
- Connected to the Maker Channel
- Recorded your Maker Key
- Organized Maker Events (Triggers) that lead to IFTTT Actions.
Okay! We’ve got some really nifty digital infrastructure setup for your project. Soooooo…its gonna take a while before you get all this stuff…so its probably best to bookmark this page and come back after it’s all arrived. See you in a few weeks!
STEP 3: Install Firmware to your Dev Board
Oh hi there! Welcome back. I know its been a while. Maybe the seasons changed in your part of the world. Governments may have risen, switched hands, entered alliances, broken alliances, fallen, and then risen again. Yea…it takes a while to get your stuff. But now that it’s here, lets start building!
You can find a full tutorial on how to load firmware onto your ESP8266 Development Board on the Getting Started: Setup ESP8266 Dev Board post. After you’re done with this tutorial you should have completed the following.
- Connect your ESP8266 Dev Board and Install Drivers
- Load Firmware onto Dev Board using ESP8266Flasher.exe.
- Connect to Dev Board using LuaLoader.
STEP 4: Install Sensor Specific Software to your Dev Board
Great! Now your dev board speaks Lua and its ready to start communicating with the world and run programs. Now it just needs specific instructions or programs to be useful for your specific use case. Lucky for you, I’ve already written the programs needed to get your device up and running. Full instructions on how to program your device with specific settings for your use case can be found on the Getting Started: Loading Device Software Via LuaLoader tutorial page. In this tutorial you should have completed the following:
- Downloaded SimpleIOThings.zip from the Downloads page.
- Extracted the zip file and run the SensorSetup.bat file.
- Input your information into the command prompt to enter user and device specific information (IFTTT Maker Key, the Maker Event name, the device’s location info, etc).
- Enter input thresholds, input timeouts, and interval between notifications as prompted.
- Uploaded device specific files to your ESP8266 Development Board using LuaLoader.
- Set the Wifi Network Name and Password for your ESP8266 Development Board.
STEP 5: Modding Your Enclosure
All the way back in step 1, we talked about gathering materials. Now that you have everything in hand and your board is programmed, get all your materials together in one space.
Some suggestions on how to mod your enclosure can be found here at Getting Started (5): Modding Your Enclosure. After completing this tutorial you should have completed the following:
- Created an opening in the rear of the enclosure for the microusb power cable.
- Created an opening in the front of the enclosure for the button wires.
STEP 6: Build the Button
Now go ahead and unplug your dev board (there is almost no electrical danger to you from touching the dev board while plugged in, but might as well err on the side of safety).
Now, grab the button that you bought, and bend two of the prongs on one side until they snap off. You’ll only need 2 prongs, and the other two will just get in the way. Here’s a picture of what it looks like after you’ve snapped off one of the prongs.
After that, flatten out the remaining prongs (bend them flush to the bottom of the button), and then go ahead and grab your two jumper wires and plug them into the remaining prongs. If they wires aren’t grabbing onto the prongs well, increase the amount of “kink” in the prongs with a set of pliers. Finally put the cap on the button. In the end it should look like this:
Now grab your dev board, and observe the names of the pins on the board. Go ahead and plug your jumper wires into the “GND” and “D2” pins on the right hand side. It should look like this:
Just a quick note for those of you who are interested in the electronics. When setup this way the button, when pressed, is acting as a bridge between the D2 pin and the electric ground (-). That way when the button is pressed, it grounds the D2 pin, registering a change in electrical signal which the chip detects as a sensor input. Pretty cool! Great, the electronics are all setup. Pretty simple right?
Alright, now you can put your electronics into the enclosure. Plug your usb cable into the dev board, and make sure your jumper wires are well positioned before you close the project box. Finally, place the button on top of the enclosure, and glue it down.
And we’re done!
Your button should now be fully operational. Give it a press and it should trigger whatever you’ve set it up to do, whether that’s a smartphone notification, SMS, phone call, email, etc.
I hope you enjoyed building a super simple Internet of Things device. Hopefully you will be able to use it for something useful, or use it to do something fun. If you enjoyed this tutorial, consider donating at the link below. Thanks for reading!