This shows you the differences between two versions of the page.
iothings:proiecte:2021:wifithermostat [2022/01/27 01:09] alin.stroe2510 [Bibliography] |
iothings:proiecte:2021:wifithermostat [2022/01/28 13:01] (current) alin.stroe2510 [Wi-fi thermostat] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | **Wi-fi thermostat** | + | ====== Wi-fi thermostat ====== |
//Alin Stroe - ACES 2021// | //Alin Stroe - ACES 2021// | ||
+ | |||
+ | [[https://github.com/alinstroe/wifi_thermostat|GitHub source code]] | ||
====== Introduction ====== | ====== Introduction ====== | ||
Line 11: | Line 14: | ||
displayed on a LCD but also on a web page. When the temperature increases too much (above the desired temperature) the cooling system will turn on (I will use a relay to accommodate all AC appliances but for the demo I will use a DC fan). If this action will decrease the temperature value enough, the cooling system will be turned off. | displayed on a LCD but also on a web page. When the temperature increases too much (above the desired temperature) the cooling system will turn on (I will use a relay to accommodate all AC appliances but for the demo I will use a DC fan). If this action will decrease the temperature value enough, the cooling system will be turned off. | ||
The same algorithm will be used for the other case when the heating system needs to be turned on. | The same algorithm will be used for the other case when the heating system needs to be turned on. | ||
- | The reference temperature(desired temperature) can be set using the web interface or by pressing the hardware buttons of the device (UP/DOWN) | + | The reference temperature(desired temperature) can be set using the web interface or by pressing the hardware buttons of the device (UP/DOWN). |
Also the hysteresis interval can be set from a predefined list (e.g. ±0.25ºC, ±0.50ºC). | Also the hysteresis interval can be set from a predefined list (e.g. ±0.25ºC, ±0.50ºC). | ||
- | The web page can be further developed to achieve other functionalities like allowing the user to pre-program the thermostat to maintain a different temperature depending on the current time and day (e.g. Sunday at 8 AM the desired temperature is 24 degrees C but at 12PM the desired temperature will be 23 degrees C) | + | |
Line 31: | Line 34: | ||
====== Schematic ===== | ====== Schematic ===== | ||
- | {{iothings:proiecte:2021:wifi_thermostat_schematic.png| Electrical schematic for Wi-fi thermostat}} | + | {{iothings:proiecte:2021:wifi_thermostat_schematic.png?800x600| Electrical schematic for Wi-fi thermostat}} |
**Figure 1.** Schematic of the Wi-fi thermostat project | **Figure 1.** Schematic of the Wi-fi thermostat project | ||
Line 38: | Line 42: | ||
====== Software ====== | ====== Software ====== | ||
The software component is developed using Arduino IDE with the board manager support for ESP32 (LOLIN32 v1.0.0) | The software component is developed using Arduino IDE with the board manager support for ESP32 (LOLIN32 v1.0.0) | ||
+ | |||
+ | The software diagram is found below. | ||
+ | |||
+ | {{iothings:proiecte:2021:wifithermostat_sw_diagram.png|Software diagram}} | ||
+ | |||
+ | **Figure 2.** Software diagram | ||
I will describe the code on sections (data acquisitions, data outputs and control, Asynchronous web server for ESP32). | I will describe the code on sections (data acquisitions, data outputs and control, Asynchronous web server for ESP32). | ||
Line 231: | Line 241: | ||
For setting the hysteresis interval I have implemented two buttons for 0.25 and 0.50 values. | For setting the hysteresis interval I have implemented two buttons for 0.25 and 0.50 values. | ||
+ | |||
+ | {{iothings:proiecte:2021:wifithermostat_webif.png?800x400| Figure 2. The webpage }} | ||
+ | |||
+ | **Figure 3.** Web configuration page | ||
+ | |||
+ | |||
====== Conclusions ====== | ====== Conclusions ====== | ||
+ | I managed to obtain a basic thermostat functionality with Wi-fi connectivity and capable web-management of controlling two AC appliances (for heating and cooling). By implementing this project, I learned to use various libraries to host a web server on an embedded device with limited resources while also achieving an offline version of the thermostat. | ||
+ | When the Wi-fi network is not reachable, the thermostat is still usable and can be controlled via two external hardware buttons (e.g. for setting up the desired temperature) while the room temperature monitoring is done by the LCD 1602 display. | ||
+ | |||
+ | The web page can be further developed to achieve other functionalities like allowing the user to pre-program the thermostat to maintain a different temperature depending on the current time and day (e.g. Sunday at 8 AM the desired temperature is 24ºC but at 12PM the desired temperature will be 23 ºC) | ||
====== Bibliography ====== | ====== Bibliography ====== | ||
[[https://docs.platformio.org/en/latest/boards/espressif32/lolin32.html|ESP32 LOLIN32]] | [[https://docs.platformio.org/en/latest/boards/espressif32/lolin32.html|ESP32 LOLIN32]] | ||
Line 249: | Line 269: | ||
[[https://github.com/me-no-dev/ESPAsyncWebServer|ESPAsyncWebServer]] | [[https://github.com/me-no-dev/ESPAsyncWebServer|ESPAsyncWebServer]] | ||
+ | [[https://www.w3schools.com/html/|HTML Tutorial]] | ||
+ | |||
+ | [[https://fontawesome.com/|CSS elements]] | ||