ESP8266 and DHT22 – Log room temperature to a Google Sheet

I recently discovered the ESP8266: a low-cost board with a WiFi chip that also has a microcontroller that you can program with the Arduino IDE. For less than $2, this was something I had to try! So I decided that I wanted to use the ESP8266 with a DHT22 temperature and humidity sensor to log the temperature of my room in Google drive.

I wired and set it up using this guide:

But instead of a USB to serial cable, I used a UART TTL module to communicate with the board. Since the 2 x 4 pin design doesn’t lend itself to use in a breadboard, I used an adapter board.

The complete circuit is shown below:

IMG_2665 IMG_2666

Once I got the module reading temperature values from the sensor, I added code to send the data to Adafruit IO using the getting started guide:

I then used an IFTTT recipe to add any new Adafruit IO values to a google sheet. This is what the values look like as they come in:

Screenshot 2016-03-10 21.42.11

And here is a plot of the temperatures over time. It looks a bit jagged since the temperature is being sent over as an integer, which is fine for my purposes.

Screenshot 2016-03-10 21.35.01

The Arduino IDE code can be found on my repository:

Leave a Reply