Thermostat formation: how it turned out





After several years of fruitful work, it was decided to bring to court the public our first product for climate control in a smart home - a smart thermostat for controlling a warm floor.



What is this device?



This is a smart thermostat for any electric underfloor heating up to 3kW. It is controlled through the application, web-page, HTTP, MQTT, therefore it is easily integrated into all smart home systems. For the most popular, we will develop plugins.



It is possible to control not only an electric underfloor heating, but also a thermal head at a water heated floor, a boiler or an electric sauna. Also, using nrf, the thermostat will be able to communicate with various sensors. Almost all climate-related sensors are currently in development. Since the device is based on ESP, we decided that it would be inappropriate to select customization options from users. Therefore, we will make it so that the user can transfer the device to developer mode and install another firmware, for example, with support for HomeKit or third-party projects.



* After installing third-party firmware with support for HomeKit or other popular projects, return to the original is not possible through OTA (Over-the-Air).



The difficulties that we met



To say that they were not there would be foolish. I will try to describe the most difficult problems that appeared and how we solved them.



The enclosure for the device was a challenge. And the cost of resources, and the cost of time (developed about a year).



There were a lot of options on the market. And the most popular is 3D printing. Let's estimate:

Classic 3D printing. Quality is poor, production speed too. We used 3D printing for prototypes, but it was not suitable for production.



Photopolymer 3D printer. Here the quality is many times better, but the price effect comes in. The prototypes printed on a similar printer, stood about 4000 rubles, and this is one part of the body of two. You can buy your printer, which will reduce the price, but still the price will be space, and the speed is unsatisfactory.



Silicone casting. We considered this the best option. The quality was at the level, the price is high, but not critical. Even the first batch was ordered in 20 cases for field trials.



But everything changed the case. One evening, I accidentally published in an internal chat for developers that with the cases a jamb, the price is high. And the next day, a colleague wrote in PM that his friend’s friend has TPA (thermoplast machine). And at the first stage, you can make a mold for him. This message has changed everything!



I had already considered the use of TPA before, but I was not even stopped by the need to order a batch of 5000 pcs minimum (although if you can try it, you can find less through the Chinese). I was stopped by the price of a mold. About $ 5000. I was not ready to lay out this amount at once. The amount for the mold through our newly minted colleague was not cosmic, it varied around $ 2000- $ 2500. In addition, he went to meet us and we agreed that the payment will be by installments. So the problem with the cases was resolved.



The second and equally important difficulty that we encountered is iron.



Do not count the number of revisions of iron. According to conservative estimates, the presented option is the seventh, not counting the intermediate ones. In it, we tried to solve all the shortcomings identified in the testing process.



So, earlier I thought that there was no need for a hardware watchdog. Now, without it, the device will not go into series: due to the capriciousness of the platform we have chosen.

Another analog input to the ESP. Earlier I thought that every pin of ESP is universal. But ESP has only one analog pin. Learn this happened in practice, which led to the alteration and re-order of printed circuit boards.



The first version of printed circuit boards











The second version of printed circuit boards











The penultimate version of the printed circuit boards, where I had to urgently solve problems with the analog pin











As for the software, there was also a bunch of pitfalls.



For example, periodic roll-off of ESP. Despite the fact that ping goes to it, the page does not open. There is only one solution - rewrite the library. Perhaps there are others, but all of us tried did not give a result.



The second significant problem, oddly enough, is the number of requests to ESP when opening a page. Using GET or ajax, we were faced with the fact that the number of requests became indecently large. Because of this, ESP behaved unpredictably, it could just reboot or process the request for several seconds. The solution was to switch to web sockets. After that, the number of requests has decreased significantly.



The third problem is the web interface. More information about him will be in a separate article, which will be published later.



For now, I’ll just say that the best option at the moment is to use VUE.JS.



This framework is the most suitable of all that we have tested.



Interface options can be viewed at the links below.



adaptive.lytko.com

mobile.lytko.com



Thermostat formation



Having overcome all the difficulties, we came to the following result:











Design



The thermostat consists of three boards (modules):



  1. Manager;
  2. Managed
  3. Display board


The control board is the board on which the ESP12, Hardware watchdog and nRF24 are located to work with future sensors. At the start, the device supports the DS18B20 digital sensor. But we provided the ability to connect analog sensors from third-party manufacturers. And in one of the future device software updates, we will add the ability to use sensors that come with third-party thermostats.







Managed - power and load management board. They placed a 750mA PSU, terminals for connecting temperature sensors and 16A relays to control the load.







Display - at the development stage, we selected the Nextion 2.4-inch display .



You can easily find information about him on the Internet. I’ll add on my own that it is convenient for almost everyone except the price. A 2.4-inch display costs around $ 12, which does not affect the final price in the best way.



So it was decided to make an analogue to our needs, but with a lower price. True, it will have to be programmed in the classical way, and not from the Nextion Editor environment. It is more difficult, but we are ready for it.



An analogue will be a 2.4-inch matrix with a touchscreen and a board with STM32 on board to control it and reduce the load on the ESP12. All control will be similar to Nextion by UART, as well as 32MB memory and a full flash card for recording logs.



The modular design makes it easy to change one of the modules and the output is a completely different device.



For example, there are already options for “board 2" in several versions:





Afterword



I am not a professional developer. I managed to unite people with one goal. For the most part, everyone works for the idea; in order to do something really worthwhile; what will be useful to the end user.



I am sure that someone will not like the design of the case; someone - the appearance of the page. It is your right! But we went all this way ourselves, through constant criticism of what we are doing, and most importantly - why. If there are no such questions as above, we will be glad to talk in the comments.



Constructive criticism is good, and we are grateful for it.



The story of the idea here . For those interested:



  1. For all questions: a group at Telegram LytkoG
  2. Follow the news: Telegram Lytko News news channel


And yes, we get high on what we do.



All Articles