I felt a concern about insufficient ventilation in our home. So, I decided to build a CO2 monitor.
I found graphs of sensitivity of MQ-135 for hydrogen as a function of temperature and relative humidity here:
With excel I derived a fit to these data with the formula:
f_RH_T = a + b*RH + c*T + d*T*RH
With T in degrees C and RH as a fraction (number in between 0 and 1).
I calculated the relative humidity from a wetted temperature sensor and a dry temperature sensor.
The CO2 concentration is calculated from the measured resistance and the temperature/relative humidity correction. It may be written as:
CO2 = 410*ppm*(Rs/f_RH_T / Rs410/f_RH_T_410)^b
Where the exponent b is equal to -2.769 according to Mad Frog. And where Rs410 is the sensor resistance measured in clean air (410 ppm of CO2) and f_RH_T_410 is the correction factor at the moment that the clean air sensor resistance is measured. Here we assume that the correction factor as a function of relative humidity and temperature is equal for CO2 and hydrogen. I do not have any calibration gasses, so I cannot check whether this is true or not. As long as the calibration is done under similar conditions as the readout, this is not very important. If however, the calibration is done at 10 degrees C and the readout is done at 30 degrees C, this may introduce a significant error.
I spent quite some time to get the SD card code to accept dynamic names for the files (depending on the date). The trick was to change the SD.cpp card library file.
Change: int pathidx;
To: int pathidx = 0;
As suggested on the Arduino forum:
Many thanks for this suggestion, it really fixed the problem!
Her another picture of my setup, where you can see how I measure the temperature with a wetted sensor. The brownish material is a piece of paper coffee filter that transports the water from the reservoir to the sensor. I covered the sensor with a plastic bag to prevent direct contact of the sensor with the water in the paper.
Any questions or remarks? Let me know!