{"id":24867,"date":"2022-03-12T08:23:14","date_gmt":"2022-03-11T23:23:14","guid":{"rendered":"https:\/\/www.souichi.club\/?p=24867"},"modified":"2022-03-19T17:15:36","modified_gmt":"2022-03-19T08:15:36","slug":"co2sensor-mhz19c","status":"publish","type":"post","link":"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/","title":{"rendered":"ESP32-WROOM-32, CO2 sensor (MH-Z19C) and LCD"},"content":{"rendered":"<ul class=\"bogo-language-switcher list-view\"><li class=\"en-US en current first\"><span class=\"bogoflags bogoflags-us\"><\/span> <span class=\"bogo-language-name\"><a rel=\"alternate\" hreflang=\"en-US\" href=\"https:\/\/www.souichi.club\/en\/wp-json\/wp\/v2\/posts\/24867\/\" title=\"English\" class=\"current\" aria-current=\"page\">English<\/a><\/span><\/li>\n<li class=\"ja last\"><span class=\"bogoflags bogoflags-jp\"><\/span> <span class=\"bogo-language-name\"><a rel=\"alternate\" hreflang=\"ja\" href=\"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/24867\/\" title=\"Japanese\">\u65e5\u672c\u8a9e<\/a><\/span><\/li>\n<\/ul>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f50ad9d6d91\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #454e5c;color:#454e5c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #454e5c;color:#454e5c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f50ad9d6d91\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#CO2_Sensor\" >CO2 Sensor<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#What_is_NDIR\" >What is NDIR?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#specification\" >specification<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Connector\" >Connector<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#library\" >library<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Installing_the_library_for_MH-Z19\" >Installing the library for MH-Z19<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Installation_of_I2C_LCD_Library\" >Installation of I2C LCD Library<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#PWN_Connection\" >PWN Connection<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Wiring_Diagram\" >Wiring Diagram<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Sketch_PWM\" >Sketch (PWM)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Supplemental_Explanation\" >Supplemental Explanation<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Method_of_calculating_ppm\" >Method of calculating ppm<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#readCO2PWM_function\" >readCO2PWM() function<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Execution_Result\" >Execution Result<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Zero_Calibration\" >Zero Calibration<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#UART_Connection\" >UART Connection<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Wiring_Diagram-2\" >Wiring Diagram<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Sketch_UART\" >Sketch (UART)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Supplemental_Explanation-2\" >Supplemental Explanation<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Carbon_Dioxide_Concentration\" >Carbon Dioxide Concentration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Checksum\" >Checksum<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Temperature_acquisition\" >Temperature acquisition<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Auto_Calibration\" >Auto Calibration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.souichi.club\/en\/m5stack\/co2sensor-mhz19c\/#Interval\" >Interval<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CO2_Sensor\"><\/span>CO2 Sensor<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The CO2 sensor (MH-Z19C) was used to measure the concentration of CO2 in the air with ESP32-WROOM-32, and the results were displayed on the LCD (liquid crystal display) connected via I2C.<\/p>\n\n\n\n<p>I wanted to measure how the carbon dioxide concentration increases when there is no ventilation indoors.<\/p>\n\n\n\n<p>The main features of the MH-Z19C are as follows<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Measures CO2 concentration in the air using the NDIR (Non Dispersive InfraRed) method<\/li><li>Two output patterns: PWN output and UART (Universal Asynchronous Receiver\/Transmitter) connection<\/li><li>Temperature can be detected simultaneously (only with UART connection)<\/li><\/ul>\n\n\n\n<p>Note that the white sheet attached to the body should not be removed.<\/p>\n\n\n\n<p>It is tempting to peel it off, but it is supposed to be used without peeling it off.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-04.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-04.jpg?resize=480%2C368&#038;ssl=1\" alt=\"MH-Z19C\" class=\"wp-image-24425\" width=\"480\" height=\"368\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-04.jpg?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-04.jpg?resize=768%2C588&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-04.jpg?resize=1536%2C1177&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_NDIR\"><\/span>What is NDIR?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>NDIR (Non-Dispersive InfraRed) is a method of measuring CO2 concentration using infrared rays of a specific wavelength (around 3 to 5 \u03bcm).<\/p>\n\n\n\n<p>CO2 molecules absorb infrared rays at a wavelength of 4.26 \u03bcm, so the higher the concentration, the more strongly they absorb it.<\/p>\n\n\n\n<p>This method uses this property to calculate CO2 concentration from the absorption rate of infrared radiation from light sources (LEDs, incandescent bulbs, MEMS heaters, etc.).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"specification\"><\/span>specification<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The detailed specifications are as follows<\/p>\n\n\n<figure class=\"wp-block-table is-style-regular\">\n<table class=\"r_table01\">\n<tbody>\n<tr>\n<td class=\"r_td30\">\n<p>Detectable gases<\/p>\n<\/td>\n<td>\n<p>carbon dioxide<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>voltage<\/p>\n<\/td>\n<td>\n<p>5.0 \u00b1 0.1V DC<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>electric power<\/p>\n<\/td>\n<td>\n<p>Average 40 mA or less, maximum 125 mA(@5V power supply)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Interface voltage<\/p>\n<\/td>\n<td>\n<p>3.3 V (5V compatible)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Detection range<\/p>\n<\/td>\n<td>\n<p>PMW\uff1a400 \uff5e 2,000 ppm<\/p>\n<p>UART\uff1a400 \uff5e 10,000 ppm<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>accuracy<\/p>\n<\/td>\n<td>\n<p>\u00b1(50 ppm \uff0b 5%)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Preparation time<\/p>\n<\/td>\n<td>\n<p>Requires preheat time of about 1 minute<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Operating humidity and temperature<\/p>\n<\/td>\n<td>\n<p>humidity\uff1a0 \uff5e 95%(No condensation)<\/p>\n<p>temperature\uff1a\uff0d20 \uff5e 60 \u2103<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Connector\"><\/span>Connector<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The connector has 5 pins on the left side and 4 pins on the right side when viewed from the back.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-05.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-05.jpg?resize=480%2C323&#038;ssl=1\" alt=\"MH-Z19C(back)\" class=\"wp-image-24426\" width=\"480\" height=\"323\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-05.jpg?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-05.jpg?resize=768%2C516&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-05.jpg?resize=1536%2C1033&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/figure>\n\n\n<figure class=\"wp-block-table is-style-regular\">\n<table class=\"r_table01\">\n<tbody>\n<tr>\n<td class=\"r_td30\">\n<p>HD<\/p>\n<\/td>\n<td>\n<p>Connect to GND for at least 7 seconds when calibrating zero point (400 ppm)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>SR<\/p>\n<\/td>\n<td>\n<p>Not used (Reserved)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Tx<\/p>\n<\/td>\n<td>\n<p>UART\uff08TXD\uff09output<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Rx<\/p>\n<\/td>\n<td>\n<p>UART\uff08RXD\uff09 input<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Vo<\/p>\n<\/td>\n<td>\n<p>Not use<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>PWN<\/p>\n<\/td>\n<td>\n<p>PWN output<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>AOT<\/p>\n<\/td>\n<td>\n<p>Not use<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GND<\/p>\n<\/td>\n<td>\n<p>GND<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Vin<\/p>\n<\/td>\n<td>\n<p>Vin\uff085V input\uff09<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"library\"><\/span>library<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Install the necessary libraries in the Arduino IDE beforehand.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Installing_the_library_for_MH-Z19\"><\/span>Installing the library for MH-Z19<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The PWN connection has simple logic, so CO2 concentration can be obtained with simple coding without using the library.<\/p>\n\n\n\n<p>However, in the case of UART (serial connection), it is easier to use the library because there are troublesome processes such as commands to turn on\/off calibration, calculation of checksum of readings, and quantification of values.<\/p>\n\n\n\n<p>I installed the &#8220;MH-Z CO2 Sensors&#8221; library from the Arduino IDE by going to Tools &gt; Manage libraries and searching for &#8220;MH-Z19\u2033.<\/p>\n\n\n\n<p>Github is <a href=\"https:\/\/github.com\/tobiasschuerg\/MH-Z-CO2-Sensors\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-01.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-01.png?resize=492%2C277&#038;ssl=1\" alt=\"Installation of MH-Z Co2 Sensors library\" class=\"wp-image-24877\" width=\"492\" height=\"277\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-01.png?w=984&amp;ssl=1 984w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-01.png?resize=768%2C432&amp;ssl=1 768w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Installation_of_I2C_LCD_Library\"><\/span>Installation of I2C LCD Library<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Install the library for LCD (liquid crystal display) with I2C connection in Arduino IDE.<\/p>\n\n\n\n<p>Please <a href=\"https:\/\/www.souichi.club\/en\/m5stack\/i2c-lcd\/#Advance_preparation\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"refer to the previous article\">refer to the previous article<\/a> for the installation procedure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PWN_Connection\"><\/span>PWN Connection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>First, try a simple PWN connection.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wiring_Diagram\"><\/span>Wiring Diagram<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The wiring diagram is as follows<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-02.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-02.png?resize=960%2C540&#038;ssl=1\" alt=\"PCo2 sensor and I2C LCD wiring diagram (PWN connection)\" class=\"wp-image-24881\" width=\"960\" height=\"540\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-02.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-02.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-02.png?resize=1536%2C864&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n\n\n\n<p>The pin layout of the ESP32-WROOM-32 module used in this project is the same as that of the ESP32 DEVKIT V1 (30 pins).<\/p>\n\n\n\n<p>On the board, the bottom left pin is VIN, but it is actually a 5V pin.<\/p>\n\n\n\n<p>Please <a href=\"https:\/\/www.souichi.club\/en\/m5stack\/esp32-pin-layout\/#ESP32_DEVKIT_V1\" target=\"_blank\" rel=\"noreferrer noopener\">refer to this article<\/a> for the pin assignment of ESP32 DEVKIT V1.<\/p>\n\n\n\n<p>And <a href=\"https:\/\/www.souichi.club\/en\/m5stack\/i2c-lcd\/\" target=\"_blank\" rel=\"noreferrer noopener\">please refer to the previous article<\/a> about the LCD (Liquid Crystal Display) connected with I2C.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Sketch_PWM\"><\/span>Sketch (PWM)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The following is a sample sketch of the PWM connection between the sensor and ESP32-WROOM-32.<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-cpp\">\/*\n * Display the measured value of Co2 Sensor (MH-Z19C) on I2C LCD\n * Co2 Sensor:GPIO13\n * LCD:I2C\n *\/\n\n#include &lt;MHZ.h&gt; \/\/ Co2 Sensor\n#include &lt;LiquidCrystal_I2C.h&gt; \/\/ I2C LCD\n\n#define co2pwmPin 13 \/\/ GPIO13\n\nLiquidCrystal_I2C lcd(0x27,16,2);  \/\/ I2C addr\u300116x2 \nMHZ co2(co2pwmPin, MHZ19C);\n\nvoid setup() {\n    Serial.begin(115200);\n    lcd.init();\n    lcd.backlight();\n    lcd.clear();\n    lcd.setCursor(0, 0);\n    lcd.print(\"Program Start\");\n    \/\/ Serial.println(\"Program Start\");\n    pinMode(co2pwmPin, INPUT);\n    delay(100);\n    if (co2.isPreHeating()) {\n        \/\/ Serial.println(\"Preheating\");\n        lcd.clear();\n        lcd.setCursor(0, 0);\n        lcd.print(\"Preheating\");\n        while (co2.isPreHeating()) {\n            \/\/ Serial.print(\".\");\n            delay(5000);\n        }\n        \/\/ Serial.println();\n    }    \n}\n\nvoid loop() {\n    int ppm_pwm = co2.readCO2PWM();\n    \/\/ Serial.println(\"PPM = \" + String(ppm_pwm));\n    lcd.clear();\n    lcd.setCursor(0, 0);\n    lcd.print(\"Co2 conc\");\n    lcd.setCursor(0, 1);\n    lcd.print(\"PPM = \" + String(ppm_pwm));\n}<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Supplemental_Explanation\"><\/span>Supplemental Explanation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Method_of_calculating_ppm\"><\/span>Method of calculating ppm<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>In the case of PWN, ppm is calculated as the ratio of the High state in approximately 1,004 milliseconds.<\/p>\n\n\n\n<p>The data is taken from the following datasheet.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-03.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-03.png?resize=639%2C391&#038;ssl=1\" alt=\"Calculation Method\" class=\"wp-image-24423\" width=\"639\" height=\"391\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-03.png?w=852&amp;ssl=1 852w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-03.png?resize=768%2C470&amp;ssl=1 768w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" \/><\/a><\/figure>\n\n\n\n<p>An example calculation for 400 ppm is shown below.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>TH: Number of seconds (in milliseconds) of High state<\/li><li>T: Output time (1,004 ms \u00b15%)<\/li><\/ul>\n\n\n\n<p>The formula is 2,000 \u00d7 (TH-2ms)\/(T-4ms).<\/p>\n\n\n\n<p>If 202 milliseconds out of 1004 milliseconds is High, then<\/p>\n\n\n\n<p>2,000 \u2715 (202 &#8211; 2) \u00f7 (1,004 &#8211; 4) = 400 ppm<\/p>\n\n\n\n<p>The result is as follows.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"readCO2PWM_function\"><\/span>readCO2PWM() function<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>At the beginning of the loop (line 39), readCO2PWM() of the library for MH-Z19 (installed in C:\\Users\\username\\Documents\\Arduino\\libraries\\MH-Z_CO2_Sensors by default) is called.<\/p>\n\n\n\n<p>The contents of the function in MHZ.cpp are as follows (*<a href=\"https:\/\/github.com\/tobiasschuerg\/MH-Z-CO2-Sensors\/blob\/master\/MHZ.cpp\" target=\"_blank\" rel=\"noreferrer noopener\">from GitHub<\/a>)<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-cpp\">int MHZ::readCO2PWM() {\n  if (!PwmConfigured) {\n    if (debug) Serial.println(F(\"-- pwm is not configured \"));\n    return STATUS_PWM_NOT_CONFIGURED;\n  }\n  \/\/if (!isReady()) return STATUS_NOT_READY; not needed?\n  if (debug) Serial.print(F(\"-- reading CO2 from pwm \"));\n  unsigned long th, tl, ppm_pwm = 0;\n  do {\n    if (debug) Serial.print(\".\");\n    th = pulseIn(_pwmpin, HIGH, 1004000) \/ 1000;\n    tl = 1004 - th;\n    ppm_pwm = 2000 * (th - 2) \/ (th + tl - 4);\n  } while (th == 0);\n  if (debug) {\n    Serial.print(F(\"n # PPM PWM: \"));\n    Serial.println(ppm_pwm);\n  }\n  return ppm_pwm;\n}<\/code><\/pre>\n\n\n<p>In lines 9-14, the pulseIn function measures the time (microseconds) of High and calculates the CO2 concentration based on the ratio in 1,004 milliseconds.<\/p>\n\n\n\n<p>It loops while th=0, that is, until Hign becomes 0 (=Low), but I am a little concerned about the fact that it is fixed at 1,004 milliseconds.<\/p>\n\n\n\n<p>According to the datasheet, the value is 1,004\u00b15%, so if you want to consider the error strictly, it would be better to measure the time until Hign \u2192 Low \u2192 Hign again, and use that value as the denominator to detect a more accurate value.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Execution_Result\"><\/span>Execution Result<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The results are as follows.<\/p>\n\n\n\n<p>The value of 240 ppm is displayed, but this value is too low since the concentration of carbon dioxide in the atmosphere is about 400 ppm.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-07.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-07.jpg?resize=480%2C346&#038;ssl=1\" alt=\"Execution result when PWM is connected\" class=\"wp-image-24442\" width=\"480\" height=\"346\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-07.jpg?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-07.jpg?resize=768%2C553&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-07.jpg?resize=1536%2C1106&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/a><\/figure>\n\n\n\n<p>At first I thought it was because the power had just been turned on and zero calibration had not been done, but something was wrong.<\/p>\n\n\n\n<p>After some research, I found a description that the part of the aforementioned formula where 2,000 is multiplied by 5,000 needs to be set to 5,000.<\/p>\n\n\n\n<p>I am not sure if the datasheet is wrong, but I modified the readCO2PWM() function in MHZ.cpp as follows, and obtained the same value as when connected to UART.<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-cpp\">\n    \/\/ ppm_pwm = 2000 * (th - 2) \/ (th + tl - 4);\n    ppm_pwm = 5000 * (th - 2) \/ (th + tl - 4);\n<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Zero_Calibration\"><\/span>Zero Calibration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The datasheet states that with the default setting, auto-calibration occurs every 24 hours and zero calibration is performed based on 400 ppm.<\/p>\n\n\n\n<p>The details of the algorithm are not clear, but it appears to zero-calibrate based on the lowest concentration measured in a 24-hour period, which is 400 ppm.<\/p>\n\n\n\n<p>The auto-calibration is &#8220;suitable for office and home environments, but not for agricultural greenhouses, farms, refrigerators, etc.&#8221; The statement was made in the report.<\/p>\n\n\n\n<p>It is not suitable for environments where carbon dioxide concentrations do not remain near 400 ppm throughout the day.<\/p>\n\n\n\n<p>The automatic calibration can be turned on or off by sending the 0x79 command when connected to a UART (not possible when connected to a PWN).<\/p>\n\n\n\n<p>For manual zero calibration, connect the HD pin to GND for at least 7 seconds in air (at 400 ppm CO2 concentration).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"UART_Connection\"><\/span>UART Connection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Then try UART (serial connection).<\/p>\n\n\n\n<p>This one is more multifunctional, allowing the user to change the automatic calibration settings and to obtain the temperature at the same time as the CO2 concentration.<\/p>\n\n\n\n<p>If the pins are available, the UART connection seems to be better.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wiring_Diagram-2\"><\/span>Wiring Diagram<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The wiring diagram is as follows<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-03.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-03.png?resize=960%2C540&#038;ssl=1\" alt=\"UART-connected CO2 sensor and I2C LCD wiring diagram\" class=\"wp-image-24925\" width=\"960\" height=\"540\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-03.png?w=1920&amp;ssl=1 1920w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-03.png?resize=768%2C432&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-en-03.png?resize=1536%2C864&amp;ssl=1 1536w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>LCD is the same as in PWM connection<\/li><li>Connect TX2 of ESP32-WROOM-32 to Rx of MH-Z19C and RX2 to Tx*.<\/li><\/ul>\n\n\n\n<p>*There is no need to be concerned about hardware serial pins (UART0, 1, 2) since the pins are specified using SoftwareSerial in the library for the MH-Z19C.<\/p>\n\n\n\n<p>Any pins other than GPIO6 to GPIO11, GPIO34, and GPIO35 can be communicated with SoftwareSerial.<\/p>\n\n\n\n<p>In fact, measurement was possible by connecting to GPIO32 and 33.<\/p>\n\n\n\n<p>This time, I used RX2 (GPIO16) and TX2 (GPIO17) pins because they were free.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Sketch_UART\"><\/span>Sketch (UART)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The following is a sketch of the UART (serial connection) connection.<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-cpp\">\/*\n * Display the measured value of CO2 Sensor (MH-Z19C) on I2C LCD\n * Co2 Sensor:UART\n * LCD:I2C\n *\/\n\n#include &lt;MHZ.h&gt; \/\/ Co2 Sensor\n#include &lt;LiquidCrystal_I2C.h&gt; \/\/ I2C LCD\n\n#define RX_PIN 16 \/\/ GPIO16\n#define TX_PIN 17 \/\/ GPIO17\n\nLiquidCrystal_I2C lcd(0x27,16,2);  \/\/ I2C addr\u300116x2 \nMHZ co2(RX_PIN, TX_PIN, MHZ19C);\n\nvoid setup() {\n    Serial.begin(115200);\n    lcd.init();\n    lcd.backlight();\n    lcd.clear();\n    lcd.setCursor(0, 0);\n    lcd.print(\"Program Start\");\n    delay(100);\n    if (co2.isPreHeating()) {\n        lcd.clear();\n        lcd.setCursor(0, 0);\n        lcd.print(\"Preheating\");\n        while (co2.isPreHeating()) {\n            delay(5000);\n        }\n    }\n    co2.setAutoCalibrate(true);\n}\n\nvoid loop() {\n    int ppm_uart = co2.readCO2UART();\n    lcd.clear();\n    lcd.setCursor(0, 0);\n    lcd.print(\"Co2:\" + String(ppm_uart) + \" ppm\");\n\n    int temperature = co2.getLastTemperature();\n    lcd.setCursor(0, 1);\n    lcd.print(\"temp:\" + String(temperature) + \" c\");\n    delay(120000);\n}<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Supplemental_Explanation-2\"><\/span>Supplemental Explanation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The following is a supplementary explanation of the code.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Carbon_Dioxide_Concentration\"><\/span>Carbon Dioxide Concentration<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The following code is used to obtain the CO2 concentration from the sketch.<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-cpp\">    int ppm_uart = co2.readCO2UART();<\/code><\/pre>\n\n\n<p>The data sheet reads as follows<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-13.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-13.png?resize=720%2C402&#038;ssl=1\" alt=\"Read CO2 concentration\" class=\"wp-image-24457\" width=\"720\" height=\"402\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-13.png?w=1439&amp;ssl=1 1439w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-13.png?resize=768%2C429&amp;ssl=1 768w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/figure>\n\n\n\n<p>The specification is that setting 0x86 in Byte2 and sending command returns the values (HIGH and LOW) in Byte2 and Byte3.<\/p>\n\n\n\n<p>The CO2 concentration is obtained by calculating (HIGH * 256) + LOW.<\/p>\n\n\n\n<p>Byte8 is a checksum and is used for consistency check in case other Bytes cannot be read correctly for some reason.<\/p>\n\n\n\n<p>The above process is performed in the readCO2UART() function of MHZ.cpp, so all you have to do is call the function.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Checksum\"><\/span>Checksum<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The checksum is calculated as follows<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-14.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-14.png?resize=785%2C491&#038;ssl=1\" alt=\"Checksum Calculation Method\" class=\"wp-image-24460\" width=\"785\" height=\"491\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-14.png?w=1046&amp;ssl=1 1046w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-14.png?resize=768%2C481&amp;ssl=1 768w\" sizes=\"auto, (max-width: 785px) 100vw, 785px\" \/><\/a><\/figure>\n\n\n\n<p>Byte0 -\uff08Byte1+ Byte2+  Byte3+  Byte4+  Byte5+  Byte6+  Byte7\uff09\uff0b 0x01\uff1d Byte8<\/p>\n\n\n\n<p>When transmitting, Byte8 is assembled and set to satisfy the above equation.<\/p>\n\n\n\n<p>When receiving, Byte8 is calculated from Byte0 to Byte7, compared with the actual value, and checked for any inconsistencies such as data loss or garbled characters along the way.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Temperature_acquisition\"><\/span>Temperature acquisition<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>Although not listed in the datasheet, it appears that the temperature is set in Byte4 of the received data.<\/p>\n\n\n\n<p>The temperature is obtained by adjusting the value of Byte4 (in the library, 44 is subtracted), but since this function is not listed in the datasheet, it is better to think of it as a rough guide.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Auto_Calibration\"><\/span>Auto Calibration<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>By default, automatic calibration is turned on at the factory.<\/p>\n\n\n\n<p>It was possible to turn auto-calibration on (true)\/off (false) with the following code.<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-cpp\">    co2.setAutoCalibrate(true);<\/code><\/pre>\n\n\n<p>The datasheet states that it is turned on and off by sending a code of 0x79.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a class=\"r_image\" href=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-11.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-11.png?resize=633%2C178&#038;ssl=1\" alt=\"Self-calibration for Zero Point\" class=\"wp-image-24454\" width=\"633\" height=\"178\" srcset=\"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-11.png?w=844&amp;ssl=1 844w, https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-11.png?resize=768%2C216&amp;ssl=1 768w\" sizes=\"auto, (max-width: 633px) 100vw, 633px\" \/><\/a><\/figure>\n\n\n\n<p>When Byte3 is 0xA0, the auto-calibration function is turned on; when Byte3 is 0x00, the auto-calibration function is turned off.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Interval\"><\/span>Interval<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>The reason why the measurement interval is set to 2 minutes is because a measurement error occurred when the interval was too short.<\/p>\n\n\n\n<p>Although I could not find a description of the measurement interval in the datasheet, it may not be suitable for applications where measurements are repeated too frequently.<\/p>\n\n\n\n<p>When PWM is connected, CO2 concentration could be measured at 5-second intervals without any problem.<\/p>\n\n\n<pre class=\"line-numbers\"><code class=\"lang-cpp\">    delay(120000);<\/code><\/pre>\n\n\n<p>This concludes this article.<\/p>\n\n\n<div class=\"postscript_balloon\">Finally.<\/div>\n\n\n<p>I hope this article will be useful to someone somewhere.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Article on ESP32-WROOM-32 using CO2 sensor (MH-Z19C) to measure CO2 concentration in the air and display the result on LCD<\/p>\n","protected":false},"author":5,"featured_media":24498,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/www.souichi.club\/?p=24411","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[238],"tags":[],"class_list":["post-24867","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-m5stack","en-US"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.souichi.club\/wp-content\/uploads\/co2sensor-mhz19c-15.jpg?fit=1858%2C1303&ssl=1","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/24867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/comments?post=24867"}],"version-history":[{"count":27,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/24867\/revisions"}],"predecessor-version":[{"id":24951,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/posts\/24867\/revisions\/24951"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/media\/24498"}],"wp:attachment":[{"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/media?parent=24867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/categories?post=24867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.souichi.club\/wp-json\/wp\/v2\/tags?post=24867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}