Hi all,
I would like to know the best power saving solution for my specific case.
My xiao is battery powered (100mah li-ion), and stays most of the time (almost 99%) in system off, until intentionally waken up by the user with a tilt movement.
The rest of the time I really don´t care too much about the consumption, I use some sensors and BLE, but the battery is big enough for all them.
What is really important is the power consumption during system off.
My actual power off sequence is:
disable gyroscope
enable embedded tilt function on int1 (lsm6ds3)
set pinMode of int1 as INPUT_PULLDOWN_SENSE
call sd_power_system_off()
SLEEP…
It works perfectly but the current drained during the system off is still higher than expected.
I don´t know exactly what sd_power_system_off() does, maybe I have to power off something else manually before calling the function, something like the bluetooth radio, the flash, I don’t know…
The only needed hardware is the accelerometer, to wake up the xiao.
hi msfujino.
This is exactly what I need to know, what do I have to switch off or on to get the minimum current in system power off?
I didn´t set the flash in power down mode, neither set on the dcdc regulator.
Is it necessary to power off the ble radio too?
I ended up using the first solution, because of a library interference between Adafruit_SPIFlash.h and InternalFileSystem.h
Seems to work well, but I have to check the current, I will reply in a few days.
I’m here again, with some data.
Now the current in system off is around 246uA, better than before but not yet what I need.
Just to summarize my system off setup, now I put the onboard flash in deep sleep mode, no output is active, no serial, DC/DC is ON , the gyroscope is disabled, the accelerometer is active in low power (ODR 26hz), just to use the embedded tilt function that I use to generate the interrupt on int1 , configured as wakeup source with the statement "pinMode(PIN_LSM6DS3TR_C_INT1, INPUT_PULLDOWN_SENSE); ".
As shown in the link below, the sleep current should be about 24uA. Why don’t you first see if you can achieve this 24uA and then activate the accelerometer and interrupts?
As for accelerometer interrupts, @PJ_Glasso has lots of samples.
PJ, if you are reading this, please comment.
System off , nothing active, no wakeup source, no accelerometer , no gyroscope, no onboard flash, no serial: 82uA
Same with accelerometer and wakeup: 257uA
Did some more tests…
I loaded another example and I got 10uA, with accelerometer wakeup, just a little different wake up compared to the tilt I used before.
Then I applied this wakeup to my full app and I achieved 82uA (not bad)
Ok my app does sone more things… a lot of ble services, file read and write from internal flash (using little fs), gyroscope reading, battery level reading, strain gauge reading (external hx711).
But everything should be off when I go system off.
Now I have some 70uA to shave, maybe is the internal flash?
If you mean on-board flash, it consumes about 25uA.
If the external HX711 is powered from XIAO’s 3V3, this also adds up.
To reduce the sleep current, I think it is useful to start with the smallest configuration and gradually add features to find the source of consumption.
The Hx711 is powered through a mosfet switch, which is off during system off.
The last test I did with the same exact hardware, only a different software, and I got 10uA.
The only difference (in terms of software) is the use of the internalFS , I think is the flash of the cpu but maybe I’m wrong.
The rest doesn’t affect the system off behaviour. Or does it?
For XIAO with no external connections, the sleep current will be about 2.4 uA when 3.6 V is applied to the battery pad.
If the current exceeds 2.4uA, it may be consumed by external circuitry or the temperature-sensitive Schottky diodes used inside XIAO may have a high leakage current.