AHT10 connected but no readings

Hello!

Yesterday night I configured a ESP32 NodeMCU, with a AHT10 and BH1750 (Luminosity sensor), I wired up everything, and then I started to look for the ESPHome templates and I thought that was not going to work on the first attempt but to my surprise, it worked flawlessly. I was able to see temperature, humidity, and lx on my home assistant dashboard. I used this configuration:

esphome:
  name: esp32node04
  friendly_name: esp32node04

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxx="

ota:
  - platform: esphome
    password: "xxx"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32node04"
    password: "xxx"

captive_portal:

# Example configuration entry for ESP32
i2c:
  sda: GPIO21
  scl: GPIO22
  scan: true
  id: bus_a

binary_sensor:
  - platform: gpio
    pin: GPIO35
    name: "PIR"
    device_class: motion

sensor:
  - platform: bh1750
    name: "LUX"
    address: 0x23
    update_interval: 60s

  - platform: aht10
    variant: AHT10
    # address: 0x38
    temperature:
      name: "TEMP"
    humidity:
      name: "HUM"
    update_interval: 60s

After that is started thinking with filters, more specifically with throttle and delta, I wanted to have more responsive updates when detecting abrupt changes, so I set the update_interval to 1s and added this filter:

  - platform: aht10
    variant: AHT20
    # address: 0x38
    temperature:
      name: "TEMP"
      filters:
        - or:
          - throttle: 60s
          - delta: .5
    humidity:
      name: "HUM"
      filters:
        - or:
          - throttle: 60s
          - delta: .5
    update_interval: 1s

After that looks like my AHT10 stopped working, I tried a bunch of things:

  • rewiring everything up again
  • changed de variant from AHT10 to AHT20
  • changed the frequency parameter under the i2c configuration to 100kHz and 200Hz (with both I got: Communication with AHT10 failed!)
  • cleaned the build cache
  • set the address manually

None of these attempts worked. When I initialize the ESP32 I can see the i2C device listed, but I never saw temperature or humidity readings again

[23:03:52][I][i2c.arduino:096]: Results from i2c bus scan:
[23:03:52][I][i2c.arduino:102]: Found i2c device at address 0x23 # bh1750
[23:03:52][I][i2c.arduino:102]: Found i2c device at address 0x38 # AHT10

I think that’s a good sign, the device is being recognized, but isn’t working and I don’t know what else I can test, For me the strangest part is that it was working before I started playing with filters… And on all my attempts the bh1750 never stopped working.

Someone have any idea about what is going on and what else I can try?

Thanks

Here is my full log by the way:

INFO ESPHome 2024.12.4
INFO Reading configuration /config/esphome/esp32node04.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing esp32node04 (board: esp32dev; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.4
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.6
|-- Wire @ 2.0.0
Compiling .pioenvs/esp32node04/src/main.cpp.o
Linking .pioenvs/esp32node04/firmware.elf
RAM:   [=         ]  12.5% (used 41088 bytes from 327680 bytes)
Flash: [=====     ]  51.4% (used 944041 bytes from 1835008 bytes)
Building .pioenvs/esp32node/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs/esp32node04/firmware.bin"], [".pioenvs/esp32node04/firmware.elf"])
Wrote 0xf7e30 bytes to file /data/build/esp32node04/.pioenvs/esp32node04/firmware.factory.bin, ready to flash to offset 0x0
esp32_copy_ota_bin([".pioenvs/esp32node04/firmware.bin"], [".pioenvs/esp32node04/firmware.elf"])
========================= [SUCCESS] Took 21.01 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.107.38 port 3232...
INFO Connected to 192.168.107.38
INFO Uploading /data/build/esp32node04/.pioenvs/esp32node04/firmware.bin (949808 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 9.49 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.1xx.xx.xx using esphome API
WARNING Can't connect to ESPHome API for esp32node04 @ 192.168.107.38: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.1xx.xx.xx', port=6053))]: [Errno 113] Connect call failed ('192.1xx.xx.xx', 6053) (SocketAPIError)
INFO Trying to connect to esp32node04 @ 192.168.107.xx in the background
INFO Successfully connected to esp32node04 @ 192.1xx.xx.xx in 0.012s
INFO Successful handshake with esp32node04 @ 192.1xx.xx.xx in 0.145s
[23:09:46][I][app:100]: ESPHome version 2024.12.4 compiled on Jan 27 2025, 23:08:14
[23:09:46][C][wifi:600]: WiFi:
[23:09:46][C][wifi:428]:   Local MAC: xx:0A:xx:C6:xx:xx
[23:09:46][C][wifi:433]:   SSID: [redacted]
[23:09:46][C][wifi:436]:   IP Address: 192.1xx.xx.xx
[23:09:46][C][wifi:440]:   BSSID: [redacted]
[23:09:46][C][wifi:441]:   Hostname: 'esp32node04'
[23:09:46][C][wifi:443]:   Signal strength: -54 dB ▂▄▆█
[23:09:46][C][wifi:447]:   Channel: 1
[23:09:46][C][wifi:448]:   Subnet: 255.255.255.0
[23:09:46][C][wifi:449]:   Gateway: 192.1x.xx.xx
[23:09:46][C][wifi:450]:   DNS1: x.x.x.x
[23:09:46][C][wifi:451]:   DNS2: xx.xx.xx.xx
[23:09:46][C][logger:185]: Logger:
[23:09:46][C][logger:186]:   Level: DEBUG
[23:09:46][C][logger:188]:   Log Baud Rate: 115200
[23:09:46][C][logger:189]:   Hardware UART: UART0
[23:09:46][C][i2c.arduino:071]: I2C Bus:
[23:09:46][C][i2c.arduino:072]:   SDA Pin: GPIO21
[23:09:46][C][i2c.arduino:073]:   SCL Pin: GPIO22
[23:09:46][C][i2c.arduino:074]:   Frequency: 50000 Hz
[23:09:46][C][i2c.arduino:086]:   Recovery: bus successfully recovered
[23:09:46][I][i2c.arduino:096]: Results from i2c bus scan:
[23:09:46][I][i2c.arduino:102]: Found i2c device at address 0x23
[23:09:46][I][i2c.arduino:102]: Found i2c device at address 0x38
[23:09:46][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'PIR'
[23:09:46][C][gpio.binary_sensor:015]:   Device Class: 'motion'
[23:09:46][C][gpio.binary_sensor:016]:   Pin: GPIO35
[23:09:46][C][bh1750.sensor:118]: BH1750 'LUX'
[23:09:46][C][bh1750.sensor:118]:   Device Class: 'illuminance'
[23:09:46][C][bh1750.sensor:118]:   State Class: 'measurement'
[23:09:46][C][bh1750.sensor:118]:   Unit of Measurement: 'lx'
[23:09:46][C][bh1750.sensor:118]:   Accuracy Decimals: 1
[23:09:46][C][bh1750.sensor:119]:   Address: 0x23
[23:09:46][C][bh1750.sensor:124]:   Update Interval: 10.0s
[23:09:46][C][aht10:162]: AHT10:
[23:09:46][C][aht10:163]:   Address: 0x38
[23:09:46][C][aht10:167]:   Temperature 'TEMP'
[23:09:46][C][aht10:167]:     Device Class: 'temperature'
[23:09:46][C][aht10:167]:     State Class: 'measurement'
[23:09:46][C][aht10:167]:     Unit of Measurement: '°C'
[23:09:46][C][aht10:167]:     Accuracy Decimals: 2
[23:09:46][C][aht10:168]:   Humidity 'HUM'
[23:09:46][C][aht10:168]:     Device Class: 'humidity'
[23:09:46][C][aht10:168]:     State Class: 'measurement'
[23:09:46][C][aht10:168]:     Unit of Measurement: '%'
[23:09:46][C][aht10:168]:     Accuracy Decimals: 2
[23:09:46][C][captive_portal:089]: Captive Portal:
[23:09:46][C][mdns:116]: mDNS:
[23:09:46][C][mdns:117]:   Hostname: esp32node04
[23:09:46][C][esphome.ota:073]: Over-The-Air updates:
[23:09:46][C][esphome.ota:074]:   Address: esp32node04.local:3232
[23:09:46][C][esphome.ota:075]:   Version: 2
[23:09:46][C][esphome.ota:078]:   Password configured
[23:09:46][C][safe_mode:018]: Safe Mode:
[23:09:46][C][safe_mode:020]:   Boot considered successful after 60 seconds
[23:09:46][C][safe_mode:021]:   Invoke after 10 boot attempts
[23:09:46][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[23:09:46][C][api:140]: API Server:
[23:09:46][C][api:141]:   Address: esp32node04.local:6053
[23:09:46][C][api:143]:   Using noise encryption: YES
[23:09:50][D][bh1750.sensor:159]: 'LUX': Got illuminance=2.3lx
[23:09:50][D][sensor:094]: 'LUX': Sending state 2.26378 lx with 1 decimals of accuracy
[23:10:00][D][bh1750.sensor:159]: 'LUX': Got illuminance=2.3lx
[23:10:10][D][bh1750.sensor:159]: 'LUX': Got illuminance=2.3lx

Only thing I can suggest is removing all hardware and configuration except for the bare bones you need to debug the AHT10 and see if that works.

How is your wiring? I2C needs short and solid wiring.
Is your sensor powered from 3.3V pin?

Just configured e new out-of-the-box ESP32, with just the code for the aht10 and it didn’t work, I had to change the variant to AHT20, and then it worked.

Move it back to the initial ESP32 with the bh1750, but I’ve commented all the other sensors and I worked when using the AHT20 variant, when I added the bh1750 it started again. I used the same setup, same wires, same ESP32 and it started working again.

When the update_interval is set for 60s everything is working fine, but when I start playing with filters, and throttle strange things start to happen.

When I set the update_interval to 1s on the bh1750, and 60s everyting woks
When I set the update_interval to 1s on the bh1750, and 1s for the aht10 everyting woks

But when I start playing with the throttle just the bh1750 works correctly the aht10 doesn’t work as expected:

sensor:
  - platform: bh1750
    name: "LUX"
    address: 0x23
    filters:
      - or:
        - throttle: 60s
        - delta: .5
    update_interval: 1s
    # update_interval: 60s

  - platform: aht10
    variant: AHT20
    # address: 0x38
    temperature:
      name: "TEMP"
      filters:
        - or:
          - throttle: 60s
          - delta: .2
    humidity:
      name: " HUM"
      filters:
        - or:
          - throttle: 60s
          - delta: .2
    update_interval: 1s

The aht10 doesn’t update every 1s… the interval floats

[21:09:03][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:04][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:05][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:06][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:07][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:08][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:09][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:10][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:11][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:12][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:13][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:14][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:15][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:16][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:17][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:18][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:19][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:20][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:21][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:22][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:23][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:24][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:25][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:26][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:27][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:28][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:29][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:30][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:31][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:32][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:33][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:34][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:35][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:36][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:37][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:38][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:39][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:40][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:41][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:42][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:43][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:44][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:45][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:46][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:47][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:48][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:49][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:50][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:51][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:52][D][sensor:094]: 'Mateus Temperatura': Sending state 26.04809 °C with 2 decimals of accuracy
[21:09:52][D][sensor:094]: 'Mateus Umidade': Sending state 74.50037 % with 2 decimals of accuracy
[21:09:52][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:52][D][sensor:094]: 'Mateus Luminosidade': Sending state 43.80413 lx with 1 decimals of accuracy
[21:09:53][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:54][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:55][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:56][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx
[21:09:57][D][bh1750.sensor:159]: 'Mateus Luminosidade': Got illuminance=43.8lx

I don’t know why this is happening… For now, I’m going to keep it simple.

Thanks for the input.

Isn’t that because of your filters?

Try changing logger to VERY_VERBOSE?

EDIT: Hmm maybe not looking closer…