# Two Designs of Automatic Embedded System Energy Consumption Measuring Platforms Using GPIO
## 2 Related Works and Motivations
### Existing Methods  
Power saving and energy efficiency have been a consistently common research direction for embedded systems, with many power/energy consumption measuring and modeling methods having been proposed. Many battery-powered devices are equipped with a battery-monitoring unit (BMU), which continuously monitors the battery voltage, temperature, and current flowing into and out of the battery. Many researchers have proposed measuring or modeling the power consumption of embedded systems with the help of a BMU [1; 2; 3; 4; 5; 6; 7; 8; 9], particularly in research regarding smartphones. [PERSON] et al. [10] also proposed a method of measuring the energy consumption of Android smartphones with a battery voltage characteristic curve obtained by voltmeters. However, a BMU has two major disadvantages; namely, its resolution, which is typically 0.1 mAh on Android devices [7; 8], and its updating interval, which varies from several hundred milliseconds to several seconds [1; 3; 4; 7; 8]. The BMU also faces significant errors due to battery capacity degradation [3]. To overcome this shortcoming, [PERSON] et al. [11] proposed a method of modeling smart phone power consumption using a battery simulator from National Instruments. Some devices are equipped with data acquisition (DAQ) or a power meter connected to the power pack, which was widely used by researchers looking at power consumption measurement and the modeling of embedded systems [12; 13; 14]. [PERSON] et al. [15] used built-in energy counters on the Intel Calpella platform to measure actual power consumption by subsystems directly. The Running Average Power Limit (RAPL) is a Linux-based, driver-layer performance analysis tool, which can be used to measure the average power limit of an Intel CPU. [PERSON] et al. [16] and [PERSON] et al. [17] used RAPL to measure power consumption, with the resolution shown to be as high as 0.2 W. The sampling rate of DAQ can be up to 3 kHz, which is a much higher sampling frequency than that of the BMU. However, sampling at a high frequency is accompanied by a notable CPU time with a significant impact on the system performance, resulting in distorted measurements [12; 14; 18]. An infrared camera is a device that creates an image using infrared radiation. Infrared thermography can be used to intuitively show the use and distribution of energy in embedded systems by deploying an infrared camera on the surface of the board with heat transfer oil. The camera captures pictures of heat distribution and then calculates the energy consumed by the chip [10; 16]. This method is visual and intuitive, but it is not easy to quantify. Using power meters or other similar instruments is also a way to explore the power consumption of embedded systems, whereby the power supply is not directly connected to the board but is connected via a power meter. A multimeter was used in [10; 19], [PERSON] et al. [20] used a DC power supply, [PERSON] et al. [21] used current clamps, [PERSON] et al. [22] used power probes, and some researchers, like [PERSON] et al. [23] and [PERSON] et al. [24], used oscilloscopes. Many commercial power meters, such as Monsoon power monitors [25; 26; 27; 28; 29; 30; 31; 32; 33; 34; 35] and LEAP power measurement devices [36], can achieve a sampling frequency of 5 kHz, which is much better than BMUs. Some researchers also used analog-to-digital (AD) modules to design their own unique instruments to measure power consumption [37; 38]. Some chip vendors also developed software analyzers or profilers. Qualcomm released the first edition of Snapdragon Profiler [39] in 2016. It allows developers to analyze CPU, GPU, DSP, memory, power, thermal, and network data to find and fix performance bottlenecks. Still, it only works with Android devices powered by Qualcomm Snapdragon processors. EnergyTrace [40], developed by Texas Instruments, is a power analyzer tool that measures and displays the energy profile of an application and helps optimize it for an ultra-low-power consumption.