Ever heard of an Arduino? It's a $35 microcontroller that lets you write code that interacts with motors and lights and IRL stuff. Well, there's a $2 version that has all the same features and is the size of a postage stamp. It's call the ESP8266.
ESP8266 is an inexpensive wifi-enabled SoC made by the company Espressif. It was released in 2014 with very little documentation but its low cost motivated hardware hackers around the world to explore and document the module. Online communities formed to discuss the chip and how to build with it. Hobbyists developed software, including Arduino IDE integration, to make the chip easy to program. With the ESP8266 you can build Internet-connected devices for a few dollars.
You'll need an ESP8266 breakout board. An electronics company called WeMos offers the cheapest ESP8266 boards on the market with their D1 line. The D1 is available in a postage stamp-sized "mini" version and a larger R2 board that has a layout identical to the Arduino Uno. I recommend buying one of each. You should also buy a couple D1 mini shields that pique your interest.
- D1 mini: https://goo.gl/5rluqL
- D1 R2: https://goo.gl/w4pZZ1 (it's the same as the mini but larger to make prototyping easier)
- Buy a couple shields that interest you. I recommend the temperature sensor and relay switch.
WeMos is based in China so it will take anywhere from 2 - 4 weeks for the items to arrive to your doorstep. If you don't want to wait a month, you can buy SparkFun's Thing or Adafruit's HUZZAH. Both Adafruit and SparkFun have some excellent tutorials on how to use their boards.
- Learn about electricity: https://learn.sparkfun.com/tutorials/voltage-current-resistance-and-ohms-law
- Learn about microcontrollers: https://www.youtube.com/watch?v=JTDfub5Yj-Y
- Learn about the ESP8266: http://fabacademy.org/archives/2015/doc/networking-esp8266.html
The ESP8266 can be programmed using Arduino's IDE. This is the easiest way to get started. Here are some guides on installing the IDE and preparing it for both ESP8266 and D1 programming.
- Setting up D1 mini in Arduino IDE: http://www.wemos.cc/tutorial/get_started_in_arduino.html
- Video version of the above steps: https://www.youtube.com/watch?v=IQVKGAU8jcA
After the IDE is set up, connect the D1 R2 (or the mini) to your laptop with a standard USB micro cable.
If you followed the WeMos steps above, you should have some sample D1 sketches available in the Arduino IDE at File > Sketchbook > D1_mini_Examples
.
Open the Blink
sketch and peruse the code to see what it does.
Try uploading it to your D1 by clicking the IDE's upload
button.
Now attach the DHT22 temperature shield to the top of the D1 mini. Open and upload the DHT22 temperature shield sketch. See if you can get it to log your room's temperature and humidity.
- Public transportation notifier: https://www.youtube.com/watch?v=NzJ2-siImC0&list=PL3XBzmAj53Rlu3Byy_GkqG6b-nwEpWku0&index=1
- Internet-enabled smoke alarm: https://hackaday.io/project/5472-internet-enabled-smoke-alarm
- Solar powered temperature monitor: http://www.whatimade.today/do-i-have-hot-water-solar-powered-esp8266-with-a-thermistor/
- Plant irrigation system: http://iot-playground.com/blog/2-uncategorised/58-esp8266-wifi-plant-irrigation-system
- $4 smart home: https://github.com/artpi/SmartPi
- Water your garden with your phone: https://www.hackster.io/jweers1/esp8266-water-the-garden-with-your-phone-286f2f
A swiss gentleman named Andreas Spiess has released dozens of exceptional videos on the ESP8266 and IoT in general. Definitely worth checking out.
- If you're feeling ambitious you can also load NodeMCU onto the chip and write programs in Lua.
- If you know what you're doing and don't require a breakout board, standalone ESP8266 modules can be purchased on AliExpress.
- Espressif recently released an upgraded version of the chip, ESP32, that combines both WiFi and Bluetooth alongside two CPU cores. Breakout boards of the chip are not widely available yet but will hopefully reach AliExpress in a few months.