Individální projekty MPOA

Mikroprocesory s architekturou ARM

Uživatelské nástroje

Nástroje pro tento web


gpoa2019:calm-thermostat

IoT home thermostat designed in the CALM Concept

Vypracoval: Martin Ptáček


Assignment

The project should make use of: DHT22 (digital temperature, humidity sensor), Relay switch (output for the boiler), LCD HT1621 (7-seg display; acreate new universal library), Photoresistor (for brightness settings), Quadrature encoder and capacitive buttons (for control; create custom library for ESP32), Connectivity with Home Assistant IoT platform. The final solution consisting of hardware, electronics & software should be compliant with the CALM Concept, namely with regards to reliability, easy and logic of use.


Introduction

Thermostat is an electronic appliance which almost everybody has at home. The main requirements on these devices are simplicity and reliability. In recent years there is a call for additional features like remote control and watch of a building temperature. There are already many commercial solutions with highlights like Netatmo and Nest. The downside of these thermostats is, except from the price, the IoT smart home integration restrictions of each platform. The aim of this project is to introduce a custom programmable thermostat solution, which can be made by everyone for the price of a fraction of commercial products.

Electronics

After many tests using ESP8266 Wemos D1 Mini Lite microcontroller I changed for a more expensive but radically more powered ESP32 DevKitC. Although ESP8266 is cheaper and its performance is more than sufficient, I had a lack of GPIOs and I found an expander not to be an efficient solution.

ESP32 DevKitC

For temperature sensing I have chosen DHT22 module. Even though it is definitely not the cheapest solution, it provides sufficient temperature accuracy, +- 0.5°C as advertised. Moreover, it provides also relative humidity measurement, which is very handy. The boiler that is connected to thermostat is controlled by simple relay links two wires together. For control of desired temperature in the old-days way I used a standard quadratic encoder, the same that is today often used in 3D printers. There is a necessity of putting a capacitor at least on the CLK signal (but better both quadrature signals) because the testing of software filtration didn't succeed and I reckon it's not worth the work.

A lot of attention was placed on choosing the right display for the thermostat. The HT1621 LCD Display is not only reasonably priced but also provides conveniently large digits. The downside is the software available for the IC. Unfortunately none of the few available libraries possessed the necessary features I demanded, therefore I started the development of my own (not from scratch).

The CalmFire board schematic

Software

Main project repository CalmFire_IoT_thermostat

In the software development of the CalmFire thermostat I tended to use open-source libraries when their quality was adequate because the amount of work to be done without them would be enormous and not necessary. As mentioned I created a library HT1621_universal for displaying temperature in Celsius on the LCD display. Then I used an OnOffRegulator class to take care of the boiler regulation with some hysteresis. Moreover, I altered and utilized an Encoder class created for Míčkoflus project where it measured DC engine revolutions using ESP32 PCNT module.

IoT Integration

Originally I used a MQTT broker-client architecture using flespi.io. The problem with this solution was an inconvenient scalability and user interface solution. Then I noticed a very elaborate project of Home Assistant that provides many problems elegantly solved. On the other hand, it has also some downsides. Its development, especially ESPHome integration platfrom, is still in rapid progress, which caused me many problems. At the end, I was using a combination of MQTT client (ESP32) that is connected to Home Assistant (Raspberry Pi).

Summary

Many of the problems of CalmFire thermostat were solved in this project and the thermostat is already capable of regulating temperature in a building. On the other hand, there are still problems to be solved and especially, to concentrate on reaching the CALM technology goal, which has so far not been deeply considered.

Current state of CalmFire thermostat

Further Development

In the future development, there will be a construction of a PCB board (probably DIY to be accessible to everyone) and construction of a 3Dprinted/laser cutted case and mounts.

Sources

gpoa2019/calm-thermostat.txt · Poslední úprava: 2019/05/02 11:29 autor: Martin Ptáček