Heat Pump Control That Works

Heat pumps are taking the world by storm, and for good reason. Not only are they many times more efficient than electric heaters, but they can also be used to provide cooling in the summer. Efficiency aside, though, they’re not perfectly designed devices, largely with respect to their climate control abilities especially for split-unit setups. Many of them don’t have remotely located thermostats to monitor temperature in an area, and rely on crude infrared remote controls as the only user interface. Looking to make some improvements to this setup, [Danilo] built a setup more reminiscent of a central HVAC system to control his.

Based on an ESP32 from Adafruit with an integrated TFT display, the device is placed away from the heat pump to more accurately measure room temperature. A humidity sensor is also included, as well as an ambient light sensor to automatically reduce the brightness of the display at night. A large wheel makes it quick and easy to adjust the temperature settings up or down. Armed with an infrared emitter, the device is capable of sending commands to the heat pump to more accurately control the climate of the room than the built-in controls are able to do. It’s also capable of logging data and integrating with various home automation systems.

While the device is optimized for the Mitsubishi heat pumps that [Danilo] has, only a few lines of code need to be changed to get this to work with other brands. This is a welcome improvement for those frustrated with the inaccurate climate controls of their heat pumps, and since it integrates seamlessly into home automation systems could also function in tandem with other backup heat sources, used in cold climates when it’s too cold outside to efficiently run the heat pump. And, if you don’t have a heat pump yet, you can always try and build your own.

33 thoughts on “Heat Pump Control That Works

  1. Thermostats, and other interior climate controls are horrendously over expensive for what they do. Custom solutions shouldn’t be necessary to improve on them.

    I find it depressing, the amount of gain available for climate, energy usage, cost reduction, etc is very high.

    1. As you’ve already alluded to, temperature control at its basic level can be very simple. Now heatpumps are always working to be efficent. If the Mitsi controls aren’t controlling the temperature of the room the way you’d like, I’d want to know *why* before I went doing something like this.

      A simple example would be that if the heatpump finds out it’s cycling too often (poor flow, load too low etc), it might make the hysteresis larger to try and work with the setup it’s in.

      The reasoning for this would be the compressor manufacturer states not to cycle the compressor more than X times in and a given Y hours.

      Shorter: Fix what’s going on with the Mitsi controls before trying to override them.

  2. Seeing the source for a project like this just makes me so angry at current development practices. What should be…maybe a single file and 100 lines of code, turns into 40 files, across 12 directories, and 1870 lines of code… and you can’t find shit… for a thermostat.

    1. Oof, I must ardently disagree. This is 2000 lines spanning everything from network code to input event handling to device management. The massive stew of what amounts to goto-driven development I too often see in microcontroller projects drives me nuts. Very hard to navigate, and impossible to maintain. At least, it would be for me!

      OOP is perfect for this kind of task, and without it, I never could have managed the complexity here. I think if you glance through the readme, you’ll find some explicit pointers on where to get started.

      Or not! That’s free code for ya. Thanks for having a look in any case.

    2. Don’t get angry, instead learn to milk the cow and reap profits. Something that could be done in a weekend now “takes” a month of development 😉 (even if most of that is spent watching mentos and soda videos on YouTube)

      Given the same hourly rate, it’s always better to issue an invoice for 160 hours of work instead of 16.

    3. I disagree. It is pretty fully featured code but nicely compartmentalized but not too much, he is hitting a good sweetspot in my opinion. I did not even need to use an IDE to understand the code. So naming of things is also well done.

      I have worked on codebases that have been made with SOLID/CLEAN code paradigms by Uncle Bob (Robert C. Martin). That was code for a wearable watch like a fitbit with a display, bluetooth connectivity and a slew of sensors (heartrate, motion, UV light sensor). It was a large inheritance hierarchy where all methods had not more then 5 lines of code of functionality (as per Uncle Bob decree), figuring out how thinks worked was a massive pain and finding bugs even more.

      I have starred this repository so I can link it to people asking for “a good embedded codebase” that is still simple enough to understand but well structured. As I am just starting out with C++ myself, this is a good example codebase.

    4. Maybe you could do it with 100 lines of Ruby, but you’d be relying on a LOT of bundled library code as well, and then you’d be moaning about software bloat.
      This is good, modular, maintainable code. You probably mostly need to bother to learn C++.

  3. I never touched the temperature settings on my heat pump. That’s the reason why I don’t understand the market for this controllers seems to make the thing more complicated and more failure points.

    1. Perhaps your electricity always costs the same amount? In places with variable rates being able to adjust the setpoint and take advantage of energy costing half as much to precool or preheat is well worth it. And that’s including the loss of efficiency from having the unit run at higher capacity (assuming a variable unit).

    1. I still have one in my house. Works a charm for my propane heater. Even works during power outages since the pilot light has a power generating thermocouple in it. Sometimes it’s a little slow to switch the heater, but usually it’s responsive.

  4. “Heat pumps are taking the world by storm, and for good reason. Not only are they many times more efficient than electric heaters, but they can also be used to provide cooling in the summer. ”

    That’s not the reason. The reason is mandates.

    1. My electric bill this summer was much lower with an 18K BTU mini split heat pump running constantly. Last summer I had a window AC that ran constantly at full blast and it couldn’t keep the room cool.

    2. “That’s not the reason. The reason is mandates.”

      There’s danger in assuming everyone believes exactly as you do. We replaced our failed AC condenser with a heat pump to save on heating costs. I have no idea if they were mandated then, or now. So no, the reason is not universally mandates.

        1. The invisible hand of the market is a mandate, right? It’s the greatest economic efficiency mandate. Heat pumps in most places are both cheaper as a new installation and cheaper to run. There’s your mandate.

    1. An external probe is perfect for coarse grained control, but even then you still need an internal temperature sensor foe adjustment.
      The inside temperature is also affected by sunshine, windchill, cooking, … all things your external probe won’t register.

  5. We have all this great technology and yet most home heating systems still use the outdated setup of one centrally mounted thermostat. This wastes all that efficiently produced energy by heating the entire house to keep the occupied rooms warm. Why isn’t this thermostat part of a house network of sensors that shunts heat to occupied rooms maybe using moveable dampers in the heat ducts ? (I know there are residential systems like that but you never hear about them). The article mentions this but stops short of just a building a single fancy thermostat. Twice in the article it is mentioned that it’s “capable” of being more than just a heat control but there is no indication of implementing this. So yes nice build on a DIY thermostat but would have been better if this had been taken farther.

    1. KISS.

      If your house is correctly (evenly) insulated and your heating system is installed correctly, it is a balanced system and a representative location to measure temperature is sufficient for complete temperature control.
      Obviously, you can save more energy by local termperature measurements, however, unless you have specific needs, it is not cost efficient.

      If you have parts of the house that are not used for longer times, a correctly installed heating system includes multiple zones.

    2. While that seems like a great idea, unless you have variable/multi-capacity equipment, you can’t simply close a bunch of vents and only condition certain spaces in the home. You can do this to a very limited fashion. Closing a bunch of vents chokes the system airflow, which reduces equipment life, i.e. flooding the compressor. A properly designed duct and heating/cooling system can be zoned, but variable/multi-capacity equipment is a must.

      With heat pumps, the desire is for long run cycles. Ideally, you want to match the HP capacity to the load. You lose efficiency during start-up and shutdown.

      Another thing to consider: if you have a bunch of unused rooms, you may be living in a home that is too big for your needs. Might be time to downsize.

    3. Completely agree with @Garth Bock. There are systems that he talks about but little known, they control the temperature in each zone and “talk” with the heat pump equipment with Inverter capacity (the vast majority today) decentralizing the control, avoiding what he says later @ Chad. They also have the ability to control many HVAC manufacturers and integrate with most BMS. One such system is Airzone, which can zone centralized duct equipment or simply control individual equipment with the Aidoo device (integrating these heat pumps using protocols such as, but not limited to, API, Modbus, KNX, Z-Wave or Zigbee) by adding or not a second thermostat as needed. Manufacturers like Daikin, Panasonic or Mitsubishi propose it in their own catalogues.
      https://www.avnation.tv/2023/09/04/the-road-to-cedia-expo-2023-with-airzone/

  6. Most t-stats inaccuracies stem from a hysterious related problem. Sensor response plays a big part in that. Most people have no clue about “secret” settings in their electronic t-stats

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.