Sleep mode on ESP32-Cam
Posted: Thu Oct 07, 2021 10:43 am
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
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.
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
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.