-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing battery usage with accelerometer permanently asleep #5
Comments
If someone could provide code to put the MPU9250 accelerometer in its lowest power state I will give it a try. Using the current mpuSleep() code is not ideal to test power saving but it at least leaves the MPU9250 in a known low power state. We cannot assume the MPU9250 will power up in a low power state and even if it does, a wake-up of the watch from a state in which the MPU9250 was not in a low power state will not alter this state unless some initialisation of the MPU9250 is done. John |
I've been trying to make sleep power consumption low, but at the time was absolutely impossible. Seems that MPU9250 was giving some problems for LilyGo and have changed the IMU chip: https://github.com/Xinyuan-LilyGO/LilyGO-T-Wristband Maybe it's not the best IMU for this kind of projects. |
Thanks for your response. There is a comparison links between MPU9250 and LSM9DS1 at However I guess the LSM9DS1, being an ST iNEMO model, might be more geared to making it easier to use wake-up gestures while keeping power usage down. Using the following as a reference: Above setup() in main.cpp
In setup() in main.cpp
|
To be honest, I think the ESP32 is not the best choice for a wrist device unless the whole board is designed for battery life. |
@wilksy you're right: ESP32 low power mode needs a board to be carefully designed, even with a PMU. For example, I also got a TTGO T-Beam and I could keep current consumption somewhere around uA by interfacing the built-in AXP192. First versions of the T-Wristband seems not to be very optimized for LP. Let's see what LilyGo does with their new T-Watch-2020 |
Here are some measurements. As a result of these measurements I agree with the above. In a sleep state with IMU_SKIP (as per above ) turned on constant 609uA at 3.9V. In a sleep state with IMU_SKIP off (code now same as repository code) the observed current varied between 834uA and 925uA also at 3.9V. So the MPU9250 is adding between about 220uA and 320uA to a constant current lowest of about 610uA with the accelerometer powered down as much as possible (if the code I used is correct for this). The idle mode current of the MPU9250 is 8uA (see next comment) Measurements were made by connecting to battery input terminal: John Heenan |
I have just checked the dastasheet for the MPU9250. The idle mode current is 8uA. There is an low power accelerometer mode with DMP, gyrometer and magnetometer disabled of 19.8uA at 31.25Hz. I don't know if the DMP is required to set interrupt triggering at certain thresholds. Comparing with datasheet of LSM9DS1, they do not provide a current for an idle or power down mode or for an accelerometer only mode. However other acceleromters in the series, such as the LSM6DSL do, which may be just the LSM9DS1 without the magetometer. The LSM6DSL has a power down current of 3uA and an accelerometer only low power current of 9uA at 12.5Hz. I don't know if this will include interrupt triggering at set thresholds. I have the impression it does. John Heenan |
I am getting far better results with another T-Wristband using SKIP_IMU above. My guess is that it is currently drawing power at 10uA or under. I am reluctant to open it up. Will report again in the next few days |
Progress report after nearly four days with MPU9250 accelerometer permanently powered down with IMU_SKIP (as per above) and checking time several times each day: It looks like the watch is going to last over a week without a charge! |
Unlike the first few days, at day 6 there has been a rapid decline in voltage during the day from around 20%? (unrecorded voltage) to 0% (3.09V down to 2.86V recorded) as the battery rapidly approached discharge. If we assume the 80mAh battery optimistically gave back 100% of its rated capacity this means over about six days or about 150 hours the average current was close to 80*1000/150= 533uA. This is close enough, for practical purposes, to the 609uA measured before. The watch display was turned on several times each day so this affects the result. So unless there is something wrong with the way the way the accelerometer was powered down with IMU _SKIP, there appears to be little practical that can be done. For example dropping average current use of the accelerometer from say 270uA to say 10uA is not going to make a great difference on top of 500uA or more. 50% extra time on an already short time is sill a short time. |
@johnheenan Thanks for the research. Unfortunately, my wristband is not powering up again since I've been trying to solder a MS412FE battery that wasn't populated in my unit. My soldering iron tip wasn't small enough :(. The china post in my country is not working because of the coronavirus outage, I'll try to order a new one to continue the development. If you want, you can send a PR to include your changes. I think Lilygo will send the new one with the new IMU chip so my code will need to support both IMUs. |
I have put up a PR but I am going to withdraw it and resubmit it with the following changes with regard to time zones.
|
Allow use of daylight savings anywhere or not at all Use of variables to allow firmware default timezones that that can be changed by users without affecting underlying code
Removed a line from the current PR and timezones branch preventing the IMU from remaining in deep sleep. |
I have resorted to hot airing the LSM9DS1 off, ESP deep sleep with timer now at 0.518ma down from 1.67ma with the IMU in place, why they didnt hang it off an I/O pin is beyond me or give us a library that makes it sleep efficiently |
I have been testing the wristband with the accelerometer permanently asleep and skipped with button press.
The results are very encouraging and makes the wristband much more practical for me.
These are the steps I have taken so far:
Added to build_flags in plarform.ini:
-DIMU_SKIP
After initMPU() in setup() in main.cpp
In showPage() in pages.cpp
In handleSleep() of hardware/sleep.cpp
also:
For completeness but not required: in handleAction() in pages/pages.cpp:
John Heenan
The text was updated successfully, but these errors were encountered: