Arduino web temperature datalogger

There was one thing that kept me occupied lattely. It was temperature datalogger using Arduino, ESP8266 and DS18B20 and these all together save data to thingspeak.com. So now that I have everything working, let me make a little tutorial.

There are quite a few tutorials online about this topic, with different combinations of these components, but I have found none, that worked just the way I wanted them. I wanted to have Arduino as heart of the device, so that I can do more than just read and send temperature.

First we need to connect everything together as on the following Fritzing diagram:

That 1uF capacitor is important! I had a lot of problems before I put it there.

Once we have all of this connected, we need Arduino IDE so that we can program our board. Just go to arduino web page and download latest version. At the time of my vriting it was 1.8.5.

When you run IDE for the first time it will probbably ask to update boards, just accept it.

We need a few extra libraries, if we want to use all of the components. Go to menu Sketch -> Include Library -> Manage Libraries…

First in the window that opens search for Dallas and Install library that says DallasTemperature that supports among others DS18B20.

Second library is OneWire for one wire ICs.

The third is ThingSpeak for communication between thingspeak.com and ESP8266.

The last one is ESP8266 from Adafruit.

After that you need following sketch, where you need to change your router ID and password , you also need your thingspeak Write API key:

>>The code is not mine, I found bits and pieces from internet.

After you do all of this just compile and upload sketch.

Important! I had problems with power and had to add another 3.3V power supply because of ESP8266.

 

I am sure I forgot something, please let me know if you have problems below in comments.

Happy coding, till next time!

Gregor

 

 

 

2 thoughts on “Arduino web temperature datalogger

  1. hi, i have a problem running the code. i am getting error after uploading. please can i get some help

Comments are closed.