ESP8266 BASIC WiFi Thermostat Is Child’s Play

If you’ve read any of our posts in the last couple years, you’ll have noted that our community is stoked about bringing the Internet to their devices on the cheap with the ESP8266 modules. Why? This forum post that details making a WiFi thermostat really brings the point home: it’s so easy and cheap to build Internet-enabled devices that you almost can’t resist.

When the ESP8266 first came out, there very little documentation, much less code support. Since then Espressif’s SDK has improved, the NodeMCU project brought Lua support, and there’s even Arduino support. Most recently, BASIC has been added to the ESP stable, and that really lowers the barriers to creating a simple WiFi widget, like the thermostat example here that uses a Dallas DS18B20 temperature sensor and an LED as a stand-in for the heater element.

The hardware for this project, a re-build of this demo code from the ESP8266 BASIC docs, is nothing more than a few off-the-shelf parts soldered together. No schematic required.

What makes the project work behind the scenes is some clever code-reuse by [Rotohammer] on the ESP8266 forums. Essentially, he wrapped the Arduino’s one-wire library, giving it simple BASIC bindings. Then all that’s left for the BASIC coder is to read the value and print it out to a webpage.

There’s all sorts of details swept under the rug here, and those of you out there who are used to bare-metal programming will surely huff and puff. But there’s a time for building your own injection-molder to make DIY Lego bricks, and there’s a time to just put blocks together. This project, and the BASIC interpreter that made it possible, demonstrate how much joy someone can get from just putting the parts together.

15 thoughts on “ESP8266 BASIC WiFi Thermostat Is Child’s Play

    1. all the old farts (me included) probably knew basic first, apple IIe etc all used it, ti-81 and up use it. Its actually pretty brilliant of a move and should theoretically make a bunch of useful things be made.

    2. The basic interpreter allows for code to be typed in the browser, supports several html gui widgets out of the box such as textbox, listbox, dropdown, button and slider. Also has some simple capabilities for generating graphics. If you look at the examples on the site and what they do you might be amazed at the simplicity of things that would otherwise be complex to implement in any other language with so few lines of human readable code.

  1. This doesn’t seem to bee a thermostat, as i don’t see anything that would allow an external device to switched on and off when the temperature is above/below some value.

    Neat project anyways, but title should be “IoT Temp sensor”.

  2. A remote temperature thingy seems to be the “Hello World” of wifi IoT projects.

    Not a BASIC fan, and I’ve become comfortable with programming ESP8266 in C/C++… but most IoT remote applications aren’t rocket science, so if BASIC allows more people to realize their IoT ideas… it’s a good thing.

  3. I loaded this up on an ESP8266-12 and tried a couple examples and they work. I tried the Clock example but didn’t know how to update the clock on the page except running the program again. So does this generate code that can be run on a regular web page? I can’t run this from my wired computer. If I type in I get page not found. I have to run from my wireless laptop then I have to keep switching back and forth between my wireless router and the ESP8266

  4. I tried loading ESP8266 basic on two devices now and it looks like they are now bricked. Both of them (esp8266-01) started to get very hot after the upload. Tried on a nodeMCU (esp8266-12e) and now it won’t see wifi.

    I’d like to see basic on the esp but so far it’s expensive and no output :(

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.