Page 1 of 1

Sleep mode on ESP32-Cam

Posted: Thu Oct 07, 2021 10:43 am
by AndyGadget
Not a problem . . . A fix!

I was testing an ESP32-CAM module in sleep mode and discovered that the flash LED is slightly lit when sleeping.
I googled around a bit and saw that it's a known thing and the 'fix' is to set GPIO4 (the flash controlling pin) low and then enter a lighter sleep mode where pin states are preserved (but with higher current draw). Annex doesn't support this mode, so I dug deeper . . .

Looking at the schematic, the flash LED is driven via a NPN transistor with a 1K resistor to GPIO4 and a 10K pulldown on the base. All well and good; the 1K limits the current to the transistor base and the 10K pulls the base to gnd when GPIO4 floats in sleep mode. So the LED should turn off when the processor is asleep.

So, out with the multimeter and I discovered that those cunning scoundrels have omitted the 10K pulldown on the board, thus saving the cost of an SMD resistor and allowing transistor leakage current to flow due to the floating transistor base. I tacked a 10K from GPIO4 to ground and voila! the LED now turns of when sleeping. Annoyingly, it made hardly any difference to the overall sleep current :D

For reference, these are the currents I was seeing :-

NO SD card inserted
Fully operational, no flash 190mA
Fully operational with flash 440mA
Wifi sleep (no flash) 110mA
Wifi sleep, 80Mhz clock 80mA
Sleep 4.4mA

SD card increases current draw by 20mA when quiescent and causes more variation in active currents.
Sleep current with SD card is 25mA.

Sleep current current could be drastically reduced by replacing ANS1117 with pin compatible AP7361C with reported currents of under 1mA.

Re: Sleep mode on ESP32-Cam

Posted: Thu Oct 07, 2021 11:55 am
by bugs
25mA ! - Hardly a snooze.
Someone dug a bit further and found some poor design choices:-
https://time4ee.com/articles.php?article_id=126

Re: Sleep mode on ESP32-Cam

Posted: Thu Oct 07, 2021 12:20 pm
by AndyGadget
Hi Bugs. Interesting article.

While you were looking that up I was trying to reduce the camera draw on sleep by pulling its promising looking PWRDN pin high (currently to gnd via 1K) which had . . . no effect at all.

However, I then realised I had an 8GB SD card inserted in the module. Removing that dropped the sleep current to 4.2mA which ties up with the 5mA quiescent draw of the AMS1117 mentioned in the article. So, 20ma current draw by the card. I think it would be problematical to disable this during sleep as the ESP32 would be waking up to find it's boot device had vanished :D

I've updated the figures in my first post to reflect this.

Added - The article mentions the SD card drawing 200uA; Way less than mine.
His photos show no details of the card.