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