After a couple of weeks I had free time and I decided to play around with the sensors and my second project in which I wanted to use it. int setrangeA_i; // LCD R/ W pin to ground Arduino | 1 CO2 sensor MH-Z19B Arduino | 2 CO2 sensor MH-Z19B delay(100); After receiving the second sensor, I checked it (in order to open a dispute in case of a fail). lcd.print("**Please wait!**"); setrangeA_crc = 255 – setrangeA_crc; It’s not about calibration, but about their internal "conversion factor". //———– configure 1 sensor At the same time, the voltage from the analog output also does not solve the situation – it just as tightly corresponds to the UART readings. *** (p1. of course, according to the datasheet only after > 20 minutes of work on the street, p2. first 20 minutes of work on the street, then in the doorway, and as soon as I register the growth – zeroing). And if 2 sensors are in the same environment, 1 shows 940ppm with an analog output of 700mV, and the second shows 1300ppm with an output of 820mV, then if the first one counts its 1300ppm when the concentration increases, then its analog output will give 820mV in the same way (while the second sensor will already show about 1900ppm / 990mV) pinMode(zm1_pwm_pin, INPUT); lcd.print("*Now Warming Up*"); I apologize for the slightly chaotic narration, there were no plans to write a review, this is rather a dry squeeze of facts for those who want to use these and similar sensors in their homemade products. There is very little free time, so I didn’t “comb” the text. Then there was no time, later there were more ideas for using the second sensor in another device, and as a result, the second sensor was ordered. //——– Force operation in the 5000ppm range int ppm1 = 0; // LCD D6 pin to digital pin 3 byte setrangeA_cmd[9] = ; // LCD RS pin to digital pin 7

And again the carbon dioxide (CO2) sensor "MH-Z19B". Moreover, for all 3 outputs (UART, PWM, Analog), the data correlates with each other. int ppm2 = 0; I hope this information will be useful to someone. After a week of torment and various tests, I came to disappointing conclusions – you can use these sensors in DIY only if you buy them in quantities of 10 pieces in different stores and then select them. In order not to introduce “own CO2” from skin or pulmonary respiration, I calibrated the sensors through a closed balcony door, for which I extended
2 buttons on the trains under the door, the door of course closed. byte setrangeA_crc = 0; TWO zm1.begin(9600); pin 10 | PWM pin 11 | PWM // LCD D5 pin to digital pin 4 6) 5V3.3V level converters and ordinary resistive dividers. int anlg1 = 0; // LCD D7 pin to digital pin 2 Calibration for "street" air did not change the situation. int zm2_ss = 0; // LCD connection (1602 with HD44780 controller) 8) a lot of different sketches, 3 different arduins (the last one turned out to be just like that, and not on purpose) Thank you for your understanding. 5) power directly from the power bank I was alerted by the fact that playing with one or the second sensor, I got different ppm readings in the room. // 10K resistor: ends to 5V and ground, wiper to LCD VO pin byte cmd[9] = ; // LCD VCC pin to 5V int zm1_co2 = 0; pinMode(zm2_a_pin, INPUT); unsigned char response1[9]; 2) air calibration "just over 400ppm" – i.e. at the same time I bring the sensors from the street into the doorway and as soon as one of them starts to register an increase in CO2, I simultaneously calibrate both to 400 4) a command to force operation in the range of 5000ppm pinMode(zm2_pwm_pin, INPUT); 1) calibration (multiple) by "street air" by shorting the Hd pin for a while > 7sec So, at first, one sensor was bought (I wanted to assemble an air monitor according to articles on Habré and on Muska) and while driving all the other details played a little with him. lcd.setCursor(0, 1); // LCD Enable pin to digital pin 6 setrangeA_crc = 1; Therefore, there will be no pictures here, a little text and dry conclusions. For those who want a review of the sensor, I’ll leave a couple of links to worthy articles — reviews: lcd.setCursor(0, 0); — Connecting Sensors————
This review is more of a cautionary review of a working sketch for reading sensors on all 3 channels. pin A4 | Vo pin A5 | Vo */ 3) a command to disable ABC (self-calibration) when initializing sensors pin A0 | RX pin A2 | RX void setup() // Serial.begin(9600); // needed only for debugging, there is no console output https://jiji.com.et/motorcycles-and-scooters/white in this sketch, not used. int zm1_ss = 0; if ( !(setrangeA_response[0] == 0xFF Overview – Caution

int zm2_t = 0; At the same time, both sensors normally showed 400ppm on the street. unsigned char response2[9]; pin A1 | TX pin A3 | TX int zm1_t = 0; 7) the installation was done with flat trains of the minimum comfortable length. int zm2_co2 = 0; // LCD VSS pin to ground zm1.readBytes(setrangeA_response, 9); PS. ONE ATTENTION! We connect the UART data bus to Arduino only through a 5V 3.3V level converter GND and Vcc (ground and power) of the sensors are connected respectively to the ground and to the 5V arduino First connects to: Second connects to: lcd.begin(16, 2); while(zm1_pwm_pin == LOW || zm2_pwm_pin == LOW ) lcd.setCursor(0, 0); pinMode(zm1_a_pin, INPUT); // LCD D4 pin to digital pin 5 my almost weekly throwing with these sensors – I tried everything! but the matter has not moved forward – they stupidly calculate the concentration in different ways and derive different values. The sensor worked just as “correctly” as the first one. /* byte abc[9] = ; for (setrangeA_i = 1; setrangeA_i < 8; setrangeA_i ) setrangeA_crc =setrangeA_response[setrangeA_i]; What I tried (individually and combining several or all of the following): int anlg2 = 0; unsigned char setrangeA_response[9]; And not within the margin of error, but very different, it reached a double difference. > 2 identical (MH-Z19B) sensors were purchased at different times in different stores with an interval of 3 months. zm1.write(abc, 9); // disabling auto-calibration zm1.write(setrangeA_cmd,9);