adafruit / Adafruit_SGP30

Arduino library for SGP30
Other
56 stars 38 forks source link

SGP30 coming from Aliexpress with different address #31

Closed clovisf closed 2 weeks ago

clovisf commented 2 weeks ago

The title says it all, I just got a brand new SGP30 from Aliexpress with i2c address 0x59. Product's datasheet https://sensirion.com/media/documents/984E0DD5/61644B8B/Sensirion_Gas_Sensors_Datasheet_SGP30.pdf says 0x58, which is also hardcoded into the library.

I suggest breaking a variable outside the library for the user to enter the required address.

dhalbert commented 2 weeks ago

Sensirion does not make an SGP30 with address 0x59. The SGP40 has address 0x59. But it might be some kind of counterfeit. See https://forum.arduino.cc/t/cjmcu-sgp30-nothing-fits-like-expected/599421 for a similar experience.

caternuson commented 2 weeks ago

Closing since not a library issue. Can reopen if Sensirion SGP30's exist with different I2C addresses. Per the datasheet, 0x58 is the only I2C address.

The fix would be to add an address parameter to begin().

If you want to use this library with counterfeit hardware, then you'll need to fork it and modify it as needed.

clovisf commented 2 weeks ago

Thank you all. Turns out the boards' silkscreen was SGP30 but the sensor was SGP40.