{"id":13834459,"url":"https://github.com/raulgotor/co2monitor","last_synced_at":"2025-07-10T04:32:12.109Z","repository":{"id":39648234,"uuid":"336770851","full_name":"raulgotor/co2monitor","owner":"raulgotor","description":"CO2 monitor based in MH-Z19B IR CO2 sensor, using a TTGO module with integrated display, and transferring data to ThingsBoard.io","archived":false,"fork":false,"pushed_at":"2022-10-08T21:15:41.000Z","size":8728,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-05T14:15:27.114Z","etag":null,"topics":["co2-sensor","esp32","mh-z19b","thingsboard","ttgo-t-display"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raulgotor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-07T11:34:35.000Z","updated_at":"2024-04-06T19:06:18.000Z","dependencies_parsed_at":"2022-09-20T06:52:17.098Z","dependency_job_id":null,"html_url":"https://github.com/raulgotor/co2monitor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raulgotor%2Fco2monitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raulgotor%2Fco2monitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raulgotor%2Fco2monitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raulgotor%2Fco2monitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raulgotor","download_url":"https://codeload.github.com/raulgotor/co2monitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225618851,"owners_count":17497591,"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":["co2-sensor","esp32","mh-z19b","thingsboard","ttgo-t-display"],"created_at":"2024-08-04T14:00:35.078Z","updated_at":"2024-11-20T19:32:03.655Z","avatar_url":"https://github.com/raulgotor.png","language":"C","readme":"\u003c!--\n*** raulgotor, co2monitor, twitter_handle, TTGO ESP32 CO2 Monitor, CO2 Monitor based on the MH-Z19B Infrared CO2 sensor running on a ESP32 TTGO Display V1.1\n--\u003e\n\n\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n--\u003e\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003ch3 align=\"center\"\u003eTTGO ESP32 CO2 Monitor\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    CO2 Monitor based on the MH-Z19B Infrared CO2 sensor running on a ESP32 TTGO Display V1.1\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/raulgotor/co2monitor\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n\n   \u003cimg class=\"marginauto\" src=\"assets/overview.jpg\" width=\"400\" alt=\"centered image\"/\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/raulgotor/co2monitor\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/raulgotor/co2monitor/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/raulgotor/co2monitor/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003e\u003ch2 style=\"display: inline-block\"\u003eTable of Contents\u003c/h2\u003e\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#roadmap\"\u003eRoadmap\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgements\"\u003eAcknowledgements\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nHere you get a wireless battery powered CO2 monitor device with color display and internet connectivity.\nIt is based on the very well known MH-Z19B sensor, and on a ESP32 TTGO Display board, which \nintegrates a display and two control push buttons, therefore facilitating build from readily\navailable components. As the device is battery powered, it is very handy to perform on-field measurements.\nThe information is sent to a specified Thingsboard.io server for further plotting.\n\nBasic features are:\n\n- WiFi enabled CO2 monitor\n- MH-Z19B CO2 Sensor: 400 - 10000 ppm CO2 range\n- Display (IPS ST7789V 1.14 Inch) controlled by LVGL library v6.0\n- Battery operated\n- Display shows actual CO2 concentration as well as wifi and backend status and battery level\n- Automatic display power-off\n- Thingsboard.io integration\n- WiFi manager handling reconnection and AP configuration\n\n### Built With\n\n* ESP-IDF v4.4-dev-3042-g220590d599\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\n### Set-up\n\nThis repository is meant to be run in a ESP32 TTGO Display V1.1, but can be ran on any compatible\nESP32 module connected to an external display according to TTGO module schematics. The default connection of the sensor\nwith the TTGO board is as follows:\n\n| MH-Z19 | TTGO GPIO |\n|--------|-----------|\n|    Vin |        5V |\n|    GND |       GND |\n|     Rx |        25 |\n|     Tx |        33 |\n\n\u003cimg height=\"\" src=\"assets/connections.jpg\" width=\"300\"/\u003e\n\n### Installation\n\n#### Prerequisites\n\n- Install ESP-IDF Framework, follow the walk-through [here](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html).\n\n#### Steps\n\n1. Clone the repo\n   ```sh\n   git clone https://github.com/raulgotor/co2monitor.git\n   ```\n   \n2. cd into the repo folder and update submodules:\n   ```sh\n   cd co2monitor \u0026\u0026 git submodule update --init --recursive\n   ```\n\n   __NOTE__: LVGL library and drivers dependencies comes with some issues that cannot be fixed from these repository,\n   therefore are addressed as patches. Please apply the following patches:\n   \n   ```\n   cd components/lvgl\n   git apply ../../patch/lvgl.patch\n   cd ../lvgl_esp32_drivers\n   git apply ../../patch/st7789.patch\n   ```\n   \n3. Flash the firmware into the hardware:\n   ```sh\n   idf.py flash\n   ```\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\nAfter booting, the device will start sampling CO2 concentration and showing the result at the display. Additionally, it\nwill connect to the configured WiFi network and each measurement will be sent to the specified Thingsboard.io server.\n\n### Configuring WiFi credentials\n\nIf a configured network is not available, the device will launch an access point named __CO2_Monitor__. Connect to that\nnetwork and a captive portal will pop-up (if it doesn't, manually navigate to address ...... in your browser).\n\nConfigure it with your network credentials and press __Join__. If everything went well, you'll see your network SSID on the\ndevice display, together with the signal strength.\n\nA small pilot next to the signal strength indicator shows the backend connectivity status: green or red depending if it\nwas able to post messages to the backend.\n\n### Configuring Thingsboard server and token\n\n### Turning the display on and off\n\nThe display can be turned on and off by pressing the bottom-right button at the TTGO board. Additionally, the display\nwill turn off automatically after a specific amount of time which can be configured at the firmware configuration menu.\n\nLaunch the configuration menu with `idf.py menuconfig` and navigate to `Component config -\u003e Application configuration -\u003e Backlight automatic turn off` and select the desired\ntimeout (in seconds). To disable automatic turn off, configure it to 0 seconds.\n\n### Calibrating CO2 sensor\n\nPlace the device outdoors (the CO2 concentration outdoors is around 410ppm at the atmosphere), and after 15 minutes,\npress the bottom-left button on the TTGO board. The device will calibrate itself and take the current measured concentration\nas 400 ppm.\n\n__NOTE__: don't press the calibration button indoors as it will wrongly calibrate the device.\n \n### Further documentation\n\n\n\u003c!-- ROADMAP --\u003e\n## Roadmap\n\nSee the [open issues](https://github.com/raulgotor/co2monitor/issues) for a list of proposed features (and known issues).\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nRaúl Gotor\n\nProject Link: [https://github.com/raulgotor/co2monitor](https://github.com/raulgotor/co2monitor)\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n## Acknowledgements\n\n* [LVGL - Light and Versatile Graphics Library](https://lvgl.io)\n* [esp32-wifi-manager](https://github.com/tonyp7/esp32-wifi-manager)\n* [Embedded C Coding Standard, 2018 Michael Barr](https://barrgroup.com/sites/default/files/barr_c_coding_standard_2018.pdf)\n* [Best README template](https://github.com/othneildrew/Best-README-Template)\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/raulgotor/co2monitor.svg?style=for-the-badge\n[contributors-url]: https://github.com/raulgotor/co2monitor/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/raulgotor/co2monitor.svg?style=for-the-badge\n[forks-url]: https://github.com/raulgotor/co2monitor/network/members\n[stars-shield]: https://img.shields.io/github/stars/raulgotor/co2monitor.svg?style=for-the-badge\n[stars-url]: https://github.com/raulgotor/co2monitor/stargazers\n[issues-shield]: https://img.shields.io/github/issues/raulgotor/co2monitor.svg?style=for-the-badge\n[issues-url]: https://github.com/raulgotor/co2monitor/issues\n[license-shield]: https://img.shields.io/github/license/raulgotor/co2monitor.svg?style=for-the-badge\n[license-url]: https://github.com/raulgotor/co2monitor/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/raulgotor","funding_links":[],"categories":["Integrations"],"sub_categories":["Hardware"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraulgotor%2Fco2monitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraulgotor%2Fco2monitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraulgotor%2Fco2monitor/lists"}