PM2.5 Air Quality Kit (PMSA003 + SHT20) - Arduino IDE - Cannot read temperature and humidity



  • Hello,

    I am struggling with an annoying issue.
    I've just put my hands on an AirQuality Kit. It came with a pre-flashed app, that correctly showed values (the temperature was way hight, but I understand that this is a know fact).
    After playing with UIFlow and nanoFramework, due to some issues I was unable to solve, I returned to the Arduino IDE.

    I have uploaded an app from GIT (for the PM2.5) but it does not show the temperature any more:
    https://github.com/m5stack/M5Stack/blob/master/examples/Modules/PM2.5_PMSA003/PM2.5_PMSA003.ino

    Checking the source code, I noticed the:
    #define SLAVE_ADDRESS 0x40

    However, when I run a scan on the i2c bus, on my m5Stack, I see these ids:
    44
    75
    80
    C4
    F5

    So, I tried 0x40, but no luck. Also, other strange things happen in some situations:
    Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
    Core 1 register dump:
    PC : 0x400d15fa PS : 0x00060730 A0 : 0x800d1713 A1 : 0x3ffb1f30
    A2 : 0x3ffc01a4 A3 : 0x3ffc0640 A4 : 0x00000000 A5 : 0x3ffc0640

    This is the KIT: https://docs.m5stack.com/en/base/pm2.5

    Is there some place from where I can get the source code for the app that was originally on the device?



  • Hi @dumitru,

    Maybe from the UIFlow examples?

    0_1695906730748_Screenshot 2023-09-28 at 14.11.27.png e



  • @gavin67890 Excellent idea! I will try that. Thank you!



  • It works!!
    Thank you for the suggestion @gavin67890!
    The temperature is about 6 over and the humidity is 10% less than what my desk station is showing me, but I am glad that the hardware is ok.
    Now, to inspect the Python code and see where is the problem.
    0_1695909425730_20230928_164927_resize_resize.jpg

    Also, one important aspect I was missing: the GitHub code was trying to read a SHT20 while the PM2.5 (K023-B) has a SHT30.