{"id":1173,"date":"2018-09-25T21:07:40","date_gmt":"2018-09-25T20:07:40","guid":{"rendered":"http:\/\/EvertDekker.com\/?p=1173"},"modified":"2022-12-31T14:13:05","modified_gmt":"2022-12-31T13:13:05","slug":"iot-co2-sensor","status":"publish","type":"post","link":"https:\/\/evertdekker.com\/wp\/?p=1173","title":{"rendered":"Iot Co2 Sensor"},"content":{"rendered":"<hr \/>\n<p>For measuring the air quality in the living room I was looking for a CO2 sensor to build my own CO2 Iot node. Looking around on the internet I found the <a href=\"https:\/\/www.winsen-sensor.com\/d\/files\/PDF\/Infrared%20Gas%20Sensor\/NDIR%20CO2%20SENSOR\/MH-Z19%20CO2%20Ver1.0.pdf\">MH-Z19<\/a> sensor, not that expensive and according to other users this sensor is accurate.<\/p>\n<p>A new project was born. The MH-Z19 was combined with a\u00a0<a href=\"http:\/\/www.adafruit.com\/datasheets\/BST-BME280_DS001-10.pdf\">BME280<\/a> and <a href=\"https:\/\/cdn-shop.adafruit.com\/datasheets\/TSL2561.pdf\">TSL2561<\/a> so we can measure lux, temperature, humidity, air pressure and CO2 with one Iot node in the living room and send everything over Mqtt to Node-red for further handling and Sqlite database storage.<br \/>\nThe biggest part of the design is a copy of my <a href=\"http:\/\/evertdekker.com\/?p=1038\">Iot Bme280 sensor<\/a> module, this Iot sensor runs 40 days on one 18650 li-ion cell. However the MH-Z19 requires 5V and uses a lot more current so I thought it would be nice to power it from a power bank.<br \/>\nThe esp8266 requires 3.3V so the 5V from the powerbank is stepped down with a <a href=\"https:\/\/www.diodes.com\/assets\/Datasheets\/PAM2305.pdf\">PAM2305AAB330<\/a>, very interesting stepping regulator that only requires 2 capacitors and 1 inductor. Little bit hard to get here in Europe, but luckily Arrow had &#8220;no shipping charge&#8221; days and the parts where quick and cheap here.<br \/>\nThe MH-Z19 requires serial communication with the esp8266, the last one has power enough to do this with a software uart. <a href=\"https:\/\/github.com\/jehy\/arduino-esp8266-mh-z19-serial\/blob\/master\/arduino-esp8266-mh-z19-serial.ino\">Example for the Arduino IDE<\/a> to get data out of the MH-Z19 was also quickly found. With all of this together the data was quickly streamed to the Mqtt broker.<br \/>\nThe pcb was designed so that it will fit inside a Hammond 1591 case and the pcb is used like a sort of front panel this way. The MH-Z19 is milled out the pcb so you can mount it on the back.<\/p>\n<p>&nbsp;<\/p>\n<div class=\"n2_ss_slider_publish__option_code\" dir=\"ltr\" data-mode=\"id\"><\/div>\n<p>&nbsp;<\/p>\n<p>If want to make your own, or use some parts from the design, here are the Altium 16 design files.<br \/>\n<div class=\"sdm_download_button_box_default\"><div class=\"sdm_download_link\"><a href=\"https:\/\/evertdekker.com\/wp\/?sdm_process_download=1&download_id=1180\" class=\"sdm_download darkblue\" title=\"IotCo2Sensor\" >Download Now!<\/a><\/div><\/div> <div class=\"sdm_download_count\"><span class=\"sdm_count_number\">2783<\/span><span class=\"sdm_count_string\"> Downloads<\/span><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For measuring the air quality in the living room I was looking for a CO2 sensor to build my own CO2 Iot node. Looking around on the internet I found the MH-Z19 sensor, not that expensive and according to other users this sensor is accurate. A new project was born. The MH-Z19 was combined with [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[128],"tags":[178,191,132,129,189,190,158],"class_list":["post-1173","post","type-post","status-publish","format-standard","hentry","category-esp8266","tag-bme280","tag-co2","tag-esp12","tag-esp8266","tag-mh-z19","tag-pam2305","tag-tsl2561"],"_links":{"self":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1173"}],"version-history":[{"count":17,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1173\/revisions"}],"predecessor-version":[{"id":1638,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1173\/revisions\/1638"}],"wp:attachment":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}