LOG 1: How Components and Threads Work

A project log for Embedded System Power and Energy Estimation Tool

Python tools for analyzing a system's power consumption over time. Support for battery models and energy harvesting such as solar power.

Jake WachlinJake Wachlin 01/29/2022 at 21:160 Comments

The power consumption model considers as number of components with specified nominal current consumption. These components are spread out among any number of independent threads. Each thread can have any number of stages. Each stage has a configured length of time that it should run for. All threads repeat periodically. This setup mimics an embedded system running an RTOS, with scheduled tasks and interactions with external components. For example, an LED may be toggled at a prescribed frequency with some set on time. It can be given its own thread so that timing can be separate from other power consumption considerations. As another example, consider a sensor which is sampled every 10 seconds, then placed into a low power mode between samples. This can be readily supported in this thread representation. The image below shows this representation.

The implementation is straightforward. The user must know nominal current consumption of each component in each mode, and the timing between each stage. Currently, it is assumed that all components operate on the same voltage, but that may be changed in the future to allow for separate power buses to be considered. The code snippets below show how two separate threads are built. Here, some accelerometer is periodically sampled by an ESP32, and both the ESP32 and accelerometer enter sleep modes between the sampling. An led thread is created separately.

import embedded_power_model as epm

accel_thread = epm.Thread(name="Accelerometer Sampling", stages=[

led_thread = epm.Thread(name="LED", stages=[