0

SGP40 does not appear on I2C bus
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

SGP40 does not appear on I2C bus

by mnishiguchi on Thu May 27, 2021 3:57 pm

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!

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

Re: SGP40 does not appear on I2C bus

by adafruit_support_carter on Thu May 27, 2021 4:21 pm

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

adafruit_support_carter
 
Posts: 20567
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Thu May 27, 2021 4:28 pm

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 :)

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

Re: SGP40 does not appear on I2C bus

by adafruit_support_carter on Thu May 27, 2021 4:30 pm

Thanks. That should all be fine.

Hmmm...OK. I get the same thing:
Code: Select all | TOGGLE FULL SIZE
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 | TOGGLE FULL SIZE
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
>>>

adafruit_support_carter
 
Posts: 20567
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Thu May 27, 2021 4:36 pm

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

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

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Thu Jun 03, 2021 6:02 pm

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.

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

Re: SGP40 does not appear on I2C bus

by adafruit_support_carter on Fri Jun 04, 2021 10:52 am

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?

adafruit_support_carter
 
Posts: 20567
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Fri Jun 04, 2021 11:08 am

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.

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

Re: SGP40 does not appear on I2C bus

by adafruit_support_carter on Fri Jun 04, 2021 11:54 am

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?

adafruit_support_carter
 
Posts: 20567
Joined: Tue Nov 29, 2016 2:45 pm

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Fri Jun 04, 2021 3:07 pm

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.

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

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Wed Jun 09, 2021 5:24 pm

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.

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

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Thu Jun 10, 2021 8:32 am

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

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

Re: SGP40 does not appear on I2C bus

by mnishiguchi on Mon Jun 14, 2021 9:48 am

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.

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

Please be positive and constructive with your questions and comments.