I was scratching my head today trying to figure out how to integrate sending data from one of my projects to a ThingSpeak channel. It occurred to me that I’ve got a bunch of little ESP8266-01 devices that would be perfect for this.
I wrote a very simple little sketch for an ESP8266-01 today that listens for json data on Serial and then parses it for the channel write api key, channel number and field values. The parsed fields are then sent to ThingSpeak. Whala – I’ve got data on my sensor data channel.
If you haven’t seen one of these things, here’s what they look like:
The ESP8266-01 is a tiny little micro controller that has a full WiFi implementation. The ESP8266-01 can’t do much, it has only 8 pins that are all used for basic things but it can be communicated with over a serial connection.
To wire this up to the arduino connect the arduino rx to esp’s tx, aduino tx to esp’s rx, arduino 3.3v to esp’s vcc and arduino ground to esp ground.
If your arduino uses 5v instead of 3.3v on it’s gpio pins you will need to shift the arduino’s tx down to 3.3v. For this project I used an adapter that I found on Amazon that has a 3.3v regulator and built in level shifters so you can safely use the esp8266 with a 5v arduino. You can also find a variety of level shifters and voltage regulators and build the circuits yourself. At minimum you can use a simple voltage divider on your arduinos tx.
And here’s the data that’s being sent.