A basic sketch showing how to use the ESP8266 with the Adafruit MCP9808 to log the ambient temperature to thingspeak.com
The goal of this sketch is to report the ambient temperature to a remote/IOT server. As a bonus is it easy to also send the WiFi signal strength.
This sketch simply demonstrates basic WiFi and HTTP usage of the ESP8266 as well as a simple I2C sensor. The MCP9808 library is built for Arduino but works fine running on ESP8266.
The micro-controller and sensor will report the ambient temperature of a small solar storage project. The live data generated from this sketch can be seen here.
This is a rudimentary first pass of installing the sensor with blu-tack.
- Arduino IDE with ESP8266 Arduino Core installed
- Adafruit MCP9808 Library installed
Unfortunately this is not a tutorial, if you've already got your ESP8266 running from the Arduino IDE there's nothing much else you need to do to run this sketch.
- Get your IDE setup and running
- Install the Adafruit library, then install this library into your Arduino library directory
- Copy the included Settings.example.h to Settings.h and set your appropriate WiFi and Thingspeak settings.