We are currently prototyping a WiFi Thermostat. In January 2025 my Honeywell thermostat stopped working. The temporary solution (first prototype, shown on the left) consisted of a Raspberry Pi Pico W microcontroller board and a relay board that I had on hand. While we are working to develop successive generations of hardware, this is mostly a software project (firmware, setup interface and display) and that is where most of our effort is focused.
Things I did not like about the old (commercial) thermostat include:
1. That it ran off of battery power so the batteries needed to be replaced periodically.
2. The parameters (set times and temperatures) were all kept in volatile memory so the thermostat needed to be re-programmed any time the battery was replaced.
3. The programming interface was limited to a few buttons that needed to be pressed to change the time, temp, etc.
4. The current time needed to be updated after battery changes using the buttons as well.
5. The display could not be read in low light or from anywhere except standing directly in front of it.
1. The power for the first generation prototype is supplied by a usb charger. Later generations will run from the AC provided over the furnace wiring. While the thermostat will not run when the power to the house is off, the furnace will not run without power either, so that is not much of a loss.
2. Our thermostat will store time and temperature parameters in non-volatile (flash) memory.
3. While our first prototypes are programmed over usb, our goal is to change programming over wifi.
4. The thermostat connects to wifi and syncs the time with information from the internet.
5. We currently display time, temperature, set temperature and whether the furnace is turned on using an OLED display. We have had issues with a computer based display updated over WiFi but we will get this worked out.
The relay (G5Q-1A4-EU DC5) is rated at 10 Amp with 5 volt, 40 mA switching. R1 is 50 ohm 603 package. U1 is a power driver (DRDC3105F-7). The switch is operated at 3.3 volts from a gpio pin on the microcontroller. The NO and common connections (J1, pins 1 and 2) connect to the red and white wires to the furnace.
Below is a screenshot of our Setup User Interface. This interface is used to set the network user name (SSID), password and time / temperature parameters for a variety of profiles. The software defines five profiles (Mon-Thurs, Fri, Sat, Sun, and away) which each have eight time / temperature periods. The time changes and temperature for each period can be adjusted by dragging the edges in the profile using the computer mouse. The days when the profile is active are defined in this interface as well. Once the user establishes the desired behavior, the parameters can be loaded onto the thermostat's non-volatile memory over usb. While the network parameters must be loaded using usb, we anticipate being able to adjust the time / temperature parameters over wifi.
Firmware was written in the Arudino IDE. The thermostat measures the temperature and turn the furnace on for 12 minutes if the temperature is below the set point. After the 12 minute active heating time, the furnace is turned off for two minutes before measuring again.
Time is set at startup over WiFi. The time monitoring section of code is a lightly edited version of the Arduino "TimeNTP_ESP8266WiFi" example sketch. The temperature reading part of the code was taken from an instructable sketch that I found on the internet.
A number of parameters are sequentially displayed on an OLED display. The image to the left shows the display of the current temperature, temperature setting and whether the furnace is currently turned on or or off. Other parameters include the time, day of the week, and date. This photo shows a 128 x 32 pixel display. While this display is certainly functional, it is smaller than ideal and we are looking at incorporating a 128 x 64 pixel display (see below).
The figure to the left shows a breadboard prototype powered by the 24 V AC provided by the furnace wiring. The figure shows the 128 x 64 pixel OLED display. The breakout board with the AC to DC converter also has a 5 volt regulator, a smaller form relay, a pushbutton to reboot the thermostat, and two leds. The new relay is rated at 1 amp and needs to be tested. One led indicates the power is on, the other is controlled by a Pico GPIO pin. The breakout board also incorporates a MCP9701T temperature sensor. The sensor reads the temperature too high, but this is probably due to thermal heating of the electronics and might be fixed by isolating the sensor from the ground plane. Alternatively, we can fix it in software.
Hardware: We are currently focused on getting bugs worked out of our firmware and are making small, incremental changes to the hardware that can be implemented on a breadboard.
We also plan to have circuits for controlling air conditioning and a fan in addition to the furnace.
Should we have an SD card reader? User name, password and set parameters could be saved on the card. The user could remove the card for programming. The pico already has sufficient flash memory to store all the data.
The thermostat also needs an enclosure.
Firmware: The original firmware did not allow the user to adjust important parameters, such as the set times, set temperatures, internet address, or network password. Our current firmware allows the user to input these into flash (nonvolatile) memory that will be re-loaded when the power cycles off. We have written the firmwear to allow five profiles, each with eight user defined temperatures and periods.
Need to work on error message recording, reading, clearing.
User Interface(s): We are writing a separate "Setup" user interface to allow parameters to be uploaded to the thermostat over usb. How annoying is it to have to input a device's network name and password using three buttons when you have a perfectly serviceable computer standing by? The "Setup" interface will allow the user to set parameters including the network name and password into non-volatile memory, so these parameters will not be lost when power is down.
While our second prototype will allow connection to an oled display, my own choice is to use the computer and we may not get to writing code for the display soon.
As described above, we are not pushing hard to pursue a final hardware implementation. Rather, we plan to build, test and refine components that will eventually end up in the final design. To the left is a representation of a design to test the power supply circuit design. This design will allow us to power the thermostat from the 24 volt AC provided by the furnace. Note that this requires that wiring from the house include a "Common" wire.
Relays: This design will also allow us to test a relay with a smaller footprint. While the relay in the original design works well, the smaller relay will give us more flexibility when choosing an enclosure. While this design has only one relay a future model will have three relays to allow for both heat and AC control.
Buttons and indicators: The design also incorporates a push button switch and two indicator leds, one for power and and one that can be controlled by the microcontroller.
Once we are done prototyping we will open this up to beta-testing. At this point we will open to receiving bug reports.
Reporting bugs: Please report any issues by sending an email describing the issue to j6summers@gmail.com