Hello,
We attempted the explicit pin settings and default settings, and both did not work with and without the clock reduction. We received the error: “Update failed, error: Error E (37867) i2c.master: I2C transaction timeout detected E (37867) i2c.master: s_i2c_synchronous_transaction(945): I2C transaction failed E (37868) i2c.master: i2c_master_multi_buffer_transmit(1214): I2C transaction failed: /*” when using the code:
/*
Take humidity and temperature readings with the SHTC3 using I2C
By: Owen Lyke
SparkFun Electronics
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Example1_BasicReadings
To connect the sensor to an Arduino:
This library supports the sensor using the I2C protocol
On Qwiic enabled boards simply connnect the sensor with a Qwiic cable and it is set to go
On non-qwiic boards you will need to connect 4 wires between the sensor and the host board
(Arduino pin) = (Display pin)
SCL = SCL on display carrier
SDA = SDA
GND = GND
3.3V = 3.3V
*/
#include “SparkFun_SHTC3.h” // Click here to get the library: http://librarymanager/All#SparkFun_SHTC3
#include <Wire.h>
#include “SparkFun_SHTC3.h”
SHTC3 mySHTC3;
void setup() {
Serial.begin(115200);
delay(1000);
// Explicitly define I2C pins for ESP32-S2 Thing Plus
//Wire.begin(SDA, SCL); // Default should be GPIO 21 (SDA) and GPIO 22 (SCL)
// OR try:
Wire.begin(21, 22); // Explicitly set pins
Wire.setClock(100000); // Start with 100kHz (see point 2)
if(mySHTC3.begin() != SHTC3_Status_Nominal) {
Serial.println(“SHTC3 not detected”);
} else {
Serial.println(“SHTC3 detected!”);
}
}
void loop() {
SHTC3_Status_TypeDef result = mySHTC3.update(); // Call “update()” to command a measurement, wait for measurement to complete, and update the RH and T members of the object
printInfo(); // This function is used to print a nice little line of info to the serial port
delay(190); // Delay for the data rate you want - note that measurements take ~10 ms so the fastest data rate is 100 Hz (when no delay is used)
}
///////////////////////
// Utility Functions //
///////////////////////
void printInfo()
{
if(mySHTC3.lastStatus == SHTC3_Status_Nominal) // You can also assess the status of the last command by checking the “.lastStatus” member of the object
{
Serial.print(“RH = “);
Serial.print(mySHTC3.toPercent()); // “toPercent” returns the percent humidity as a floating point number
Serial.print(”%, T = “);
Serial.print(mySHTC3.toDegF()); // “toDegF” and “toDegC” return the temperature as a flaoting point number in deg F and deg C respectively
Serial.println(” deg F”);
}
else
{
Serial.print("Update failed, error: ");
errorDecoder(mySHTC3.lastStatus);
Serial.println();
}
}
void errorDecoder(SHTC3_Status_TypeDef message) // The errorDecoder function prints “SHTC3_Status_TypeDef” resultsin a human-friendly way
{
switch(message)
{
case SHTC3_Status_Nominal : Serial.print(“Nominal”); break;
case SHTC3_Status_Error : Serial.print(“Error”); break;
case SHTC3_Status_CRC_Fail : Serial.print(“CRC Fail”); break;
default : Serial.print(“Unknown return code”); break;
}
}
We are not quite sure how to see if internal pullup are enabled, if so try disabling and re-attempt. We used pinMode(21, INPUT); pinMode(22,INPUT) before the Wire.begin, ran the code, and then repeated with pinMode(21, INPUT_PULLUP); pinMode(22, INPUT_PULLUP);, and received an error message for both.
Overall, we are wanting to integrate the SparkFun Air Quality PM1/PM2.5/PM10 Sensor - BMV080 (Qwiic) (SKU: SEN-26554), SparkFun Air Quality Sensor - SGP40 (Qwiic) (SKU: SEN-18345), SparkFun Humidity Sensor Breakout - SHTC3 (Qwiic) (SKU: SEN-16467) on one microcontroller board. Currently, the Air Quality Sensor and the Humidity Sensor both work with an Arduino Uno R4 Wifi, but the PM sensor does not. Additionally, the Air Quality Sensor and the PM sensor both work with the SparkFun Thing Plus - ESP32-S2 WROOM (SKU: WRL-17743), but the Humidity sensor does not.
We purchased the SparkFun Thing Plus - ESP32-S2 WROOM (SKU: WRL-17743) because we thought it would work with all three. Is there another development board that is guaranteed to work with all three of these sensors?