How to reduce power consumption reduction for a wearbale project

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
V!nce
Posts: 20
Joined: Sun May 22, 2022 4:35 pm

How to reduce power consumption reduction for a wearbale project

Post by V!nce » Fri Aug 19, 2022 1:08 pm

Hi everyone,

I am currently finalizing my first prototype ever: an arm band that sense acceleration, electrodermal activity and BVP (Blood Volume Pulse)!
As you can imagine, I am very excited as it is my first electronics project ever. Here is the list of the components I use:
  • ESP32 Devkit C
  • MPU6050 accelerometer (25hz)
  • MAX30102 for BVP and temperature (50hz and 4hz respectively)
  • Simple circuit with DAC and ADC Pins as well as some AgCl electrodes (https://www.researchgate.net/figure/Bas ... _272744552 (20hz)
  • SPI micro-SD card reader
  • buttons, leds and resistors
My goal is to mount everything on the armband and use an external battery to power it in the first time. Then I wanted to order an esp32 that is smaller and has battery controllers and headers so i could integrate a small lipo battery. However, before buying anything, I decided to buy a small esb watt-meter to test power consumption and was horrified to see the results: between 55 and 65 mA when plugged with a USB cable. Therefore I estimate I would need a really big battery to power the device for 24h. I started checking how to optimize my power consumption. My ultimate goal would be to land at 30 mA so I could use a small battery and final implementation into a watch would be possible.

I'm not gonna post code snippets right now because the program is very simple:
  1. A main uasyncio coroutine that does the starting sequence like select uart streaming or local mode and then starts several uasyncio coroutines (one infinite loop by sensor that takes data and save it into a bytearray buffer)
  2. A loop that writes the byterray to a file or send it to a computer via stdout.buffer.write()
  3. Using the pushbutton primitive to be able to use 2 buttons to select the mode or stop the program and put the esp32 into deepsleep mode until the wake or reset button is pressed
Here are the points I may have identified to improve power draw:
  • Lowering CPU frequency from 160mhz to 80mhz which lowered to current to 41-49 mA constant (The watt meter is crap, i'm gonna get a better one, any recommandations?). The issue with that is the sensor frequency is even more off...
  • Maybe using a better esp32 with power circuit optimization such as the TinyPico or TinyS3 and running on 3.7V battery would improve performance
  • Replacing the MPU6050 by an ADXL345 because the MPU led and gyroscope consume more power than the accelerometer with no way to turn them off (I can always burn off the led/led resistor)
  • Using Fast_io to improve I/O speed and coroutine scheduling with the lowered cpu frequency. Sadly, the power consumption optimizations seem to only work with the pyboard.
  • Turning off the modem if not off by default but I couldn't find a way to do it in micropython on the esp32
I may have forgotten one or two things. I can add the sensor libraries I used eventhough I slightly modified them (including the pushbutton one to have customizable delays at initiation). Feel free to make any suggestion on what to improve, what to change, what to buy! I'm completely open. Even if I only reach about 35mA it will already be a huge improvement that will allow me to downsize the battery :D
Thanks for reading this novel and thanks in advance for your help!
Last edited by V!nce on Tue Aug 23, 2022 1:23 am, edited 1 time in total.

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: Power consumption reduction for a wearbale project

Post by karfas » Fri Aug 19, 2022 7:54 pm

Your goal of 30mA is in my opinion way too much current for a wearable project. A (quite large) 18650 li-ion battery has -2500mAh, so giving you only 8 hours runtime.
What exactly (acc. to datasheet) use your sensors ?
You might be able to power them from a GPIO, so giving you full control over their power usage.
You should consider to put the ESP in one of the sleep modes (0.8mA in light sleep compared to 20mA).
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

V!nce
Posts: 20
Joined: Sun May 22, 2022 4:35 pm

Re: Power consumption reduction for a wearbale project

Post by V!nce » Fri Aug 19, 2022 8:15 pm

Are you sure about your battery life estimation? From my tests, in USB (5V) I am currently using about 1 or 2 mAh/min (given by my wattmeter). So a 1400 mAh battery would be way enough to run the device for an entire day if I reach 30mA. I was thinking of using a ADXL345 accelerometer to replace the MPU6050.

MPU6050 datasheet: https://invensense.tdk.com/wp-content/u ... sheet1.pdf
ADXL345 datasheet: https://www.analog.com/media/en/technic ... DXL345.pdf

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: Power consumption reduction for a wearbale project

Post by karfas » Fri Aug 19, 2022 8:56 pm

Sorry, I had my calculation wrong. Simple math (I should use a calculator late at night). hours = capacity / current.
So 2500mAh/30mA => 83 hours (might be enough for your project).
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

V!nce
Posts: 20
Joined: Sun May 22, 2022 4:35 pm

Re: Power consumption reduction for a wearbale project

Post by V!nce » Fri Aug 19, 2022 9:04 pm

Thanks! You really scared me hahahah
I would love to hit a minimum of 30 hours. So you can just charge it once a day and still have some margin, even accounting for battery degradation :)
Reaching 30 mA would allow me to scale down the battery to something like 800 mAh which could maybe fit in a (big) bracelet.
Also, I didn't answer uour point about sleep mode, as the sensors are running continuously in parallel using uasyncio, it's impossible to put the esp in light sleep. Unless it's possible to modify uasyncio to to so between 2 measurements which is impossible I believe.
I will check if i could use a GPIO DAC to power some sensors...

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: Power consumption reduction for a wearbale project

Post by karfas » Sun Aug 21, 2022 9:12 am

V!nce wrote:
Fri Aug 19, 2022 9:04 pm
Unless it's possible to modify uasyncio to to so between 2 measurements which is impossible I believe.
The deep and light sleep modes are similar to a new start of the micropython interpreter or a reset.
Unless you need very frequent or continuous sensor readings, it might be worthwhile to redesign with one of the sleep modes in mind. When the thing is running, it can still use asyncio to read the sensors in parallel (before it goes to sleep again).
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

V!nce
Posts: 20
Joined: Sun May 22, 2022 4:35 pm

Re: Power consumption reduction for a wearbale project

Post by V!nce » Sun Aug 21, 2022 1:50 pm

I have already implemented deepsleep on a long press of a button (and the press the same button to come out of deepsleep). I'm trying to reduce power consumption during operation when the device is continuously sampling data :)

Post Reply