WiFi thermostat with ESP12 - time display


I'm planning a wifi thermostat to control room temperature andhave some questions:

The device would have the following modules:

  • eInk display
  • relay to control the boiler
  • BMP280 to measure T (and humidity and pressure) of the room
  • RTC module
  • 1 cell 14500 battery with 3.7 V-s
  • few buttons to program

  • the MCU would be an ESP-12 module

  • an external webserver to collect data, set temperature, etc.

My idea is that the ESP-12 would be in deep sleep as much as it can. I couldn't use a wall plug and I need at least 8 months of working time.

(what I thnik) the easier part of the project is the following:

  • in every 5 minutes the ESP wakes up thanks to the RTC module to modem off mode, updates the system time and sets the next wake up time, measures the actual temperature and compares to the set temperature, sets the relay, updates the eInk display and goes back to deep sleep

  • in every 15 minutes ESP wakes up, turns its modem on, checks the desired temperature from the server, uploads the actual temperature, does the relay/RTC setting and than goes back to sleep

However I'm in doubt with the following: If I want to display the time (hh:mm) than the only way to do it is to wake up, set the display and go back to deep sleep in every minute?

You don't need an external RTC module, the ESP has an RTC built-in that can wake up the processor, and you can get the time from the network.

If you have a relay controlling mains power to a boiler, how come you can't use that to power the module?

A display doesn't update itself, if you want to change the time every minute, you have to update the display every minute, requiring the CPU to be awake.


couple of things.

1) assuming your t-stat is wireless, you can just send a txt that the battery is in need of charging.

2) if wired to the boiler, then you have power lines that can be used.

3) no one can see the temp if they are not right in front of the t-stat, a wake button might be easier

4) in my experience, temperature sensors need a warm up time. I have not used any vast number of sensors, but this is something to check before you rely on deep sleep. BMP needs a full minute to clear 90% of the error as it warms and a good 5 minutes to clear the last 10%.

Thanks Guys, good observations! Answers are the following:

  • right now I have an ordinary old-school thermostat, without any connection, that's what I would like to replace. This one goes on batteries and I don't have wall plug around that point /and I'm also interested in low power modes/ so i thought i give it a try /however I start to feel that it won't be easy to do it/

  • I'm also thinking to leave out the RTC module but I've read that the "RTC" module of the ESP is not so precise - anyway it's easy to leave this module out and later do the wake ups with the ESP's "RTC" and synchronize the time from the internet at data exchange

  • I don't really understand statement #3: are you saying that the eInk wouldn't be readable from angle or do you advise to leave the clock display out from the system by deafult and show the time only on a button press? sensible!

  • Thanks for this input! I've tried BMP but probably I wasn't be aware of this. What about DS18B20? or any other suggestion?

"old school' thermostat has a wire from the heater to the tehermostat. often many wires, but old-old-OLD school was 2 wires. the thermostat would close the contact, the load would be the coil in the heater and the coil would close, staring the heater. the power was AC, 12 to 24 volts.

the newer units have multiple wires. some are for A/C some for stages, some for heat pump reversal.....

what I was alluding to, is that you may be able to use those wires. put on a relay to isolate them so they can be used to send power to the stat for charging the battery. then put back into operation. there are days in a winter that have no cal for heat. so, over a season, even at an average of 7 hours for the week, you should be able to keep the batteries charged.

regarding #3) about the eInk, you send a value, then remove the signal. the value holds for weeks. if you wake, test, update, etc, then the value would be from the last update.

IMHO, I do not look at my thermostat for days, so I really do not care what it says when I am not looking. and my old house had the stat in a hall and I required the backlight to be on to see the temperature. hence a required button press. and.... following that logic, if I am standing there, a button press, wake up, test and update, could be done in a second.

note : my comment about a BMP starting cold, then warming up and slowly getting to the room temperature was with a sensor that was disconnected, then connected, then powered from a non-powered state. the BMP sensors have a minimum current draw and MAY be dead accurate in an instant with power being supplied continuously and a new 'get the data' signal. my experience is from out of the box, soldering on wire, then testing. then leaving in place for weeks. without re-testing.

Thanks for these hints!

I'm googling for some tutorials when ESP is not used as a standalone webserver because I'll need a differenet method:

I'll need a 24/7 webserver (at a free server provider f.e.) and I'll have to collect the data there because in the modem off periods the ESP won't be reachable. I have no idea how to do this since I have only limited experience with html-http.

So can you give me some hints/tutorials about external server - ESP8266 communication? How to do it?

I would think that you have to have it connected to a WiFi in your location to put any data up on the web. that means you have the ability to have a URL for the device, even if it changes by the nature of your ISP. you can use a data logging shield to store the data, then retrieve it from your phone by that same URL.

Also, I suspect that you are not going to get good battery life if you are posting a WiFi signal every few minutes, so that means maybe storing the data for a day, then doing a once a day post to the web. That drives the need to use a non-volatile storage device. Alas, this conversation is moving away from using batteries in a hurry. Writing to a storage device that is non-volatile will cost some precious battery power.