# MQ-131 sensor question.

I am conducting a study to detect whether or not emissions come out of an electric vehicle using the Arduino and a gas sensor. I have the MQ-131 gas sensor connected, as well as an LCD to output the values when not connected to a laptop. The MQ-131 should be detecting NOx, CL2 and O3, according to the datasheet. I have left the sensor on for several hours trying to burn it in, but not the recommended 24 hours.

As of right now, the code for the sensor is just outputting the analogRead(), which isn't in PPM or PPB yet. I believe the output I am seeing is the resistance, which has values ranging from 0 to 1023. Anyways, whenever I try testing the sensor by exposing it to some ozone producing equipment, the value decreases, instead of increasing. That confuses me so much, and I was wondering if anyone could shed light on why the values would go down. What I am assuming, is that the resistance(0-1023) should go up if it senses any gases that it was made to detect. Am I right in assuming that?

I am thinking once I have that understanding, I am going to try calibrating the MQ-131 as much as I can, since the MQ-131 isn't exactly the greatest tool for accurately detecting specific gases and the densities. For now I just need to get the values to increase in what I assume is the presence of NOx or O3.

Thanks for the help!

Please post a wiring diagram of how you wired the sensor. Usually the sensor is connected in series with a fixed resistor (see datasheet) to build a voltage divider. In this case if resistance of the sensor increases and you measure the voltage over the fixed resistor, the measured voltage will decrease. The Arduino can only measure voltages. To measure resistors you have to build a circuit (as the mentioned voltage divider) that converts the resistance to a voltage.

Is there a tailpipe on your electric vehicle? Where are you measuring emissions?

Is there a tailpipe on your electric vehicle? Where are you measuring emissions?

The vehicle has no tailpipe, from what I have seen in my inspection. That was the first thing I looked for, but I plan on measuring emissions all around and inside the vehicle. My group is in the process of creating a rod that can get the sensor under the hood components. Then we have plans of measuring the battery charging station, since that is where research points for emissions. As of right now, me and my group have tested air purifiers, which are suppose to ionize the air and produce ozone purposely. Then I had a brush motor drill running near the sensor, to see if anything happened to the values being outputted. Again, usually the values would decrease. I am also going to upload my circuit, and how I have this connected. Maybe that could be the problem.

See page 14 to determine if you are looking for the correct gasses being emitted from a battery with problems:

Thanks for the resource, CrossRoads! I appreciate it!

pylon:
Please post a wiring diagram of how you wired the sensor. Usually the sensor is connected in series with a fixed resistor (see datasheet) to build a voltage divider. In this case if resistance of the sensor increases and you measure the voltage over the fixed resistor, the measured voltage will decrease. The Arduino can only measure voltages. To measure resistors you have to build a circuit (as the mentioned voltage divider) that converts the resistance to a voltage.

Attached is a rough Fritzing diagram of my circuit, and I had to add notes to signify what I’m using. The gas sensor is an MQ-131.

Here is an image of the Fritzing diagram.

Here is a link to the image, if you want to zoom in: http://imgur.com/eMGQ7sS
The reason I have a 6V power source connected only to the sensor, is because the sensor requires 6V to be heated enough to react. Then I have the LCD connected to the on board 5V Vcc.

Please post a link to the breakout board you're using for the sensor. I guess it just implements the default circuit but a check is never wrong.

This is the sensor I got, which came with its own breakout board: https://www.amazon.com/Sensitivity-Detection-Testing-Sensor-Module/dp/B01FJC12XW/ref=sr_1_5?ie=UTF8&qid=1484154483&sr=8-5&keywords=mq+131

I got the sensor to increase in voltage when exposed to heat and ozone when I isolated it inside a Styrofoam box with an air purifier. It increased very slowly, though, but increased nevertheless.

What I am wondering now from asking questions in one of the other threads, is that I think I'm gonna need more power to get both the LCD and MQ-131 sensor working at the same time. It's also pretty hard to detect ozone gas since it's so short lived. I did manage to get a good reading yesterday from a diesel trucks exhaust pipe. It was such a short spike, that it started stabilizing after about 2 seconds. I was also a certain distance from the pipe when I got that spike.

This is the sensor I got, which came with its own breakout board: https://www.amazon.com/Sensitivity-Detection-Testing-Sensor-Module/dp/B01FJC12XW/ref=sr_1_5?ie=UTF8&qid=1484154483&sr=8-5&keywords=mq+131

Unfortunately a cheap Chinese board without any substantial documentation. I guess the potentiometer is the resistor building the voltage divider so you can adjust the reading on the Arduino with it. The chip on the board is probably needed to control the LED. I don't buy boards without documentation, a schematic is a must.

What I am wondering now from asking questions in one of the other threads, is that I think I'm gonna need more power to get both the LCD and MQ-131 sensor working at the same time.

The sensor draws about 250mA, so the 500mA should be enough if the display isn't using too much.

You should power the Arduino with more than 6V to let it produce a stable 5V to make measurements. At the moment it probably takes the 5V from USB for everything. Power with 9V and the Arduino should have enough power.

I did manage to get a good reading yesterday from a diesel trucks exhaust pipe. It was such a short spike, that it started stabilizing after about 2 seconds. I was also a certain distance from the pipe when I got that spike.

You may damage the sensor if you heat it too much. The operating temperature is -25 - 40°C, a diesel exhaust is usually much hotter. And the reading is very temperature sensitive so keep the temperature as stable as possible or use the diagram in the datasheet to calculate the error out (you need a temperature sensor for that).

pylon:
Unfortunately a cheap Chinese board without any substantial documentation. I guess the potentiometer is the resistor building the voltage divider so you can adjust the reading on the Arduino with it. The chip on the board is probably needed to control the LED. I don't buy boards without documentation, a schematic is a must.

The sensor draws about 250mA, so the 500mA should be enough if the display isn't using too much.

You should power the Arduino with more than 6V to let it produce a stable 5V to make measurements. At the moment it probably takes the 5V from USB for everything. Power with 9V and the Arduino should have enough power.

You may damage the sensor if you heat it too much. The operating temperature is -25 - 40°C, a diesel exhaust is usually much hotter. And the reading is very temperature sensitive so keep the temperature as stable as possible or use the diagram in the datasheet to calculate the error out (you need a temperature sensor for that).

BayBayMan:
This is the sensor I got, which came with its own breakout board: https://www.amazon.com/Sensitivity-Detection-Testing-Sensor-Module/dp/B01FJC12XW/ref=sr_1_5?ie=UTF8&qid=1484154483&sr=8-5&keywords=mq+131

I got the sensor to increase in voltage when exposed to heat and ozone when I isolated it inside a Styrofoam box with an air purifier. It increased very slowly, though, but increased nevertheless.

What I am wondering now from asking questions in one of the other threads, is that I think I'm gonna need more power to get both the LCD and MQ-131 sensor working at the same time. It's also pretty hard to detect ozone gas since it's so short lived. I did manage to get a good reading yesterday from a diesel trucks exhaust pipe. It was such a short spike, that it started stabilizing after about 2 seconds. I was also a certain distance from the pipe when I got that spike.

Have you found a solution?

BayBayMan:
As of right now, the code for the sensor is just outputting the analogRead(), which isn’t in PPM or PPB yet. I believe the output I am seeing is the resistance, which has values ranging from 0 to 1023. Anyways, whenever I try testing the sensor by exposing it to some ozone producing equipment, the value decreases, instead of increasing. That confuses me so much, and I was wondering if anyone could shed light on why the values would go down. What I am assuming, is that the resistance(0-1023) should go up if it senses any gases that it was made to detect. Am I right in assuming that?

The Analog Signal should tell you the voltage drop, not the resistance value. And the 0 to 1023 value for the analog must also be converted to volts actually, depending on how much voltage you are using for the sensor.

Hi,

The analog signal gives you only a value between 0 and 1023 which have to be converted in VRL.

After that, you have to use a formula to convert it to ppm or ppb (depending on the sensor).

I built a lib to use the MQ131: GitHub - ostaquet/Arduino-MQ131-driver: Arduino driver for gas sensor MQ131 (Ozone / O3)

You can check the functions readRs() and getO3() in the cpp.

The conversion is done based on the data sheet and a trend line on the graph (see the XLSX in the data sheet directory).

KR,
Olivier

Hi Ostaquet,

Thanks for your valuable contribution to GitHub regarding the MQ-131 Ozone sensor !
I have already used tour code and got some puzzling results: the readings start with 24.4 ug/m3 and go up to 830 ug/m3 oscillating heavily from 320 to 830 ug/m3 ! (time of acquisition: 9h)
Is this usual for this sensor?
(please take a look at the attached graphic)

Although I have a very long experience with C programming, I haven’t learnt Arduino C++ yet.
Where can I learn how to create Arduino libraries like the one you posted?

Thanks.

Paulo.