[Solved] LOLIN Wemos SHT30 Shield not working: "Communication with SHT3xD failed!" esphome

Hello everybody.

This is fixed already but as I spent almost one hour trying to figure it out I thought I could share my experience.

So I bought some Wemos D1 modules and SHT30 shields. When I tried to put them to work using esphome I kept getting the message “Communication with SHT3xD failed!”
I tried everything, changing the way the SCL and SDA pins are named, specifying diferent frequencies, changing boards, reading the datasheet, etc.

Then I tried to use Arduino IDE and an example from Wemos to check the “health” of the D1 board and shield.

In arduino everything worked flawlessely.

I then reprogramed the D1 board with the esphome and suddendly everything started to work. I do not know what happened but it now works. :S

My code below:


# Define I2C bus
i2c:
  sda: GPIO4
  scl: GPIO5
  scan: true
  id: bus_a
  #frequency: 100000
  
# Sensors
sensor:
  - platform: sht3xd
    i2c_id: bus_a
    temperature:
      name: "Temperatura"
      id: t67uyghu
      on_value:
        - switch.toggle: builtinled
        - delay: 50ms
        - switch.toggle: builtinled
    humidity:
      name: "Humidade"
      id: o73894yuhr
      on_value:
        - switch.toggle: builtinled
        - delay: 50ms
        - switch.toggle: builtinled
    address: 0x45
    update_interval: 10s
    
  - platform: bh1750
    i2c_id: bus_a
    id: hfhye736
    name: "Iluminância"
    address: 0x23
    measurement_duration: 69
    update_interval: 60s
    on_value:
      - switch.toggle: builtinled
      - delay: 50ms
      - switch.toggle: builtinled

#Outputs      
switch:
  - platform: gpio
    pin: D4
    inverted: true
    id: builtinled
    name: "Estado LED"
    restore_mode: ALWAYS_OFF # Starts OFF

Thank you. :slight_smile:

You know the i2c address the shield uses?

And what does the logger say after start up (you have i2c scan set to true so if it finds a device it will even print the i2c address :bulb:)

Hello orange-assistant,
You can see the adresses in the code and the log find them. The adresses were discovered even when it was not posible to talk to the module, but as I said, after trying with arduino, everything started to work.
Thank you.

Maybe it was just a bad wiring/loose contact than.

See you around Fabio :wave:

1 Like