CO2 calibration guide - OtagoPolytechnic/Air-Quality-Monitoring-System GitHub Wiki
Why calibration is needed
Overtime sensors drift from factory calibration as the sensor components wear. This means sensor reading accuracy is compromised. You cannot reliably compare different classrooms to each other and could mislead our end users.
MH-Z19B
There are 2 types of calibration for the MH-Z19B. Auto and Manual.
Auto calibration works by storing the lowest reading across a defined span of time (usually 24 hours) and setting that value as a base (400ppm) reading. For example if a room sensor over the course of 24hours reads max 2000 and min 500ppm, then at the 24 hour mark it now will read 100ppm lower and it can work the opposite way, if the lowest reading was 300ppm then the next day will read 100ppm higher.
This is sometimes good as it corrects sensor degradation and helps keep the sensor from drifting to extreme values. However for our purpose this way isn't ideal. This is because each classroom have unique ventilation, sizes and sensor placement. Taking the min reading as the baseline for the next day means we can no longer compare classrooms. For example D202 last class was 5pm and they left all the windows and doors shut whist D201 last class was at 1pm and windows were left cracked, their minimum CO2 ppm will be different when the sensor auto calibrates.
Manual calibration works by placing a sensor in a clean air environment for at least 20 minuets then jumping pins HD to GND for 7 seconds. This sets the current air quality as 400ppm. This is ideal when every room sensor is done in the same environment at the same time so they all calibrate at the same CO2 environment. While we can't verify that they are in fact in a 400ppm environment at least they all have the same baseline which means when one class reads 1000ppm and another 500ppm you can say with confidence that there is about a 500ppm difference. This is more meaningful for us as future goals for our project involves identifying poor vented classrooms and test CO2 lowering techniques such as adding plants.
Some downsides of manual calibrating include having to have scheduled downtime to calibrate all the room sensors together, unknown amount of time before they start to drift needing recalibrating, calibrating in bulk means the first calibrated device would most likely be different to the last calibrated device as each device takes around 15 seconds to set and breathing close to them will affect their fresh environment.
How to manually calibrate the MH-Z19B
❗Only tested on 2024 CO2 room devices using the Adafruit feather 32u4 boards with auto calibration set to false (Arduino sketch in repo)❗
- Prepare a empty classroom with as many windows open with good ventilation
- Allow for the classroom to ventilate (best time early morning before classes or late at night well after the last class)
- Gather all the room sensors
- For convenience remove their casing so the CO2 sensor is easily accessible (Make sure you keep casing close as to not forget what device is what)
- Leave the sensors close to each other powered on, preferably by a open window or in a place with good air flow
- Leave sensors for at least 20 minutes, longer the better
- When ready get a M-M jumper wire and one by one connect pin HD to GND for at least 7 seconds (See image below for pin layout)
- When all are done leave the room again for a while and check they are reading around 400ppm (+-100ppm)
- If their are no abnormalities they can be returned to their specified room
Tips:
- If one sensor seems quite off compared to the others after calibrated try and bridge the HD-GND pins again.
- When calibrating try to be mindful of breathing, breathing directly on the sensor can greatly affect accuracy (Investigate masks?)
How long does manual calibration last?
It has been a week and devices have been power cycled multiple times and kept calibration. No noticeable deviation between readings, co2-03 have been reading consistently a little higher however it was the last to be calibrated and could have been influenced slightly by me when calibrating 04 and 05 first. This backs up the need to be mindful of breathing around sensors when calibrating.
Given the its been a week and no change between readings, the next test will be to calibrate them all again, put in their own classrooms and brought back to a testing environment after about a month to test accuracy.
How to test accuracy periodically after calibration?
Follow steps 1-6 and check they still read within +-250ppm (To be decided). If one or more devices read consistently high or low than the rest then a bulk manual calibration will be needed again. Make sure to log each test and note each room sensor trends (take the median of the readings and record which devices are reading higher/lower and record by how much).