Home / How To's / How to Use the MQ-7 Carbon Monoxide Sensor

How to Use the MQ-7 Carbon Monoxide Sensor

The MQ-7 carbon monoxide sensor is especially designed to be sensitive to carbon monoxide (CO) gas which is emitted by vehicles, factories, etc. Since this gas is considered toxic to humans at certain levels, concentration of CO is used to determine the air pollution in a given area.

Introduction to MQ-7 Carbon Monoxide Sensor

According to its datasheet, the MQ-7 carbon monoxide sensor detects 20 to 2000 ppm of CO in air. Here is its sensitivity characteristic curve:

MQ-7 Carbon Monoxide Sensor Characteristic Curve

This is a graph of Rs/R0 vs. gas concentration in ppm. Rs is the resistance of the sensor in target gas while R0 is the resistance in clean air. We will use this graph later when we create our code.

For this tutorial, I will be using the MQ-7 breakout board which has four output pins as shown:

This breakout board is more convenient as it converts resistance variations to voltage variations. Here is its schematic diagram:

MQ3 schematic

This schematic diagram is the same as with the MQ-3 alcohol sensor and MQ-6 LPG sensor.

There are two ways to read the output from the MQ-7. One is through the DOUT pin which gives a high when the concentration threshold is reached and low otherwise. The threshold can be varied by adjusting the trimmer on the breakout board which is Rp in the schematic.

Meanwhile, the AOUT pin gives varying voltage representing the CO concentration. We can convert the voltage reading to ppm if we look at the characteristic curve above. The relationship between concentration in ppm and RS/R0 is:

ppm = 100 * \frac{log(40)}{log(0.09)}^ {\frac{RS}{R0}}

Arduino Sketch for MQ-7

Before we can use this formula in a sketch, we need to determine R0 of the MQ-7 sensor first. This varies between devices so there is a need for actual testing. We can use this sketch to get R0:

Once R0 is determined, we can then use this sketch to display the ppm concentration of C0

Now you have an Arduino carbon monoxide sensor! Use this with a smartphone app and detect C0 levels in your surrounding. If its above 35 ppm, that’s already toxic and you should leave right away!

Check Also

arduino fire detector

Creating a Simple Arduino Fire Detector

A fire or flame sensor is simply an infrared LED with an amplifier circuit. Flame …

Leave a Reply

Your email address will not be published. Required fields are marked *