SHT3X Sensor disturbs ESP8266 Wifi

I have a weird problem. I had a hardware setup with an ESP8266-d1(Lolin) + SHT3X + BME280 + CCS811 connected via I2C.
I had the ESP8266 programmed with Arduino and used MQTT to send sensor input to HA, which worked nicely.

Now I started using ESPHOME and I can very easy make a configuration that does the same (Read sensors every 30. second). However as soon as the SHT3X is a part of the configuration, then the ESP cant find the WIFI network.

If I only configure the SHT3X, then it works fine. If I only configure the BME280 and the CCS811, then it works fine. But if I combine the SHT3X with either the BME280 or the CCS811, then the ESP cant fint the wifi and looses connection to ESPHOME.

I tried external power, capacitor on the supply, different wiring. And the exact same setup works fine in Arduino.

Any ideas?

Update:
It doesn’t matter whether the SHT3X is connected or not. It is enought to define a SHT3Xd sensor in ISPHOME, then the wifi doesnt find any networks.

Can you connect at the ESP by USB ? so you can check logs of ESP when it boots with problematic code for SHT ?
Please share also your yaml just in case :wink:

esphome:
  name: esp8266-wemos2
  friendly_name: ESP8266-wemos2

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "Ssp..."

ota:
  password: "f02..."

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp8266-Wemos2 Fallback Hotspot"
    password: "pR..."

captive_portal:


i2c:
  - id: bus_a
    sda: 4
    scl: 5
    scan: true  
    frequency: 100kHz

sensor:

#  - platform: sht3xd
#    temperature:
#      name: "Living Room Temperature"
#    humidity:
#      name: "Living Room Humidity"
#    i2c_id: bus_a
#    address: 0x44
#    update_interval: 15s


  - platform: ccs811
    eco2:
      name: "CCS811 eCO2 Value"
    tvoc:
      name: "CCS811 Total Volatile Organic Compound"
    i2c_id: bus_a
    address: 0x5A
    update_interval: 20s   
    baseline: 0xB2BD 

  - platform: bme280
    temperature:
      name: "BME280 Temperature"
      oversampling: 16x
    pressure:
      name: "BME280 Pressure"
    humidity:
      name: "BME280 Humidity"
    i2c_id: bus_a
    address: 0x76
    update_interval: 20s

I normally connect via USB, because OTA update doesnt work without Wifi.

Output with SHT3X coonfigured (No Wifi working)
[D][wifi:425]: Starting scan…
[D][ccs811:091]: Status indicates no data ready!
[D][sht3xd:060]: Got temperature=28.42°C humidity=57.57%
[D][sensor:093]: ‘Living Room Temperature’: Sending state 28.42069 °C with 1 decimals of accuracy
[D][sensor:093]: ‘Living Room Humidity’: Sending state 57.57076 % with 1 decimals of accuracy
[D][sensor:093]: ‘BME280 Temperature’: Sending state 27.70000 °C with 1 decimals of accuracy
[D][sensor:093]: ‘BME280 Pressure’: Sending state 1014.75342 hPa with 1 decimals of accuracy
[D][sensor:093]: ‘BME280 Humidity’: Sending state 53.24316 % with 1 decimals of accuracy
[D][wifi:440]: Found networks:
[D][wifi:442]: No network found!
[D][sht3xd:060]: Got temperature=28.45°C humidity=56.22%
[D][sensor:093]: ‘Living Room Temperature’: Sending state 28.45007 °C with 1 decimals of accuracy
[D][sensor:093]: ‘Living Room Humidity’: Sending state 56.21729 % with 1 decimals of accuracy
[D][wifi:425]: Starting scan…
[D][wifi:440]: Found networks:
[D][wifi:442]: No network found!
[D][sensor:093]: ‘BME280 Temperature’: Sending state 27.69000 °C with 1 decimals of accuracy
[D][sensor:093]: ‘BME280 Pressure’: Sending state 1014.73560 hPa with 1 decimals of accuracy
[D][sensor:093]: ‘BME280 Humidity’: Sending state 52.13672 % with 1 decimals of accuracy
[D][ccs811:091]: Status indicates no data ready!
[D][wifi:425]: Starting scan…
[D][sht3xd:060]: Got temperature=28.46°C humidity=57.50%
[D][sensor:093]: ‘Living Room Temperature’: Sending state 28.46342 °C with 1 decimals of accuracy
[D][sensor:093]: ‘Living Room Humidity’: Sending state 57.50210 % with 1 decimals of accuracy

Full sketch not a part of it !!!

Network part without SHT3X:

[D][wifi:425]: Starting scan...
[D][wifi:440]: Found networks:
[I][wifi:483]: - 'KMV1' (08:9B:.....
[D][wifi:485]:     Channel: 11
[D][wifi:486]:     RSSI: -74 dB
[I][wifi:483]: - 'KMV11' (08:9B:......
[D][wifi:485]:     Channel: 11
[D][wifi:486]:     RSSI: -79 dB
[D][wifi:488]: - '' (62:9B:.....
[D][wifi:488]: - 'HUAWEI-E5186-C420' (8C:EB:...
[D][wifi:488]: - 'NOKIA-E6D0' (80:AB:...
[D][wifi:488]: - '' (62:AB:4D:.....
[I][wifi:274]: WiFi Connecting to 'KMV1'...
[I][wifi:557]: WiFi Connected!

All sensors are still connected with wires. SHT3X is just removed from config.

Full is uploaded

  - platform: sht3xd
    temperature:
      name: "Temperature External SHT31"
      accuracy_decimals: 1
    humidity:
      name: "Humidity External SHT31"
      accuracy_decimals: 0
    address: 0x44
    update_interval: 60s

D1 Mini +DHT11+BME680

In my logs I can see I2C scan find the sensor. So I can see this which tells me the SHT31(0x44) has been found. If you are not getting that close then wiring and power to check

1 Like

Do you know if it is a authentic d1 mini or a clone?

Some of the cheap clones can be pretty flakey when you ask them to do anything more than a minimal task.

Some people have success mitigating issues caused by power demand spikes on boot by spreading some of the set-up at the sensor level.

setup_priority: -100

This sort of delay on boot can sometimes help too.

on_boot:    
    - priority: 900
      then:
      - lambda: |-
          Wire.begin();
          delay(500);
1 Like

It does find the sensor when scanning. But as I said, the sensor doesn’t even have to be physically connected. It is enough that I configure it, so that the shr3xd library is loaded. Then it doesn’t work.

And the same physical setup works great with my own arduino scetch.

That did the trick. (And yes, it’s a clone)

Added this to project start:

esphome:

  name: esp8266-wemos2

  friendly_name: ESP8266-wemos2

  on_boot:    

    - priority: 600

      then:

      - lambda: |-

          Wire.begin();

          delay(500);

Setup_priority: -100 did not change anything.

Thx :slight_smile:

1 Like