SGP40 does not appear on I2C bus

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

SGP40 does not appear on I2C bus

Post by mnishiguchi »

Hi, I connected a SGP40 breakout to my Raspberry Pi using a Stemma QT connector, but it won't appear in my I2C list.

- It arrived today; brand new
- I have used similar boards such as BME280, BME680, AHT20 etc before and had absolutely no issue.
- I used many different Stemma QT wires but the result was the same

I wonder what is going on with my brand new SGP40 ¯\_(ツ)_/¯

Thank you in advance for your assistance!

User avatar
adafruit_support_carter
 
Posts: 29457
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

Post by adafruit_support_carter »

Are you going straight onto the Pi's GPIO header pins with something like this?
https://www.adafruit.com/product/4397
Or something else?

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

Hi thanks for your quick reply. No, the wire I use now has STEMMA QT on both ends.

Here are the items I am using:
- Qwiic / STEMMA QT HAT https://www.adafruit.com/product/4688
- STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long https://www.adafruit.com/product/4399
- Pi Zero WH https://www.adafruit.com/product/3708

All from Adafruit by the way :)

User avatar
adafruit_support_carter
 
Posts: 29457
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

Post by adafruit_support_carter »

Thanks. That should all be fine.

Hmmm...OK. I get the same thing:

Code: Select all

pi@raspberrypi:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --   
But if I go ahead and try using it, it seems to work OK:

Code: Select all

pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import adafruit_sgp40
>>> sgp = adafruit_sgp40.SGP40(board.I2C())
>>> sgp.raw
28046
>>> sgp.raw
28023
>>> sgp.raw
27995
>>> 

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

Cool. Your discovery makes me feel better. I can stop my investigation :)
Looking forward to a fix or a solution!

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

I tested with soldered header pins but the result was the same; the connected device does not appear on the table...
It is not usable from my program.

User avatar
adafruit_support_carter
 
Posts: 29457
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

Post by adafruit_support_carter »

Your program requires the address to be discoverable via a scan?

Does the sensor work if you just try to use it as shown in the example above?

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

It seems correct that the device needs to be discoverable to be usable with Circuits I2C Elixir library.
https://github.com/elixir-circuits/circuits_i2c
My goal is to write a library for Elixir language community.

Why is this not discoverable?
I have a bunch of similar sensors (BMP388, BME280, BME680, AHT20, etc) from Adafruits and I had absolutely zero issue with them.

User avatar
adafruit_support_carter
 
Posts: 29457
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

Post by adafruit_support_carter »

Some devices are just like that.

Maybe it will still work? From here:
https://github.com/elixir-circuits/circ ... do-i-debug
It is still possible that the device will work even if it does not detect,
So maybe just go ahead and try using it?

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

I already tried and it did not work.
If it is the spec and correct behavior to you, that is fine. I'll dump it.
I just wanted to write an Elixir library and write a post about this product for my community.

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

Hi, I'll ask the author of the I2C library I use for his insight. Maybe something is missing in the library if the hardware is good.

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

I think the board is good. It is actually discoverable. Maybe it needs some time to be initialized.
I learned something new. Discoverability is not part of I2C specification.
Thanks

User avatar
mnishiguchi
 
Posts: 19
Joined: Sun Jan 03, 2021 11:27 am

Re: SGP40 does not appear on I2C bus

Post by mnishiguchi »

I was able to get my Elixir program working. https://github.com/mnishiguchi/sgp40

I apologize that I was frustrated about the device undiscoverable but it seems to be a spec.
I believed that I2C devices are always discoverable, but it seems wrong.
This particular device starts becoming discoverable as soon as the serial id is accessed.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”