{"id":23372603,"url":"https://github.com/drmboga/weatherstation","last_synced_at":"2026-02-26T10:36:27.612Z","repository":{"id":265282965,"uuid":"895679284","full_name":"DrMboga/WeatherStation","owner":"DrMboga","description":"An ESP32 based home weather station which measures the current temperature, fetches weather forecast and shows everything at the LCD display.","archived":false,"fork":false,"pushed_at":"2024-12-20T12:15:21.000Z","size":1332,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T01:40:00.989Z","etag":null,"topics":["cplusplus","cpp","csharp","electronics","esp32","home-assistant","home-automation","iot","platformio","weather-app","weather-station"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrMboga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-28T17:02:38.000Z","updated_at":"2024-12-20T14:46:38.000Z","dependencies_parsed_at":"2024-12-20T13:26:36.492Z","dependency_job_id":"02abf2af-8ef3-41fd-a5fa-2a1805091aca","html_url":"https://github.com/DrMboga/WeatherStation","commit_stats":null,"previous_names":["drmboga/weatherstation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrMboga%2FWeatherStation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrMboga%2FWeatherStation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrMboga%2FWeatherStation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrMboga%2FWeatherStation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrMboga","download_url":"https://codeload.github.com/DrMboga/WeatherStation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761051,"owners_count":20991533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cpp","csharp","electronics","esp32","home-assistant","home-automation","iot","platformio","weather-app","weather-station"],"created_at":"2024-12-21T16:31:12.503Z","updated_at":"2026-02-26T10:36:27.576Z","avatar_url":"https://github.com/DrMboga.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Home Weather Station\n\nAn ESP32 based home weather station which measures the current temperature, fetches hourly weather forecast and shows everything at the LCD display.\n\n---\n\n## Project Overview\n\nThe **Home Weather Station** uses an ESP32 microcontroller to collect and display data. A 16x2 LCD shows:\n\n- Temperature and humidity in three rooms of my apartment.\n- Outdoor temperature and humidity.\n- Hourly weather forecasts (e.g., \"Sunny,\" \"Rainy,\" or \"Cloudy\").\n\nThe system integrates hardware, a custom backend, and third-party APIs to ensure seamless functionality.\n\n![Housing picture](./Docs/legoHousing.jpg)\n\n---\n\n## Hardware Components\n\n![Components](./Docs/Components.jpg)\n\n- [ESP32 board](https://www.az-delivery.de/en/products/esp-32-dev-kit-c-v4)\n- [Multiplexer](https://www.az-delivery.de/en/products/tca9548a-i2c-iic-multiplexer)\n- [GY-21 sensor](https://www.az-delivery.de/en/products/gy-21-temperatur-sensor-modul)\n- [DHT-11 sensor](https://www.az-delivery.de/en/products/5-x-dht11-temperatursensor)\n- [LCD](https://www.az-delivery.de/en/products/16x2-lcd-blaues-display)\n\n### Sensors and Connectivity\n\nThe system collects environmental data using four sensors:\n\n1. **DHT-11 Sensor:**\n\n   - This sensor is connected directly to the ESP32 via a GPIO pin and placed outside the apartment window to measure outdoor temperature and humidity.\n\n2. **Three GY-21 Sensors:**\n   - These sensors monitor indoor conditions in three rooms.\n   - All GY-21 sensors share the same I2C address, which typically causes a conflict when connecting them to the same bus.\n\n### I2C Multiplexer TCA9548A\n\nTo resolve the address conflict of the GY-21 sensors, the system uses the TCA9548A I2C multiplexer. This device allows the ESP32 to switch between its ports, enabling communication with each sensor sequentially. Here's how it works:\n\n- The multiplexer creates 3 independent I2C channels.\n- The ESP32 activates one channel at a time, isolating the selected sensor.\n- Data from all three GY-21 sensors can be read sequentially without interference.\n\nThe TCA9548A is crucial for enabling multiple identical devices to coexist on a single I2C bus, making it an essential component in this project.\n\n### Display\n\nThe **16x2 LCD screen** serves as the user interface, showing real-time data such as:\n\n- Indoor and outdoor conditions.\n- Current weather forecast.  \n  The clear and simple display ensures the station is easy to read at a glance.\n\n### Enclosure\n\nTo house the components, I built a custom enclosure out of Lego bricks. This design offers:\n\n- **Protection:** Safeguards the ESP32, multiplexer, and display from damage.\n- **Flexibility:** Allows easy access for upgrades or repairs.\n- **Aesthetic Appeal:** Adds a fun and personalized touch to the project.\n\nThe sensors are connected to the ESP32 using old patch cables, which provide a reliable and flexible way to extend their range.\n\n### Connection scheme\n\n![Scheme](./Docs/Scheme_bb.png)\n\n---\n\n## Software Architecture\n\n![Architecture](./Docs/Solution.png)\n\n### ESP32 Firmware\n\nThe ESP32 is the brain of the operation. It communicates with the backend over WiFi and performs the following tasks:\n\n1. **Data Collection:** Reads sensor data at regular intervals.\n2. **Data Transmission:** Sends the collected data to the backend using a **POST** request every 6 hours.\n3. **Forecast Retrieval:** Requests hourly weather forecasts from the backend via a **GET** request and displays them on the LCD.\n\nThe firmware is designed to be efficient and robust, ensuring smooth operation even over extended periods.\n\n### Backend System\n\nThe backend is a **.NET Web API** application hosted on a local Linux server. It manages three main tasks:\n\n1. **Storing Sensor Data:**\n\n   - A POST endpoint receives data from the ESP32 and stores it in a PostgreSQL database. This creates a historical log of temperature and humidity readings for future analysis.\n\n2. **Providing Hourly Forecasts:**\n\n   - A GET endpoint retrieves hourly forecasts from the **AccuWeather API** and returns them to the ESP32.\n   - By leveraging AccuWeather's free tier, the system stays within the 50 requests per day limit while maintaining accuracy.\n\n3. **Sending Daily Summaries to Telegram:**\n   - A scheduled job runs every morning to:\n     - Fetch the latest sensor readings from the database.\n     - Retrieve a 12-hour weather forecast from AccuWeather.\n     - Compile this data into a summary message.\n     - Send the message via the **Telegram Bot API** to a subscribed channel.\n\n![Telegram message](./Docs/telegramMessage.jpg)\n\nThis integration ensures that I get an automated weather summary on my phone every morning.\n\n---\n\n## Code and deployment\n\n- [Here is the Platform IO project with sketch for ESP32](./Esp32/)\n- [Here is the backend .net project](./backend/)\n- [Here is a small \"HowTo\" for creating a Telegram bot and using it via API](./backend/telegram.md)\n- [Here is some instructions how to set up a home server using Linux](./backend/deploy.md) (In my case this is a Raspberry Pi 4 board computer)\n\n---\n\n## Daily Benefits\n\nThe **Home Weather Station** has become an invaluable tool in my daily life:\n\n- **Real-time Monitoring:** The LCD provides up-to-date information about the conditions inside and outside my apartment.\n- **Hourly Forecasts:** Help me plan activities based on expected weather changes.\n- **Morning Summaries:** A Telegram notification delivers a convenient summary of the day’s conditions and forecast.\n\nThese features make the station both practical and easy to use.\n\n## Final Thoughts\n\nThe **Home Weather Station** has been a rewarding journey into the world of IoT. Combining hardware and software taught me new skills and gave me a practical tool for my everyday life. Whether you’re an IoT enthusiast or looking for a new DIY challenge, I hope this inspires you to build something similar.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmboga%2Fweatherstation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrmboga%2Fweatherstation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrmboga%2Fweatherstation/lists"}