{"id":21290192,"url":"https://github.com/miskcoo/esp8266_sensor","last_synced_at":"2026-05-19T11:06:09.626Z","repository":{"id":192568342,"uuid":"687012518","full_name":"miskcoo/esp8266_sensor","owner":"miskcoo","description":"An ESP8266-based temperature/humidity/CO2/TVOC sensor.","archived":false,"fork":false,"pushed_at":"2024-02-18T19:36:37.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T06:12:19.882Z","etag":null,"topics":["am2320","esp8266","esp8266-arduino","sgp30"],"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/miskcoo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-04T12:21:49.000Z","updated_at":"2023-09-04T14:54:07.000Z","dependencies_parsed_at":"2023-09-05T02:28:38.520Z","dependency_job_id":"65874e72-620e-4ded-8277-181f7deeccad","html_url":"https://github.com/miskcoo/esp8266_sensor","commit_stats":null,"previous_names":["miskcoo/esp8266_sensor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miskcoo%2Fesp8266_sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miskcoo%2Fesp8266_sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miskcoo%2Fesp8266_sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miskcoo%2Fesp8266_sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miskcoo","download_url":"https://codeload.github.com/miskcoo/esp8266_sensor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243754093,"owners_count":20342542,"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":["am2320","esp8266","esp8266-arduino","sgp30"],"created_at":"2024-11-21T12:45:43.379Z","updated_at":"2026-05-19T11:06:09.542Z","avatar_url":"https://github.com/miskcoo.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP8266 Sensor\n\nThis is an ESP8266-based environmental sensor. We use AM2320 as the temperature / humidity sensor, and SGP30 as the CO2 / TVOC sensor.\n\n## Usage\n\n\n- Install [arduino-cli](https://github.com/arduino/arduino-cli) and the [ESP8266 core](https://arduino.github.io/arduino-cli/0.33/getting-started/#adding-3rd-party-cores).\n- Create and edit `credentials.h` to specify the WiFi SSID / password:\n```c++\n#ifndef WIFI_CREDENTIALS_H\n#define WIFI_CREDENTIALS_H\n\n#define WIFI_SSID      \"your WiFi SSID\"\n#define WIFI_PASSWORD  \"your WiFi password\"\n\n#endif\n```\n- (optional) Set the SGP30 CO2 / TVOC baseline in `esp8266_sensor.ino` (see the `TODO` comment in this file). \n- Wire SGP30 to ESP8266: `SDA -\u003e GPIO4 (D1)` and `SCL -\u003e GPIO5 (D2)`\n- Wire AM2320 to ESP8266: `SDA -\u003e GPIO12 (D6)` and `SCL -\u003e GPIO14 (D5)`\n- Compile and upload the binary\n```bash\n  arduino-cli compile --fqbn esp8266:esp8266:nodemcuv2 . --libraries libs\n  arduino-cli upload --port /dev/ttyUSB0 --fqbn esp8266:esp8266:nodemcuv2 .\n```\n- Query the sensor data via `curl http://your-esp8266-ip`, an example output is\n```json\n  { \n      \"uptime\": 3318604, \n      \"am2320\": { \n          \"status\": \"ok\", \n          \"temperature\": 28.60, \n          \"humidity\": 65.10, \n          \"last_time\": 12154 \n      }, \n      \"sgp30\": { \n          \"status\": \"ok\", \n          \"eCO2\": 408, \n          \"TVOC\": 273, \n          \"last_time\": 158 \n      }, \n      \"sgp30_baseline\": { \n          \"eCO2\": 36622, \n          \"TVOC\": 41061, \n          \"last_time\": 12152 \n      } \n  }\n```\n\n## Instantiation\n\n![](https://blog.miskcoo.com/assets/images/esp8266-sensor/esp8266-sensor-example.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiskcoo%2Fesp8266_sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiskcoo%2Fesp8266_sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiskcoo%2Fesp8266_sensor/lists"}