Core2 deep sleep with wakeup by PIR sensor
-
Hello everyone!
I'm new to M5Stack products, and just bought Core2 with Axp2101, stacked with expander M5Stack M123. Using M5Unified library.What I'm trying to achieve:
Use PIR sensor (currently connected to GPIO 36, via groove portB) to wake the unit from deep sleep, whenever it detects movement. I'm usingesp_sleep_enable_ext0_wakeup(GPIO_NUM_36, 1);And it kinda works, but the problem is Core2 still uses 30mA in deep sleep. I've tried disabling LCD, speaker, mic, etc., but the only way I was able to really drop it down was to use
M5.Power.Axp2101.setBLDO2(0);however, the PIR doesn't wake the unit anymore then. (it works great with just a sleep timer though, but I really need that PIR sensor wake up... )
Disabling other stuff from Axp2101 leaving only BLDO2 enabled:
M5.Power.Axp2101.setALDO1(0); M5.Power.Axp2101.setALDO2(0); M5.Power.Axp2101.setALDO3(0); M5.Power.Axp2101.setALDO4(0); M5.Power.Axp2101.setBLDO1(0); M5.Power.Axp2101.setDLDO1(0); M5.Power.Axp2101.setDLDO2(0);helped a bit, got down to about 25mA. But that is still way too high.
Is there some way to have true deep sleep, but be able to wake up with PIR sensor (which really should use a fraction of mA, if I'm not mistaken)?
Should I connect it in a different way maybe? -
Hello @drvval
BLDO2 controls the 5 V boost circuit.
When M5Core2 v1.1 is powered on, code in M5Unified library checks whether there is external 5 V power available (from M5Bus or Grove port).
If yes, the boost circuit is turned off, and M5Core2 is running from external power.
If no, the boost circuit is turned on (and consumes power) and M5Core2 is running from battery or USB.
Note: why, when running from USB or battery, turning the boost circuit off manually prevents ESP32 from waking up from deep sleep is not entirely clear to me.
In order to go lower you could try to power M5Core2 via 5V on the M5Bus or Grove port. And without USB connection.
(Testing gets a bit tedious this way, as one constantly needs to switch between USB for programming and external power for testing.)
Using external power via M5Bus (but without PIR connected) my M5Core2 v1.1 in deep sleep only consumes about 2.9 mA.
Thanks
Felix -
Hello @felmue !
Thank you for your answer!
Ultimately, I want to power core2 from the battery, so if I understand correctly, it is not possible to avoid 30mA current because of the 5V boost circuit, which needs to stay on in order to power ESP32?Do you think the situation would be any better on Core1 (Fire) which uses axp192?
@felmue said in Core2 deep sleep with wakeup by PIR sensor:
Using external power via M5Bus (but without PIR connected) my M5Core2 v1.1 in deep sleep only consumes about 2.9 mA.
Is there a simple way to connect external power from like a battery pack or something like that, so that the unit is still portable?
In the end, I just want to turn some LEDs on, whenever there is movement detected by PIR, but charging the battery every 2 days defeats the purpose of such setup
Thank you so much for your input!