Carbon Monoxide Detector

What you need:

Using the gases sensitivity graph provided by the supplier as shown above, I extrapolated the points of the CO line on WebPlotDigitizer. A tutorial of how to use WebPlotDigitizer is detailed in David Gironi’s blogpost. The data was then imported to Vernier’s LoggerPro for a Power Regression fit.

MQ135 CO.png

According to the Power Fit for the graph above:

y = axb

which means,

ppm = a(RsRo)b
ppm = 5.09(RsRo)-2.26

Where Rs represents resistance signal detected from the sensor and Ro represents resistance output. In order to determine the resistance output, I chose the following data:

Rs = 550 (measured from my sensor under similar conditions as the graph above)

ppm = 8 (average carbon monoxide reading in Hong Kong)

8 = 5.09(550Ro)-2.26
Ro = 550e(ln5.098)-2.26
Ro = 3162

Therefore, the function to determine the ppm of carbon monoxide in the environment is:

ppm=5.09(Rs316)-2.26

Attaching the 3V battery source to the micro:bit, connect the circuit following the diagram below:

The Python code is uploaded to my Github page.

This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Credits

Images of the Octopus breakout board and moisture sensor are from the Elecfreaks website. Image of the micro:bit is from BBC. Image of the sensor is from The Noun Project.