MQ131 Ozone sensor measurement

Hi there!

I recently bought Arduino Uno Compatible I2C Shield + MQ131 Ozone Gas Sensor. Despite the fact that I produce ozone gas from the generator, I can’t measure proper values at all. The sensor reads 1.9 ppm when there is no ozone produced and goes down dramatically when it is produced. I am using the arduino code in this repository. Furthermore, I get a compile error that goes;

< “no headers files” (.h) found in C:\Program Files (x86)\Arduino\libraries\ADC121C_MQ131_Master >

< collect2.exe: error: ld returned 1 exit status
exit status 1 >

I simply cannot run the program with this hardware. Could you recommend any other program that I can use? or Could you give me a solution on this problem?

Best Regards,

Zafer ÜNLÜ

you will need to copy lib files ( .h and .c) in your arduino lib folder.

Hello, @Bhaskar. We are really struggling to get this program and sensor to work. You can take me as a rookie. What I do is ;

First, I download your library files

Second, I copy them to \Arduino\lib (I tried \libraries as well)

Third, I run MQ131Example.ino and when I try to compile it I get an error.

What am I doing wrong? Could you please explain? We really need to get this sensor to work.

Best Regards,

Zafer ÜNLÜ

do you have the .c and .h file at this location
C:\Program Files (x86)\Arduino\libraries\ADC121C_MQ131

Are you referring to ADC121C_MQ131.cpp and ADC121C_MQ131.h ?

yes ADC121C_MQ131.cpp and ADC121C_MQ131.h

Yes I do have them but the program doesn’t compile.

did you restart arduino ide ?

what’s the error ?

@Bhaskar

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::begin()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::alertLowTriggered()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::alertHighTriggered()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setCycleTime(ADC121C_MQ131CycleTime_t)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getCycleTime()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setAlertHold(ADC121C_MQ131AlertHold_t)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getAlertHold()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setAlertFlag(ADC121C_MQ131AlertFlag_t)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getAlertFlag()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setAlertPin(ADC121C_MQ131AlertPin_t)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getAlertPin()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setPolarity(ADC121C_MQ131Polarity_t)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getPolarity()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Calibration(float)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Measure_Resistance(int)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::clearAlertStatus()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setAlertLowLimit(unsigned int)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setAlertHighLimit(unsigned int)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::setHysteresis(unsigned int)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::clearLowestConversion()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::clearHighestConversion()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getLowestConversion()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getHighestConversion()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Measure_Voltage()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Calibration()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Measure_Rs()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Measure_RatioRsRo()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Measure_Scaled(float, float)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::Measure_Ozone(float, float)’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\ADC121C_MQ131\ADC121C_MQ131.cpp.o (symbol from plugin): In function `ADC121C_MQ131::getAddr_ADC121C_MQ131(unsigned char)’:

(.text+0x0): multiple definition of `ADC121C_MQ131::getAlertStatus()’

sketch\ADC121C_MQ131.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1

Arduino Uno kartı için derleme hatası.

C:\Program Files\Arduino\libraries\MQ131-master içerisinde geçersiz kütüphane bulundu: no headers files (.h) found in C:\Program Files\Arduino\libraries\MQ131-master

C:\Program Files\Arduino\libraries\Ozone-Gas-Sensor-Arduino-Lib-master içerisinde geçersiz kütüphane bulundu: no headers files (.h) found in C:\Program Files\Arduino\libraries\Ozone-Gas-Sensor-Arduino-Lib-master

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

It appears that the ADC121C_MQ131 library is being referenced more than once. It’s possible you are including it in a file that it should not be included in or there are multiple copies of the library being referenced by your project. It is very hard to say without having access to the full directories on your computer.

@Bhaskar @TravisE_NCD_Technica

Hello there! We could be able to solve our ‘compile’ problem, thank you. Now we can compile the program without any issues and run it on Arduino. But unfortunately the results are off the chart. Let me put it this way, the sensor reads 1.9 ppm when there is no ozone produced and goes down to zero when it is produced. I’m pretty sure that we’ve done everything right but is there a problem with the codes? This doesn’t make sense at all. I need your assistance. Thank you!

Best Regards,
Zafer ÜNLÜ

@Bhaskar is there any calibration required for this sensor?
@unluz can you post a photo of your hardware setup just so we can make sure there isn’t a problem there?

@TravisE_NCD_Technica
Here’s our setup and values when the sensor is exposed to ozone gas.

the sensor needs to be powered on for around 48hrs ( sensor warm up time).

The arduino example will need fine tuning and calibration in order to get the best results.