|
ESP32-Smart-Thermostat-Blynk-APP
|
Full Doxygen Documentation: Click here to see it
| Item / Component | Qty | Specifications / Model | Role in Project |
|---|---|---|---|
| Microcontroller | 1 | ESP32 Development Board | Main brain, Wi-Fi connectivity, and UI rendering. |
| Display | 1 | 1.69" IPS LCD Module | ST7789 driver, 240x280 resolution, SPI interface. |
| **Sensor** | 1 | DHT11 Module | Temperature and humidity reading (3-pin variant). |
| **Relay** | 1 | CW-020 5V Module | Low-level trigger; actuates the boiler's dry contact. |
| **Wiring** | Set | Jumper Wires (Dupont) | For connections between modules. |
| **Power Supply** | 1 | 5V Power Source (USB) | Powers the ESP32, which in turn provides 3.3V to the peripherals. |
Building this thermostat wasn't just about putting parts together; it involved solving real hardware and software constraints. Here is how the project evolved:
The project started on a messy breadboard. The primary goal was to establish reliable communication between the ESP32, the DHT11 sensor, and the Blynk IoT cloud.
I wanted a premium, "Frosted Glass" UI similar to modern smart home hubs (like Ecobee).
Connecting the 5V CW-020 relay to safely control a boiler's dry contact.
Transitioned from the breadboard to a formal schematic using KiCad to document the exact pinouts, logic-level power distribution, and safe relay wiring for future PCB fabrication. The codebase was also migrated from Arduino IDE to Visual Studio Code (C++), complete with automated Doxygen documentation for clean, maintainable architecture.
Important: If you simply compile the main.cpp file, the display will remain blank (white screen). The TFT_eSPI library requires hardware-specific configurations to know which display driver and pins you are using.
You need to inject the display settings directly into your platformio.ini file using build flags. Add the following to your platformio.ini:
```ini build_flags = -D USER_SETUP_LOADED=1 -D ST7789_DRIVER=1 -D TFT_WIDTH=240 -D TFT_HEIGHT=280 -D TFT_MOSI=23 -D TFT_SCLK=18 -D TFT_CS=5 -D TFT_DC=2 -D TFT_RST=4 -D LOAD_GLCD=1 -D LOAD_FONT2=1 -D LOAD_FONT4=1 -D LOAD_FONT6=1 -D SPI_FREQUENCY=27000000