Problems Using SHT 30-D via I2C on a Moteino 8MHz

Hi all!

I'm trying to read from an SHT 30-D (SHT30 Temperature And Humidity Sensor - Wired Enclosed Shell : ID 5064 : $8.95 : Adafruit Industries, Unique & fun DIY electronics and kits), using a Moteino 8MHz (Moteino 8Mhz variant | All about Moteino | LowPowerLab), a low-power Arduino clone that uses an ATmega328p. However, whenever I try to access the SHT30 over I2C using the Moteino, nothing happens. I don't have anything else connected to the Moteino's I2C bus.

More specifically, when I tried using the simple I2C scanner sketch below to see if the SHT30 would even show up on the I2C bus, the Moteino hangs at the indicated line. If I disconnect the SHT-30, the sketch runs correctly and reports no devices.

#include <Wire.h>

void setup() {
  Wire.begin();

  Serial.begin(9600);
  while (!Serial); // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}

void loop() {
  int nDevices = 0;

  Serial.println("Scanning...");

  for (byte address = 1; address < 127; ++address) {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);

    byte error = Wire.endTransmission(); // With SHT-30 connected, sketch hangs here on the very first iteration of the loop

    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.print(address, HEX);
      Serial.println("  !");

      ++nDevices;
    } else if (error == 4) {
      Serial.print("Unknown error at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.println(address, HEX);
    }
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  } else {
    Serial.println("done\n");
  }
  delay(5000); // Wait 5 seconds for next scan
}

I know the SHT30 works in general, because I connected it to my Raspberry Pi Zero's I2C interface, and it worked fine.

Does anyone have any ideas on what might be preventing the I2C bus/SHT-30 from working correctly on the Moteino 8MHz? If I could even figure out how to make that simple scanning sketch above work, I'm sure I could take it from there. Thanks in advance!

P.S. I'm cross-posting this on the Moteino and Adafruit forums since I realize this isn't really an Arduino-specific problem. I just thought I'd try here too in case somebody here has encountered a similar problem.

It might be because the Moteino doesn't have pullup resistors on the SCL and SDA lines. It seems that values around 4K7 (for 5V systems) and 2K7 (for 3V3 systems) are about right but I'm no expert on this.

This particular package of the SHT-30-D comes with 10KΩ pullups from both SCA and SDL to VCC on its PCB, and the Moteino's logic is 3.3V. Could it be that 10KΩ is too big?

Could you give a link to the other forum ?

10k pullup is okay, 8MHz or 16MHz is no problem.
The Wire.endTransmission() hangs if SDA or SCL is shortcut to GND or SDA is shortcut to SCL or the I2C module is not powered.

Do you have a multimeter and a magnifier ? Use the magnifier to check the print for solder blobs and shortcuts.

Upload this sketch:

#include <Wire.h>

void setup()
{
  Wire.begin();
}

void loop() {}

Then measure the voltages, SDA, SCL and 3.3V (SDA and SCL should be near 3.3V).
Then measure the shortcut current from SDA to GND and from SCL to GND (about 0.3 to 3mA is okay).