Question about Ozone Gas Sensor 12-Bit (MQ131) measurement

  1. More than 400 PPM of ozone from my product.
  2. Hardware Configuration
  • Arduino Uno + Arduino Uno Compatible I2C Shield + Ozone Gas Sensor 12-Bit (MQ131)
  1. Connect the power for 3 days and heat the sensor.
  2. The wrong amount of ozone is measured.
  3. As the amount of ozone increases, the measured value of MQ131 decreases.
  4. What is it? Ask for help.
  5. Attachment (code, photo)

#include <Wire.h>
#include <ADC121C_MQ131.h>

ADC121C_MQ131 mq131;

void setup(void)
{
Serial.begin(9600);

// The address can be changed making the option of connecting multiple devices
mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_DEFAULT_ADDRESS);         // 0x50, 1010000
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_FLGND);        // 0x51, 1010001
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_FLVA);         // 0x52, 1010010
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_GNDFL);        // 0x54, 1010100
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_GNDGND);       // 0x55, 1010101
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_GNDVA);        // 0x56, 1010110
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_VAFL);         // 0x58, 1011000
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_VAGND);        // 0x59, 1011001
// mq131.getAddr_ADC121C_MQ131(ADC121C_MQ131_ADDRESS_VAVA);         // 0x5A, 1011010


// The Automatic Conversion Mode, Alert Hold, Alert Flag Enable,
// Alert Pin Enable and ALERT pin Polarity
// can be changed via the following functions

mq131.setCycleTime(CYCLE_TIME_32);                    // Tconvert x 32, 27 ksps
// mq131.setCycleTime(AUTOMATIC_MODE_DISABLED);       // Automatic Mode Disabled, 0 ksps
// mq131.setCycleTime(CYCLE_TIME_64);                 // Tconvert x 64, 13.5 ksps
// mq131.setCycleTime(CYCLE_TIME_128);                // Tconvert x 128, 6.7 ksps
// mq131.setCycleTime(CYCLE_TIME_256);                // Tconvert x 256, 3.4 ksps
// mq131.setCycleTime(CYCLE_TIME_512);                // Tconvert x 512, 1.7 ksps
// mq131.setCycleTime(CYCLE_TIME_1024);               // Tconvert x 1024, 0.9 ksps
// mq131.setCycleTime(CYCLE_TIME_2048);               // Tconvert x 2048, 0.4 ksps

mq131.setAlertHold(ALERT_HOLD_CLEAR);                 // Alerts will self-clear
// mq131.setAlertHold(ALERT_HOLD_NOCLEAR);            // Alerts will not self-clear

mq131.setAlertFlag(ALERT_FLAG_DISABLE);               // Disables alert status bit in the Conversion Result register
// mq131.setAlertFlag(ALERT_FLAG_ENABLE);             // Enables alert status bit in the Conversion Result register

mq131.setAlertPin(ALERT_PIN_DISABLE);                 // Disables the ALERT output pin
// mq131.setAlertPin(ALERT_PIN_ENABLE);               // Enables the ALERT output pin

mq131.setPolarity(POLARITY_LOW);                      // Sets the ALERT pin to active low
// mq131.setPolarity(POLARITY_HIGH);                  // Sets the ALERT pin to active high

mq131.begin();

// Calibrate your Sensor to Obtain Precise Value
mq131.Calibration();
// We Deduce Resistance of the Sensor in Clean Air (Ro) in the Serial Port
// Serial.print("Ro = ");
// Serial.println(mq131.Measure_Ro());

}

void loop(void)
{
byte error;
int8_t address;

address = mq131.ADC121C_MQ131_i2cAddress;
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
    uint16_t result;

    Serial.println("Getting Gas Readings from ADC121C_MQ131");
    Serial.println(" ");
    // Serial.print("Rs/Ro Ratio: ");
    // Serial.println(mq131.Measure_RatioRsRo());

    // The Graph at fig of datasheet (sensitivity characteristics of the MQ-131)
    // seems a power function y = a*x^b
    // so ppm = a*(Rs/Ro)^b
    // Using Power Regression, you can obtain Slope (a), and Logarithmic Value of ppm (b) for Ozone (O3)!
    // From the graph, we get points for O3: (5.0, 6.0), (100.0, 0.4)

    Serial.print("Concentration of Ozone in ppb is: ");
    float ppmO3 = mq131.Measure_Ozone(-0.90, 0.69);
    Serial.print(ppmO3, 3);
    Serial.println(" ppm ");
    Serial.print("Concentration of Ozone in ppm is: ");
    Serial.print(ppmO3*1000, 3);
    Serial.println(" ppb ");
    Serial.println(" ");
    Serial.println("        ***************************        ");
    Serial.println(" ");
}
else
{
    Serial.println("ADC121C_MQ131 Disconnected!");
    Serial.println(" ");
    Serial.println("        ************        ");
    Serial.println(" ");
}

delay(1000);

}

Hi,
can you display the raw adc value and see how the values react when there is a change in Ozone level.

Thanks

Hi There,

Just chiming in here as I think I have the same problem (sensor reads 1.9 ppm when there is no ozone present and goes down when there is ozone present. I am using the arduino code in this repository.

I have a couple of sensors hooked up to the same board

Unfortunately I cant give you an example of the values when there is ozone present as the machine isn’t currently running. These are the values I am getting in normal ambient air.

but maybe the small difference in values reported will shed some light on it.

Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3939
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3832
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3940
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3833
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3940
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3833
Publish sensor1: 1.92
Publish sensor2: 1.87
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3939
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3832
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3939
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3832
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3939
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3832
Publish sensor1: 1.92
Publish sensor2: 1.87
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3938
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3831
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3939
Ozone Concentration sensor 2 : 1.87 ppm
Raw ADC Value 2: 3831
Ozone Concentration sensor 1 : 1.92 ppm
Raw ADC Value 1: 3939
Ozone Concentration sensor 2 : 1.87 ppm

Regards,

Sam

Hi @Bhaskar,

Can you give me any input on this… Is it just a case of reversing the conversion of the ADC output ? e.g.Raw ADC 4096 = 0ppm and Raw ADC 0 = 2ppm If this is the case as I am using Node red I’ll just consume the raw adc values and do the conversion in there. But the arduino code in the linked resources does seem to be the doing the conversion the wrong way round.

Regards,

Sam

I’m also looking into this sensor for CL2 and NOx measurements.
Looking at various MQ131 datasheets, the calculations vary wildly depending on what value is used for the Load Resistor. This also changes the min/max range.
What’s the kΩ value used for RL on this board ?

The product page mentions (2) different operating ranges:

  • 10 ppm to 1000 ppm
  • 10ppb to 2ppm

I assume only one is correct, depending on the value for RL used on the board.

It looks like it missed entirely.
Unless I’m missing something, it’s not: ppm = (1.99 * raw_adc) / 4095.0 + 0.01;
But after measuring the Calibration Value Ro in clean air, it wont be hard to calculate the concentrations (after we know which curve to use, depending on the RL value used on the board)

Hi,
i will recommend trying this code


or

The RL vale on the board is 10K.

2 Likes

empierre / arduino / blob / master / AirQuality-Multiple_Gas_Sensor1_4.ino

You have entered the code above.
I also downloaded the MySensor library.
However, an error still occurs in #include <MySensor.h>.
Thank you for your MySensor library.