{"schema_version":1,"id":"nathanpervin-esp32-co2-monitor","name":{"en":"CO₂ Monitor","zh":"ESP32 二氧化碳监测仪"},"summary":{"en":"An ESP32-based CO2 monitor that logs readings to a SQLite database and displays them through a Django web application.","zh":"ESP32 二氧化碳监测仪，将读数写入数据库并通过 Django 网页查看。"},"purpose":"CO2 monitor","tier":"community","author":"NathanPervin","repository":"https://github.com/NathanPervin/ESP32-CO2-Monitor","license":"MIT","shape":"wide","scenes":["art"],"boards":[{"name":"ESP32"}],"native_board":{"en":"ESP32-2432S028R (CYD)","page":"https://esp32gallery.com/boards/cyd/"},"motion":false,"hardware":{"en":"ESP32-class board. Verify the exact board revision, display, power source and wiring in the upstream build guide.","zh":"ESP32 类开发板；请在上游构建文档中核对具体板型、屏幕、供电与接线。"},"notes":{"en":"An MH-Z19C CO2 sensor bolted to a Cheap Yellow Display, sampling once a second and pushing the readings to a Django site that keeps them in SQLite. The CYD shows live values with LVGL and a TFT_eSPI/XPT2046 setup; because the live number is already on the screen, uploads are batched, 240 samples posted every 4 minutes to save power, each tagged with building, room number, mode and Unix timestamp. The server side is a Django app with a Bearer-token POST endpoint at /api/log/, gunicorn behind Caddy, and a 3D-printed case adapted from another CYD design. A 7-second press of a button zeroes the sensor to 400 ppm, meant to be done outdoors. Sending more than 240 samples per POST can fail with connection refused, which the sketch's buffer size setting controls.","zh":"一块 Cheap Yellow Display 接上 MH-Z19C 二氧化碳传感器，每秒采一次样，数据推给 Django 站点存进 SQLite。屏幕上用 LVGL 加 TFT_eSPI/XPT2046 实时显示浓度；既然本地已经能看到，上传就攒批做，每 4 分钟发 240 个采样，省电，每条带上楼名、房间号、模式和 Unix 时间戳。服务端是 Django，/api/log/ 用 Bearer token 认证，gunicorn 跑在 Caddy 后面，外壳是从别人的 CYD 盒子改的 3D 打印件。按住按键 7 秒会把传感器零点校准到 400 ppm，这一步要在室外做。一次 POST 超过 240 个采样可能直接报 connection refused，能发多少由 sketch 里的缓冲区大小决定。"},"readme_excerpts":[{"label":"Dependency","quote":"Django for web app, API endpoint, and SQLite database"},{"label":"Feature","quote":"POST requests will be made every 4 minutes to reduce power usage"},{"label":"Feature","quote":"Zero the CO2 sensor to 400 ppm by depressing the button for 7 seconds"},{"label":"Limit","quote":"Increasing the number of samples in each POST can cause the POSTs to fail"}],"images":{"type":"gallery","primary":"https://esp32gallery.com/previews/nathanpervin-esp32-co2-monitor/poster.jpg","poster":"https://esp32gallery.com/previews/nathanpervin-esp32-co2-monitor/poster.jpg","sources":["https://esp32gallery.com/previews/nathanpervin-esp32-co2-monitor/frames/view-001.jpg"]},"media_credit":{"status":"upstream-project-media","creator":"NathanPervin","source":"https://github.com/NathanPervin/ESP32-CO2-Monitor/tree/e59b673a429d90d1ad72db3aa27ae02c473922e2","note":{"en":"Screenshots from the upstream README. Code and firmware were not executed. License notices are included.","zh":"来自上游 README 的真实截图；未运行代码或固件，预览包保留许可证声明。"},"reviewed":"2026-10-20"},"preview":{"browser_playable":false,"kind":"media_gallery","label":{"en":"Project screenshots","zh":"项目截图"},"width":960,"height":720,"shape":"square","source_commit":"e59b673a429d90d1ad72db3aa27ae02c473922e2"},"stars":0,"pushed_at":"2026-10-19T02:04:07Z","added_at":"2026-10-20T14:44:01+08:00","urls":{"html":"https://esp32gallery.com/projects/nathanpervin-esp32-co2-monitor/","html_zh":"https://esp32gallery.com/zh/projects/nathanpervin-esp32-co2-monitor/","json":"https://esp32gallery.com/data/catalog/projects/nathanpervin-esp32-co2-monitor.json","markdown":"https://esp32gallery.com/data/catalog/projects/nathanpervin-esp32-co2-monitor.md"}}
