Temperature of AHT20 sensor keeps rising on Wemos S2 mini

I’ve got an ENS160/AHT21 sensor. When using a Wemos D1 mini (ESP8266) it works great, but now I switched to a Wemos S2 mini (ESP32S2) and the temperature/humidity values are wrong.

They start with the correct values (20°C/60%) but with every refresh, the value keeps changing until it reaches about 25°C/50%.

What I already tried:

  • I’ve used both 3.3V and 5V power.
  • Other update intervals (shortest 10s, longest 600s)
  • Longer wires so the sensor isn’t close to the Wemos.

Any idea what causes this issue?

My config:

# ESPHome version 2024.10.1
esp32:
  board: lolin_s2_mini
  variant: ESP32S2
i2c:
  sda: GPIO13
  scl: GPIO14
  scan: true
  id: bus_a
sensor:
  - platform: ens160_i2c
    i2c_id: bus_a
    update_interval: 600s
    address: 0x53
    aqi: # ...
    eco2: # ...
    tvoc: # ...
  - platform: aht10
    variant: AHT20 # AHT21
    update_interval: 180s
    address: 0x38
    i2c_id: bus_a
    temperature: # ...
    humidity: # ...

Can you post your log?

Of course, but nothing to see there:


[11:29:58][D][sensor:094]: 'Temperatuur': Sending state 24.07818 °C with 1 decimals of accuracy
[11:29:58][D][sensor:094]: 'Luchtvochtigheid': Sending state 51.47409 % with 1 decimals of accuracy
[11:32:58][D][sensor:094]: 'Temperatuur': Sending state 23.89603 °C with 1 decimals of accuracy
[11:32:58][D][sensor:094]: 'Luchtvochtigheid': Sending state 51.48726 % with 1 decimals of accuracy
[11:35:58][D][sensor:094]: 'Temperatuur': Sending state 23.77453 °C with 1 decimals of accuracy
[11:35:58][D][sensor:094]: 'Luchtvochtigheid': Sending state 52.16579 % with 1 decimals of accuracy
[11:38:58][D][sensor:094]: 'Temperatuur': Sending state 23.81954 °C with 1 decimals of accuracy
[11:38:58][D][sensor:094]: 'Luchtvochtigheid': Sending state 51.92528 % with 1 decimals of accuracy
[11:41:58][D][sensor:094]: 'Temperatuur': Sending state 23.78254 °C with 1 decimals of accuracy
[11:41:58][D][sensor:094]: 'Luchtvochtigheid': Sending state 51.96705 % with 1 decimals of accuracy

for sure not…
What’s the distance between Esp and sensor?
Does your Esp8266 have same Esphome revision?

20cm difference. And yes, version numbers are the same.

Are sensor and wemos in a small container? Basic problem is heat of esp device increasing temp. As temp goes up humidity goes down.

No, there is no heat coming from the Wemos. And there is no difference between the S2 and D1 in the fysical setup.

The datasheet on the sensor says it has a warm-up period with 1hour initial startup. Perhaps when it has reached its max temp you have to set an offset of 5 degees or so. I do so with my sensors with a calibrated source. If the esp is on it will also always be generating waste heat. Turn on the internal temperature sensor to see.

The ens160 has a warm-up period of 1 hour. That doesn’t explain why the AHT21 has an inaccurate value. And it also doesn’t explain why the Wemos D1 gives perfect values, while the Wemos S2 doesn’t.

Esp32 can supply up to 40mA and esp8266 only 12mA if I remember correctly to each gpio pin. Perhaps heat creap across the pcb.

I don’t understand. You think the sensor pcb gets more power with the S2 so it heats up? And if so, how can I fix this?

Perhaps. Recalibrate the sensor in esphome.

What do you mean with recalibrate?

# Example configuration entry
- platform: dht
  # ...
  temperature:
    name: "DHT22 Temperature"
    filters:
      - calibrate_linear:
         method: least_squares
         datapoints:
          # Map 0.0 (from sensor) to 1.0 (true value)
          - 0.0 -> 1.0
          - 10.0 -> 12.1

Check out pages on esphome. The documentation allows you to do it various ways.

Wasn’t it powered from 3.3V pin?
Anyway, we haven’t seen wiring, neither full yaml…

How you know that? Measured with what?
For debugging remove that ens160. Try little bit longer distance between Esp and sensor.

What else do you need? What kind of information do you miss?

I’ve compared it with other temp/hum sensors in my house. And the values are perfectly aligned with the other 12 sensors I’ve got.

And I can’t remove the ENS160 because it’s one device. And I already have a 10cm wire between the sensor and the ESP.

That won’t help. The temperature is not just a couple of degrees off, it’s inaccurate/unstable. This is the temperature compared to another sensor in the same room:

Yes, of course. We’re speculating. A picture can often give a lot of useful information. I use gpios to power temp sensors with deepsleep for various reasons. May not be useful here. Again speculating.