ZMOD4510 read adc result always zeros


i'm facing a problem trying to integrate the last version of the ZMOD4510 library (release date May 31, 2024) into a custom firmware running on a STM32 microcontroller. In particular, I noticed that calling the function zmod4xxx_read_adc_result put in the array adc_result[ZMOD4510_ADC_DATA_LEN] all zeros (following the variable name of the examples). I control many times and i followed all the initialization function provided by the library. No other problem (like I2C communication problem) are raised. Running the function  calc_no2_o3 in time, it raises NO2_O3_DAMAGE error after a while. The returned rmox value are all 100 ohm and the output of the air quality index are all 0. I see that there is another thread on this forum reporting the same problem on a arduino interface. For debug purposes, I report a screenshot of the zmod4xxx_dev_t struct values:

All fields seem to be valued, unless the mox_er and mox_lr that are always equal to 0.

To test the correctness of the I2C operation I've also tried to read the tracking number and I've seen that the received buffer it's correcty valued.

Someone knows how it could be the problem?

Thank you.



  • Hello Matteo,

    Thanks for reaching out Renesas Engineering Community.

    If I remember correct from your previous post you are using the NO2 and O3 algorithm library. Is that correct?

    1.Which target MCU you are using and which files with the precompiled libraries  from which folder of Arm-Cortex M libs?

    2. For how long is the sensor powered on in the tests you made? Is it possible to provide us  some log files to check how many samples have you measured?

    Regarding the damage error you are getting: Are you maybe wiring the sensor to your MCU board and probably something happened with the sensor and the cables were disconnected so that a power on reset occurred to the sensor and the algorithm is reporting this message?

    Are you sure that this did not happen?

    Please let me inform you that depending the Mode you are using there is a stabilization time necessary that the sensor needs to be powered on from the first time you power it on. And as mentioned in the datasheet for ZMO4510 and NO3 O3 version library:

    The sensor must take  at least 50 samples and the interval between each measurement is 6 sec so the necessary time that the sensor needs to stabilize and calculate the baseline RMOx resistor is at least  5 minutes and of course all the set up and the wiring must be OK.

    Something else I would like to point out also is that in your code you should follow this sequence of steps exactly:

    Are you following these steps?

    Generally for our MOX sensor we suggest the customer to have the sensors powered on and working for at least 48 hours, a warm-up of 48 hours is necessary so that the sensor will report accurate results. Since for as long as the sensor is powered on the most accurate measurements it gives.

    Hope these info will help.

    Best Regards,