ESP32 interfaced with AHT10 sensor

HAD1406
Posts: 12
Joined: Thu Jun 05, 2025 10:16 am

ESP32 interfaced with AHT10 sensor

Postby HAD1406 » Tue Jul 01, 2025 10:00 am

So in a project, for power management purpose we have to put an AHT10 sensor interfaced with ESP32 to sleep without using any external devices(Transistors, MOSFET, etc.) What is the correct approach ?

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 interfaced with AHT10 sensor

Postby Sprite » Wed Jul 02, 2025 1:25 am

According to the docs for that sensor, it has a sleep mode in which it only uses 0.25uA.

HAD1406
Posts: 12
Joined: Thu Jun 05, 2025 10:16 am

Re: ESP32 interfaced with AHT10 sensor

Postby HAD1406 » Wed Jul 02, 2025 4:44 am

According to the docs for that sensor, it has a sleep mode in which it only uses 0.25uA.
But there are no specific commands for entering the sleep mode using AHT10, right? The state in which it uses only 0.25uA is the state immediately after a power up and before you send the initialization command.

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 interfaced with AHT10 sensor

Postby Sprite » Wed Jul 02, 2025 5:19 am

This driver hints that there is a measure + go to sleep command; you could try that. If you want to be really sure: the sensor only seems to draw a few tens of uA in active mode; you could just tie its power supply pin to a GPIO and pull that high to power the sensor.

HAD1406
Posts: 12
Joined: Thu Jun 05, 2025 10:16 am

Re: ESP32 interfaced with AHT10 sensor

Postby HAD1406 » Wed Jul 02, 2025 7:15 am

This driver hints that there is a measure + go to sleep command; you could try that. If you want to be really sure: the sensor only seems to draw a few tens of uA in active mode; you could just tie its power supply pin to a GPIO and pull that high to power the sensor.
So is using a transistor/MOSFET along with the sensor a good approach or perhaps the only safe approach since the AHT10 docs do not mention any "user controlled sleep" ?

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 interfaced with AHT10 sensor

Postby Sprite » Thu Jul 03, 2025 1:57 am

I dunno? You can check if the device goes into sleep mode after a measurement (what that library implies) by either asking the manufacturer or by testing it. The alternative, as I said, is to power the sensor directly from a GPIO; the GPIO current should be enough to power it and that way you don't need a transistor.

HAD1406
Posts: 12
Joined: Thu Jun 05, 2025 10:16 am

Re: ESP32 interfaced with AHT10 sensor

Postby HAD1406 » Fri Jul 04, 2025 10:01 am

I dunno? You can check if the device goes into sleep mode after a measurement (what that library implies) by either asking the manufacturer or by testing it. The alternative, as I said, is to power the sensor directly from a GPIO; the GPIO current should be enough to power it and that way you don't need a transistor.
Tried connecting Vcc of AHT10 to to a gpio of ESP32 and setting it to 0 before esp goes to deep sleep. Still we are getting the same power across the sensor even when in deep sleep. The sensor data stops printing in deep sleep but power consumption still remains the same. What should we do?

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32 interfaced with AHT10 sensor

Postby MicroController » Fri Jul 04, 2025 11:18 am

Try gpio_deep_sleep_hold_en() and see if that makes a difference.

HAD1406
Posts: 12
Joined: Thu Jun 05, 2025 10:16 am

Re: ESP32 interfaced with AHT10 sensor

Postby HAD1406 » Fri Jul 04, 2025 12:49 pm

Try gpio_deep_sleep_hold_en() and see if that makes a difference.
Thanks! but it didn't work. I think the LCD and the AHT10 are still drawing power even when the esp goes to deep sleep. How to stop that completely.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: ESP32 interfaced with AHT10 sensor

Postby MicroController » Fri Jul 04, 2025 3:31 pm

What LCD?!
How much power?
If you want to actually completely switch off power (3.3V) of external devices (which you can't power directly from a GPIO pin like the AHT10), the easiest way is indeed to just hook up a P-channel MOSFET to 3.3V and a GPIO output ("high-side switch").

Who is online

Users browsing this forum: Applebot, Bing [Bot], ChatGPT-User, Google [Bot], PerplexityBot, Semrush [Bot] and 11 guests