{"id":23383350,"url":"https://github.com/CyberScoper/ESP32-AirQuality-Station","last_synced_at":"2025-08-24T04:30:55.960Z","repository":{"id":265559717,"uuid":"896243466","full_name":"CyberScopeToday/ESP32-AirQuality-Station","owner":"CyberScopeToday","description":"Smart environmental monitor with ESP32: measuring temperature, humidity and pollution levels with OLED display and control via Telegram.","archived":false,"fork":false,"pushed_at":"2024-11-29T22:40:38.000Z","size":1,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-29T23:25:24.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/CyberScopeToday.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-29T21:29:28.000Z","updated_at":"2024-11-29T23:16:34.000Z","dependencies_parsed_at":"2024-11-29T23:35:42.377Z","dependency_job_id":null,"html_url":"https://github.com/CyberScopeToday/ESP32-AirQuality-Station","commit_stats":null,"previous_names":["cyberscopetoday/esp32-airquality-station"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScopeToday%2FESP32-AirQuality-Station","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScopeToday%2FESP32-AirQuality-Station/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScopeToday%2FESP32-AirQuality-Station/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberScopeToday%2FESP32-AirQuality-Station/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberScopeToday","download_url":"https://codeload.github.com/CyberScopeToday/ESP32-AirQuality-Station/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230773670,"owners_count":18278137,"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":[],"created_at":"2024-12-21T22:20:07.858Z","updated_at":"2025-08-24T04:30:55.954Z","avatar_url":"https://github.com/CyberScopeToday.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Language:**  \n\u003e [English](./README.md) | [Русский (Russian)](./readmeru.md)\n\n# 🌿 ESP32-Based Air Quality Monitoring Station 🌿\n\n[![CodeFactor](https://www.codefactor.io/repository/github/CyberScoper/esp32-airquality-station/badge)](https://www.codefactor.io/repository/github/CyberScoper/esp32-airquality-station)\n\n\u003cimg src=\"https://github.com/user-attachments/assets/a34aa62d-067f-4a44-b4aa-49bd7169f400\" width=\"33%\"\u003e\n\n\u003e **An IoT project for monitoring temperature, humidity, and air quality with a user-friendly interface, RGB indication, and control via a Telegram bot.** 🎉\n\n---\n\n## 📋 Description\n\nThis air quality monitoring station measures:\n\n- 🌡️ **Temperature** (sensors **DS18B20** and **SHT21**)\n- 💧 **Humidity** (sensor **SHT21**)\n- 🌫️ **Particle concentration** PM1.0, PM2.5, PM10 (sensor **PMS5003**)\n\n### 📊 Acquired Data:\n\n- **Displayed** on an OLED SSD1306 display 📺\n- **Indicated** using an RGB LED 💡\n- **Sent** to the **ThingSpeak** platform 🌐\n- **Accessible** via a **Telegram bot** 🤖\n\n---\n\n## 🛠 Used Technologies\n\n| Technology          | Description                                                |\n|---------------------|------------------------------------------------------------|\n| ESP32               | Main controller of the project                             |\n| ![Arduino IDE](https://img.icons8.com/color/48/000000/arduino.png) **Arduino IDE** | Development environment for programming the ESP32 |\n| ![ThingSpeak](https://img.icons8.com/color/48/000000/api.png) **ThingSpeak** | Platform for data analysis and storage             |\n| ![Telegram](https://img.icons8.com/color/48/000000/telegram-app.png) **Telegram Bot** | Device management and data retrieval            |\n| OLED Display        | Displays temperature, humidity, and air quality data        |\n\n---\n\n## 🎥 Device Demonstration\n\n### 🚦 Air Quality Color Indication\n\n🌈 Air quality indication via LED:\n\n- 🟢 Green: Low pollution level (PM2.5 ≤ 12)\n- 🔵 Blue: Medium pollution level (12 \u003c PM2.5 ≤ 35)\n- 🔴 Red: High pollution level (PM2.5 \u003e 35)\n\n| Pollution Level | Indicator Color  | GIF                                    |\n|-----------------|------------------|----------------------------------------|\n| **Low**         | 🟢 Green         | \u003cimg src=\"https://github.com/user-attachments/assets/2f5cfba2-cc02-4ce2-a702-51e87d47cd74\" width=\"33%\"\u003e |\n| **Medium**      | 🔵 Blue          | \u003cimg src=\"https://github.com/user-attachments/assets/b189bf3d-bf9e-4071-bd53-0382c53eed21\" width=\"33%\"\u003e |\n| **High**        | 🔴 Red           | \u003cimg src=\"https://github.com/user-attachments/assets/97edd4c7-efd2-48bd-ba6a-446bf991b99d\" width=\"33%\"\u003e |\n\n### 📟 Example of Data Display on the OLED Screen\n\n\u003cimg src=\"https://github.com/user-attachments/assets/0f20f1a7-1246-4022-850d-11b38bbfb43d\" width=\"30%\"\u003e\n\n---\n\n## 🏠 3D-Printed Enclosure  \n\nTo securely house and protect all components, you can use a **3D-printed enclosure**, available at the following link:  \n**[3D-Printed Enclosure on Thingiverse](https://www.thingiverse.com/thing:5810438)**  \n\nKey benefits of using this enclosure:  \n- **Reliable protection** for sensors and the ESP32 board from external factors.  \n- **Easy access** to the OLED display, connectors, and LED.  \n- **Customizable design**: modify and reprint the enclosure as needed.\n\n## ⚙️ Components\n\n- 🪣 **ESP32 DevKit**\n- 🌡️ **DS18B20** temperature sensor\n- 🌡️ **SHT21** temperature and humidity sensor\n- 🌫️ **PMS5003** air quality sensor\n- 📺 **OLED SSD1306 display**\n- 💡 **RGB LED**\n- 🔗 Resistors, wires, and other components\n\n---\n\n## 🚀 Installation and Setup\n\n### 1. Hardware Preparation\n\nAssemble the circuit according to the code and schematics. Ensure all connections are secure.\n\n### 2. Software Preparation\n\n- Clone the repository:\n\n  ```bash\n  git clone https://github.com/CyberScopeToday/ESP32-AirQuality-Station.git\n  ```\n\n- Install **Arduino IDE** and the necessary libraries (see below).\n\n### 3. Configuration Setup\n\n#### Installing Libraries\n\nEnsure the following libraries are installed in the Arduino IDE:\n\n- `WiFi.h`  \n- `Wire.h`  \n- `Adafruit GFX Library`  \n- `Adafruit SSD1306`  \n- `OneWire`  \n- `DallasTemperature`  \n- `HTTPClient`  \n- `SHT21`  \n- `WiFiClientSecure`  \n- `UniversalTelegramBot`  \n- `ArduinoJson`  \n- `Preferences`\n\n#### Configuring `config.h`\n\nCreate a file named **`config.h`**:\n\n```cpp\n#define WIFI_SSID \"your_wifi_ssid\"\n#define WIFI_PASSWORD \"your_wifi_password\"\n#define THINGSPEAK_API_KEY \"your_thingspeak_api_key\"\n#define TELEGRAM_TOKEN \"your_telegram_bot_token\"\n#define TELEGRAM_CHAT_ID \"your_telegram_chat_id\"\n```\n\nReplace the placeholder values with your actual credentials:\n\n- **`your_wifi_ssid`** — Your Wi-Fi network name\n- **`your_wifi_password`** — Your Wi-Fi password\n- **`your_thingspeak_api_key`** — Your ThingSpeak channel API key\n- **`your_telegram_bot_token`** — Your Telegram bot token\n- **`your_telegram_chat_id`** — Your Telegram chat ID\n\n### 4. Uploading the Sketch\n\n1. Connect the ESP32 via USB.\n2. In **Arduino IDE**, select the **ESP32 DevKit** board.\n3. Upload the code to the device.\n\n---\n\n## 📱 Telegram Bot Commands\n\n| Command                       | Description                                                          |\n|-------------------------------|----------------------------------------------------------------------|\n| `/start`                      | Welcome message and help                                             |\n| `/status`                     | Retrieve current data from the device                                |\n| `/setapikey \u003capi_key\u003e`        | Set a new ThingSpeak API key                                         |\n| `/setinterval \u003cseconds\u003e`      | Set data sending interval (minimum 300 seconds)                      |\n| `/setthreshold \u003clow\u003e \u003cmedium\u003e`| Set PM2.5 threshold values                                           |\n| `/getsettings`                | View current settings                                                |\n| `/toggledebug`                | Enable/disable debug information on the OLED display                 |\n\n---\n\n## 📸 Device Photos\n\n\u003cimg src=\"https://github.com/user-attachments/assets/a64a5f38-b189-46e8-bbed-97d3fb1d9b5f\" width=\"40%\"\u003e\n\n---\n\n## 📈 Data Visualization on ThingSpeak\n\nAll data collected by the ESP32 Air Quality Monitoring Station is sent to **ThingSpeak**, a cloud-based platform for IoT data visualization and analysis.\n\n### 🌟 Live Dashboard Example\n\nExplore a real-time example of air quality data visualization on ThingSpeak:  \n**[ThingSpeak Channel - Air Quality Monitor](https://thingspeak.mathworks.com/channels/971678)**\n\n### 📊 Charts Available:\n\n- 🌡️ **Temperature**: Visualize ambient temperature from **DS18B20** and **SHT21** sensors.\n- 💧 **Humidity**: Monitor real-time humidity levels measured by the **SHT21** sensor.\n- 🌫️ **Particulate Matter (PM)**: Track air quality with PM1.0, PM2.5, and PM10 data from **PMS5003**:\n  - **PM1.0**: Fine particles, diameter ≤ 1.0 µm\n  - **PM2.5**: Particles, diameter ≤ 2.5 µm\n  - **PM10**: Coarse particles, diameter ≤ 10 µm\n\n---\n\n### 🔗 How to Access\n\n1. Open the **[ThingSpeak Channel](https://thingspeak.mathworks.com/channels/971678)**.\n2. Use the **charts** to view real-time air quality data updated every 5 minutes.\n3. Analyze trends, download datasets, or integrate the data into your own applications using ThingSpeak's API.\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT** License. See [LICENSE](LICENSE) for details.\n\n---\n\n## 🎯 Useful Links\n\n- 📕 [ESP32 Documentation](https://www.espressif.com/en/products/socs/esp32/resources)\n- 🌐 [ThingSpeak API](https://thingspeak.com)\n- 🤖 [Creating a Telegram Bot](https://core.telegram.org/bots)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyberScoper%2FESP32-AirQuality-Station","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCyberScoper%2FESP32-AirQuality-Station","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyberScoper%2FESP32-AirQuality-Station/lists"}