SGP40 (Qwiic) not detected by UNO R4 Wifi

Hi there

I have a Sparkfun SGP40 (Qwiic) attached to a UNO R4 WiFi via the R4’s Qwiic socket.

I’m trying to test the setup using the Example1_GetVOCIndex example sketch from the SparkFun_SGP40_Arduino_Library (v1.0.4).

I’ve edited line 22 from Wire.begin(); to Wire1.begin(); as I believe is required by the R4.

The Serial Monitor reports:
SGP40 Example
SGP40 not detected. Check connections. Freezing…

Is it possible I’ve connected the Qwiic cable incorrectly? The PWR LED is lit up.

Is there perhaps an alternative tried and tested R4-compatible test sketch for the Sparkfun SGP40 (Qwiic)?

Many thanks

SOLVED!

As well as changing
Wire.begin();
to
Wire1.begin();

you have to also add Wire1 to the sensor’s begin function:
mySensor.begin(Wire1);

1 Like