Andrey Ovcharov

Professional Software Engineer and hobbyist Hardware enthusiast

Andrey Ovcharov

Comparison of CO2 sensors MH-Z19B and CCS811

Having two different CO2 sensors it makes sense to put them together and compare reading over some period of time.

You can read more about these sensors here:

And here is the picture of them:

Carbon dioxide sensors - MH-Z19B and CCS811
Carbon dioxide sensors - MH-Z19B and CCS811

Sensors parameters, according to the manufacturer’s datasheets:

  MH-Z19B CCS811
Sensor type infrared metal oxide
Voltage 4.5V - 5.5V 1.8V - 3.6V
Average current 60mA 30mA
Measurement range 4000 - 5000ppm 400 - 29206ppm
Interface UART, PWM I2C
Price ~15 euro ~8 euro

Both sensors are designed to measure the level of carbon dioxide indoors.

The CCS811 sensor has many advantages over MH-Z19B - significantly smaller size, lover voltage and current, lower price.

For comparison, both sensors were connected to ESP8266 development boards with very similar firmware. Readings were collected every 10 seconds and sent by MQTT protocol to a Raspberry PI microcomputer with mosquitto - influxdb - grafana stack. The comparison ran for about one week, the sensors were on my working desk in a few centimetres from each other.

As a result, I have got the following chart:

CO2 levels chart for 7 days

In general, readings from both sensors visibly correlate. They have very similar ups and downs. However, CCS811 reacts much faster and with higher magnitude. I expected that the lines from the sensors will be much closer.

In the very beginning, the CCS811 showed a very strange peak of 8000ppm. The values returned to more or less normal after some time.

Peak values int the beginning

Other than that, the readings look quite similar. Here, for example, Monday’s chart:

Chart for one day

Charts in the night time look more flat. It was quite chilly in the evening and windows were closed, so the values are higher than 400ppm for fresh air. In the morning it quickly became stuffy and I have opened the window. In the evening it was chilly again.


The result is very disappointing. I expected more comparable values from the sensors. Look, it’s really strange when one of the modules shows less than 1000ppm while the other one lying in just a few centimetres away shows more than 2000ppm. Which one is right? Or both of them are incorrect?

Probably the modules itself are of bad quality. Probably temperature and humidity correction added to CCS811 will improve the results. Or, maybe, the case with filters like one in the MH-Z19B will help here. I don’t know.

Overall, CSS-811 reacts much faster. When I breathe directly on the sensor the value changes immediately and return back to normal almost in real-time.

Yes, both sensors react to the CO2 concentration. Changing the values depending on the environment changes clearly says about that. But which one is correct? To answer that question I need to repeat the experiment but together with a calibrated CO2 sensor which I do not have at the moment. Maybe at some point in the future.