ESP8266 + DS18B20 Temperature sensor sends data to Thingspeak.com
The stock Firmware in the ESP8266 supports AT commands and for communicating with this need an micro-controller like Arduino. But i want to make a simple solution for that without using external micro-controller. NodeMCU firmware was the best thing i found. To upload the NodeMCU firmware please do a google search, there are tons of video’s and supporting documents out there. I am not going to explain the flashing in this post.
NodeMCU is Lua based firmware and i hope most of the people will know it. Most router GUI also built by Lua.
If you are done with the flashing the ESP8266 module, lets connect the DS18B20 to GPIO 0. If you are not aware of pin mapping please check it before connecting anything to the module.
Before writing any code, goto thingspeak.com and make an account and get the API key which will be used with the Lua code.
The Library and sample code
You can download the files from the following Github link. DOWNLOADS
I will post only the code which push the data to thingspeak.
*********************************START***********************************
require(‘ds18b20’)