The ESP8266 is a very cheap (£3 delivered in single quantities) WIFI chip that makes it easy to add internet connectivity to a microcontroller. I got excited when I found you can also flash your own firmware and do everything on the one chip.
I think the best way to learn is to do, so I recently ordered some ESP8266-01 modules from ebay. The first task was to make a breakout board which was also a good opportunity to start learning KiCad (love that push and shove routing!).
This resulted in my first project, a simple temperature logger, using Sparkfun’s service to store the data.
I quickly discovered the limitations of the ESP8266-01: it’s lack of pins. There are some issues to bear in mind with attaching peripherals to the ESP; 3 pins need to have the correct state to boot or to be able to load firmware.
This meant that my second project; a hackspace dust monitor wouldn’t boot with the dust sensor connected. I fixed that by building a simple transistor based NOT gate to ensure that the pin from the sensor was usually low instead of high.
The ESP8266-12 is a good candidate for projects because it has lots of GPIOs broken out, including those needed for SPI and deep sleep mode. I wanted to try an SPI RFID card reader, and this worked with the 12.
I took the opportunity to investigate MQTT, and found a library that worked with the Arduino ESP8266 environment. I’m running an MQTT broker called mosquitto on a Raspberry Pi. I think MQTT works well for this kind of project because I can have a simple Python script on a cronjob publishing new data to display every minute, and something else that subscribes to some info from the dial guage like WIFI signal strength, uptime, free memory.
I mapped the dial from 0 to 1000, and started off just sending the minute of the hour (mapped 0-60 to 0-1000). This made it easy to check how well the system was working. It’s really nice having it as a clock though, so I’m leaving it like this for now, but it’s cool to know I could easily have it telling me the number of minutes till the next 25 bus arrives!