Customer:
I’m building IoT devices for research and use the MQ131 Board with easyC on a Raspberry Pi. Connection and setup work fine, but I have some questions:
-
When reading from the ATtiny404 via easyC, I get values between about 330 and 400. What exactly do these values represent? Are they raw ADC counts, a scaled voltage, or already a calculated resistance (RS)?
-
According to the GitHub documentation and the datasheet, RS should increase with rising ozone concentration. In my measurements, however, the reported values decrease with rising ozone concentration. Could this be due to the internal wiring of the load resistor, or is the firmware output inverted?
-
Do you have additional regression data besides what is published on GitHub? And is it correct that I first have to measure R0 in ozone-free air, and then use the regression with my measured RS to calculate the ozone level?
Originally submitted via email support on 10 September 2025. Migrated to the forum for community visibility.
Soldered Support:
Note that this is the high concentration version of the sensor. Check the datasheet: https://soldered.com/productdata/2022/03/Soldered-mq131-highconcentration-datasheet.pdf
This measures in the 10–1000 ppm range which is quite high for O3. There are some design issues with the MQ sensors being addressed in a planned hardware revision.
To answer your technical questions:
The ATtiny’s firmware is here: Soldered-MQ-Gas-Sensor-Arduino-Library/extras/attiny_firmware/attiny_firmware.ino at dev · SolderedElectronics/Soldered-MQ-Gas-Sensor-Arduino-Library · GitHub
The firmware is performing an analogRead which gets packed and forwarded to the main board:
void requestEvent()
{
char ;
d = analogRead(PA5);
if (lastEvent==0)
{
= d & 0xFF;
= (d >> 8) & 0xFF;
Wire.write(a, 2);
}
}
If RS does increase, the measured value should actually go down as you are measuring on the load resistor.
You can estimate the ppm via regression using the graph from the datasheet. The best approach for you would be to not use the built-in regression in the library but write your own approximation function with this curve.
See MQ Gas Sensors – Overview | Soldered Documentation for full documentation on MQ sensors.
Attachment omitted in migration: image.png
Attachment omitted in migration: image.png