{"id":18930312,"url":"https://github.com/tomhumphries/mh-z19b","last_synced_at":"2025-04-15T15:31:20.387Z","repository":{"id":42912271,"uuid":"249800426","full_name":"TomHumphries/MH-Z19B","owner":"TomHumphries","description":"Communication with the MH-Z19B IR CO2 sensor for Node.js","archived":false,"fork":false,"pushed_at":"2022-03-26T09:16:41.000Z","size":34,"stargazers_count":6,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T19:59:10.779Z","etag":null,"topics":["co2","iot","mh-z19","mh-z19b","mhz19","mhz19b","node","nodejs","sensor"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/TomHumphries.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":"2020-03-24T19:34:49.000Z","updated_at":"2024-02-19T16:39:27.000Z","dependencies_parsed_at":"2022-09-06T12:20:53.167Z","dependency_job_id":null,"html_url":"https://github.com/TomHumphries/MH-Z19B","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/TomHumphries%2FMH-Z19B","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomHumphries%2FMH-Z19B/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomHumphries%2FMH-Z19B/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomHumphries%2FMH-Z19B/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomHumphries","download_url":"https://codeload.github.com/TomHumphries/MH-Z19B/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249097930,"owners_count":21212381,"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","iot","mh-z19","mh-z19b","mhz19","mhz19b","node","nodejs","sensor"],"created_at":"2024-11-08T11:37:12.318Z","updated_at":"2025-04-15T15:31:20.082Z","avatar_url":"https://github.com/TomHumphries.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MH-Z19B\nCommunication with the MH-Z19B IR CO2 sensor for Node.js\n\n## Declare\n```let mhz19b = new MHZ19B('/dev/serial0');```\nThe default UART port is _'/dev/serial0'_ \n\n## Commands\nPromise based\n```\nlet mhz19b = new MHZ19B();\nmhz19b.readCO2()\n    .then(data =\u003e {\n            console.log('CO2 reading', data);\n        })\n    .catch(err =\u003e {\n        console.log('error', err);\n    })\n```\n\n\nEvent based\n```\nlet mhz19b = new MHZ19B();\nmhz19b.on('CO2', (data) =\u003e {\n    console.log(`${data.co2}`);\n});\nmhz19b.readCO2();\n```\n\nCalibrate sensor baseline - set current level to 400 (do outside)\n```\nlet mhz19b = new MHZ19B();\nmhz19b.calibrate();\n```\n\nEnable / Disable ABC mode (auto-recalibration to 400 ppm every 24 hours)\n```\nlet mhz19b = new MHZ19B();\nmhz19b.abcOn();\nmhz19b.abcOff();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhumphries%2Fmh-z19b","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomhumphries%2Fmh-z19b","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomhumphries%2Fmh-z19b/lists"}