We are currently prototyping a WiFi Thermostat based on the Raspberry Pi Pico W microcontroller development board. In January 2025 my Honeywell thermostat stopped working. The temporary solution (first prototype) consisted of a Raspberry Pi Pico W microcontroller board and a relay board that I had on hand.
The current prototype has an external display (photo to the left) mounted on a wall with wires leading to a breadboarded Pico W inside a closet. This is a temporary solution that gives us easy access to all the components of the instrument. We are not pushing hard to develop successive generations of hardware until we are happy with the software.
Things I did not like about my 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 was supplied by a usb charger. Our current prototype is run from the AC provided over the furnace wiring with backup by a lithium ion battery. 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. We also have a set of buttons to allow the user to affect the set temperatures and times programmed in.
4. The thermostat connects to WiFi and syncs the time with information from the internet. After setting the time, the current firmware disconnects from WiFi and the microcontroller keeps time.
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 of the furnace.
Setting up the thermostat is most easily done over USB. 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 up to five profiles. The interface can be used to set the users time zone and whether to adjust for daylight savings time. 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 Arduino IDE. The thermostat measures the temperature and turn the furnace on for five minutes if the temperature is below the set point. After the five minute active heating time the temperature is measured again.
Time is set at startup over WiFi and then WiFi is disconnected. The time is managed using the Time Arduino library. The time is queried once per minute on a signal from a timer interrupt. The temperature reading part of the code is pretty standard for measuring the voltage at a divider consisting of a 100 kOhm resistor and a 100 kOhm NTC thermistor.
A number of parameters can be displayed on a 128 x 64 pixel OLED display. The image to the left shows the default display, which has four lines. The first line shows the time and day of the week. The second line shows the current temperature. The third line shows the profile and period (0,2) and the set point temperature. The fourth line shows whether the furnace is currently turned on or off.
The figure to the left shows two boards that power the thermostat. The one on the right provides +5 volts from the 24 V AC provided by the furnace wiring (Note that this requires use of the "Common" wire from the furnace). The one in the upper middle manages a lithium ion battery that takes over when the power is off. The glowing led indicates that the battery is being charged from the 24 V AC. The battery management board also monitors when battery power is employed and signals the microcontroller to enter a power saving mode when the AC is down.
In addition to being powered by the 24 V AC, upcoming hardware prototypes will have connections for buttons, a 124 x 64 pixel display, and the hardware will be compatible with air conditioning as well as heat. The size and shape of this prototype will be compatible with a commercially available enclosure.
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.
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.
Firmware: Our current firmware allows the user to input WiFi parameters, temperature profiles, and other information into flash (nonvolatile) memory that will be re-loaded when the power cycles off. The firmwear allows five profiles, each with eight user defined temperatures and start times.
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.
Once we are done prototyping we will open this up to beta-testing. At that 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