I2c clock stretching on ACK for ESP32

  1. My goal is:
    to read from the SCD30 using i2c. There a appears to be a problem, I think because the SCD30 will clock stretch an ACK
  2. My actions are:
    using library: https://github.com/sparkfun/SparkFun_SCD30_Arduino_Library but with the mongoose i2c library.
  3. The result I see is:
    very rarely a read happens but mostly reading data from the scd30 does not reach the code- most likely because the scd30 is late to ACK (lowering SDA).
  4. My expectation & question is:
    Is there any solution to this? Is there an easy way to add clock stretching to wait for the ack in the mongoose i2c code?

Currently i’m doing some research about this topic (ESP32 with SCD30) i thing the ESP32 doesn’t support or at least can’t reach the 12ms of clock stretching that the SCD30 require before every ACK.
i’m really interested in how you solved this problem,or did you just move to the UART option?


Yes we changed to the UART method and that is working so far.


Thanks for the replay, and by the way, i just found this project in github

i think it’s possible to use I2C option. maybe i will give it a try


oh awesome! That would be great if the i2c mode could work with the scd30- please let me know if you get it working with that github code.