Back to Engineering Blog
Engineering

The Art of Microamps: Optimizing Battery Life in STM32 Wearables

5 min readNSquare Bros Engineering Team
Featured image for The Art of Microamps: Optimizing Battery Life in STM32 Wearables

Designing for battery life is not just about choosing a large battery. It is about fighting for every microamp of consumption. When we design wearables, we start by analyzing the sleep currents of every component on the Bill of Materials. A single inefficient voltage regulator can drain a battery in weeks instead of years. We meticulously select low-quiescent current LDOs and switching regulators that maintain high efficiency even at light loads, ensuring that the power delivery network does not become a parasitic load itself. This is a core part of our Embedded Hardware design philosophy.

The STM32 family of microcontrollers offers various low-power modes, but the most effective for wearables is the STOP mode. In this state, the core clock is stopped, but the SRAM content is retained. This allows the device to wake up in mere microseconds, perform a task, and go back to sleep. We carefully configure the wake-up sources, utilizing the Real-Time Clock (RTC) for periodic tasks and external interrupts for user interactions. This event-driven architecture ensures that the CPU is active only when absolutely necessary.

We also rely heavily on Direct Memory Access or DMA. By allowing peripherals to transfer data to memory without waking the CPU, we save significant energy. For example, a sensor can fill a buffer with data while the main processor remains in deep sleep. Once the buffer is full, an interrupt wakes the CPU to process the data in a burst, maximizing the time spent in the lowest power state. This technique is particularly effective for high-data-rate sensors like accelerometers and microphones, often used in our IoT Solutions.

Another critical factor is the choice of external sensors. We prefer sensors with dedicated "interrupt pins" and autonomous FIFO buffers. This allows the MCU to stay asleep until an event actually happens, rather than waking up repeatedly to check the status. For instance, an accelerometer can be configured to detect motion or free-fall independently, asserting an interrupt only when a significant event occurs. This offloads the processing burden from the MCU and drastically reduces the system's average power consumption.

Finally, we profile the power usage using high-precision source measure units. Theory is good, but real-world measurement is the only way to verify that a device will last the intended 2 years on a coin cell. We capture dynamic current profiles to identify current spikes and unexpected wake-ups. This empirical data allows us to fine-tune the firmware and hardware, squeezing every last joule of energy from the battery and delivering a truly long-lasting product. For expert assistance with power optimization, explore our Consultation services.