[Solved] 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 (https://lowpowerlab.com/guide/moteino/moteino-8mhz/), 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() {

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

void loop() {
  int nDevices = 0;


  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.

    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(address, HEX);
      Serial.println("  !");

    } else if (error == 4) {
      Serial.print("Unknown error at address 0x");
      if (address < 16) {
      Serial.println(address, HEX);
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  } else {
  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()

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).

For anyone who encounters this problem in the future, here's the answer:

It turns out the 10KΩ pull-up resistors that came with this package weren't sufficient. I had to add additional 1KΩ pullups from both SCA and SDL to VCC to get things to work.

(FWIW I also tried 4.7KΩ pull up resistors, and that made some commands to the SHT 31 work, but not all.)

Then something is wrong. You should check your circuit.
With pullup resistors of 1k, the I2C bus is no longer according to the I2C standard.

I agree that something weird is going on, and I'm not sure what to make of it. I did the experiment you described in post #4 of this thread without adding any pull-up resistors of my own (i.e. just direct connections between the Moteino board and the SHT 30-D package, with only my breadboard in between to make the connections), and the results were:

  • SDA to ground and SCL to ground were both 2.3V. VCC to ground was 3.294V
  • The shortcut current between from SDA to ground and SCL to ground were both 0.14mA.

I'm not sure what to make of it. All I know is that in desperation I kept trying smaller pull-up resistors of my own. When I tried 2.2KΩ pull-ups from SDA/SCL to VCC it didn't work. When I came down to 1KΩ, things suddenly worked like magic. :confused:

The SDA and SCL should be near the 3.294V, for example 3.293V.

Suppose you have 10k pullup to 3.294V, then the current should be 0.33mA.

Is there is a GND or VCC not well connected ? Something soldered upside down ? I have no clue, but I think you have to find the cause. The sensor could be broken.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.