SCD30 Arduino test issues

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Mushrooom
 
Posts: 8
Joined: Thu Dec 29, 2022 3:30 pm

SCD30 Arduino test issues

Post by Mushrooom »

Hi I am attempting to use the Arduino IDE to program a QTpy ESP32-S2 so that I can use a SCD30 CO2/Humidity and Temp sensor.

The QTpy is set up with the Arduino IDE fine and I can run other example sketches on it. When I run the adafruit_scd30_test example sketch I get the following printed messages in the Serial monitor:

Adafruit SCD30 test!
Failed to find SCD30 chip


The QTpy and the SCD30 are connected via the built in STEMMA QT connectors. I feel like that might be the issue, maybe the sketch is expecting me to declare the pins for certain connections? but I am not sure how to do that with the "Adafruit_SCD30" library.

Any help would be really appreciated.

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

Re: SCD30 Arduino test issues

Post by adafruit_support_carter »

This is a common source of confusion. The STEMMA QT connector on the QT PY ESP32-S2 is accessed via Wire1 in Arduino:
https://learn.adafruit.com/adafruit-qt- ... or-3107922

By default, the SCD30 library will use Wire.

Just need to update code to specify the non-default Wire1 instead. Change this line:

Code: Select all

  if (!scd30.begin()) {
to:

Code: Select all

  if (!scd30.begin(SCD30_I2CADDR_DEFAULT, &Wire1)) {

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

Return to “Arduino”