Sometimes the thermostat isn’t in the room where I actually live my life (aka my office). So, I decided to build my own solution using some hardware I had lying around in Temu packages and a mix of software technologies I wanted to play with. And since my computer is basically running 24/7 anyway, there’s no need for any fancy external deployment
Features
- Real-time temperature and humidity readings – with WebSockets for instant updates, plus tracking of highs and lows, and charts to show how dramatic the day has been.
- Local data storage – all readings stored in SQLite.
- Quick web dashboard – built with Angular.
- Instant UI updates – WebSockets push updates as soon as the room decides to change its mind.
Circuit Setup
For this project, I used an ESP microcontroller connected to a DHT22 temperature and humidity sensor.
The DHT22 module I’m using already includes a built-in 10 kΩ pull-up resistor on the data line, so it can be connected directly to the ESP without any additional components.
For more details about connecting the DHT22 to ESP boards, you can check out this guide from Random Nerd Tutorials:
ESP32/ESP8266 with DHT11/DHT22 Temperature and Humidity Sensor
Software
Server handles real-time communication between the ESP8266 sensor node and my Angular dashboard(bootstrap) using WebSockets. When the ESP connects, it identifies itself and starts sending temperature and humidity readings, which are validated, stored in the database, and used to update long-term stats like highest and lowest values. Every new reading is instantly broadcast to all connected Angular clients, keeping the dashboard live without any polling or MQTT. The server also sends the latest data to any newly connected client so the UI is always up to date.
