SGP30 Breakout board (black) is not being recognized

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
Scorpion454r
 
Posts: 6
Joined: Sun May 14, 2023 10:26 pm

SGP30 Breakout board (black) is not being recognized

Post by Scorpion454r »

I have copied the https://learn.adafruit.com/adafruit-sgp ... iring-test for the CircuitPython and Python Usage section. When running the code on a RPI, I receive the below error. I have tested using the headers and using the QT connection. Any advice or other test methods I can try, or is this product defective?


Code: Select all

Traceback (most recent call last):
  File "/home/scorp/git/SGP30/main.py", line 14, in <module>
    sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)
  File "/usr/local/lib/python3.9/dist-packages/adafruit_sgp30.py", line 91, in __init__
    self._device = I2CDevice(i2c, address)
  File "/home/scorp/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 63, in __init__
    self.__probe_for_device()
  File "/home/scorp/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 185, in __probe_for_device
    raise ValueError("No I2C device at address: 0x%x" % self.device_address)
ValueError: No I2C device at address: 0x58

User avatar
Scorpion454r
 
Posts: 6
Joined: Sun May 14, 2023 10:26 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by Scorpion454r »

After working with it for a few more hours, I am able to get it to work with a RPI. I'm still unable to get the SGP30 to work with the trinket 5V. Is there any advice on how to change the I2C speed on the original trinkets to the "fast-mode"? Is this likely an issue? I have verified I can talk to another I2C device (7 segment backpack). Please let me know any information I can post that will be useful.

User avatar
Scorpion454r
 
Posts: 6
Joined: Sun May 14, 2023 10:26 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by Scorpion454r »

Wiring: SDA, SCL, 5V, and GND all their own row on the breadboard. Then the SGP30 and the Display connect to the proper spots on that row.
Trinket:
  • Powered via USB
    5V going to bottom red rail
    GND going to bottom black rail
    #0 going to bottom section C13
    #2 going to bottom section C14

Code: Select all

#include <avr/power.h>
#include <EEPROM.h>
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_SGP30.h"

Adafruit_SGP30 sgp = Adafruit_SGP30();
Adafruit_7segment backpack = Adafruit_7segment();
const int ledPin = 1;
int count = 0;

#define LED_BACKPACK_ADDRESS   0x70
#define COUNT_ADDRESS          0 

void update_display() {
  uint16_t count;
  EEPROM.get(COUNT_ADDRESS, count);
  backpack.print(count, DEC);
  backpack.writeDisplay();
}

void displayRandomNumber()
{
  delay(1000);
  EEPROM.put(COUNT_ADDRESS, random(1000));
  update_display();
  delay(1000);
}

void setup() {
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
  delay(3000);

  Wire.begin();    
  
  digitalWrite(ledPin, LOW);
  delay(200);
  if (! sgp.begin()){
    displayRandomNumber();
  }
  else
  {
    digitalWrite(ledPin, HIGH);
  }
  
  // Initialize the LED backpack display.
  backpack.begin(LED_BACKPACK_ADDRESS);

  //Initialize sensor
  int i = 0;
  bool again = true;
  //This runs non-stop.
  while(again || i == 5){  
    if (! sgp.begin()){
      displayRandomNumber();
      i++;
    }
    else
    {
      again = false;
      digitalWrite(ledPin, HIGH);
    }
  }
}


void loop() {   
  digitalWrite(ledPin, HIGH); 
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}
Attachments
Really rough diagram
Really rough diagram
test.png (10.17 KiB) Viewed 135 times
Current Wiring
Current Wiring
SGP30Wiring.jpg (440.3 KiB) Viewed 135 times

User avatar
Scorpion454r
 
Posts: 6
Joined: Sun May 14, 2023 10:26 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by Scorpion454r »

After working with the circuit a bit more, I am still unsuccessful. I have been able to get things working with the RPI using the 3.3V power instead of the 5V from the trinket. Is anyone familiar with how to correct wire up the 5V circuit and the signal lines? Or topics I can research to get this complete?

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by Franklin97355 »

Have you tried the example code without anything connected except the SGP30?https://learn.adafruit.com/adafruit-sgp ... duino-code

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

Re: SGP30 Breakout board (black) is not being recognized

Post by adafruit_support_carter »

The SGP30 breakout pinouts are described here:
https://learn.adafruit.com/adafruit-sgp ... or/pinouts
Note the comment on the Vin pin about powering for 3V vs 5V boards:
To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V
Example Arduino wiring is shown here:
https://learn.adafruit.com/adafruit-sgp ... duino-code

Is the Trinket 5V your only Arduino board? That board is deprecated:
https://www.adafruit.com/product/1501

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by adafruit2 »

the trinket 5v absolutely does not have enough RAM to talk to a sensor - you gotta update to something like the QT Py RP2040 or QT Py SAMD21!

User avatar
Scorpion454r
 
Posts: 6
Joined: Sun May 14, 2023 10:26 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by Scorpion454r »

Franklin97355 wrote: Sat Jun 10, 2023 1:12 pm Have you tried the example code without anything connected except the SGP30?https://learn.adafruit.com/adafruit-sgp ... duino-code
Yes, I've tried that setup and code, but the I2C device is never detected. I'm using the built in led to flash at a constant rate if the .begin() succeeds.

User avatar
Scorpion454r
 
Posts: 6
Joined: Sun May 14, 2023 10:26 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by Scorpion454r »

adafruit2 wrote: Sun Jun 11, 2023 4:28 pm the trinket 5v absolutely does not have enough RAM to talk to a sensor - you gotta update to something like the QT Py RP2040 or QT Py SAMD21!
I assumed there wouldn't be enough space on this trinket to do much with the sensors, but I have about 6 of these old trinkets to find projects for. I'm using this buildout to learn more about I2C and daisy chaining the devices. I'm going to look into the QT Py RP2040 or the SAMD21 for a more useful project :).
adafruit_support_carter wrote: Sat Jun 10, 2023 1:59 pm The SGP30 breakout pinouts are described here:
https://learn.adafruit.com/adafruit-sgp ... or/pinouts
Note the comment on the Vin pin about powering for 3V vs 5V boards:
To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V
Example Arduino wiring is shown here:
https://learn.adafruit.com/adafruit-sgp ... duino-code

Is the Trinket 5V your only Arduino board? That board is deprecated:
https://www.adafruit.com/product/1501
I did see the note about the 5V and 3V boards. I wasn't able to get the same code to work on my RPI when using the 5V GPIO pin there. I had success when connecting the SGP30 to the 3.3V supply from the pi. I assume that means something is wrong with my wire setup, and very likely need to educate myself on these types of circuits.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: SGP30 Breakout board (black) is not being recognized

Post by adafruit2 »

the original attiny85 trinkets are great for lil LED blinkies - but this board is now so old, we only stock it for historical project maintenance

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

Return to “Other Products from Adafruit”