Measuring supply current is crucial in the development of embedded systems, as
it enables the analysis of a device’s energy profile across its various operating
states. Microcontrollers usually spend the majority of their time in low-power
(sleep) states, where consumption is typically measured in microamperes (µA).
However, upon waking up and executing tasks, the current suddenly spikes to tens
or hundreds of milliamperes (mA). Capturing such highly dynamic power con-
sumption is impossible with a conventional ammeter, and professional equipment
for these measurements is typically cost-prohibitive.
The objective was to design a dedicated measuring device that allows for
the analysis of microcontroller current profiles without relying on expensive pro-
fessional equipment. To this end, a custom printed circuit board (PCB) and
accompanying software were developed. The system is based on multiple shunt
resistors and automatic range-switching logic on the microcontroller, utilizing a
hardware analog watchdog for the rapid detection of current spikes.
The operation of the developed device was tested on a battery-powered tem-
perature and humidity meter, as well as on an ESP32-C3 microcontroller devel-
opment board running a simple test program. With the help of the developed
meter, the sleep-mode current of the ESP32-C3 board was gradually reduced
from an initial 350 µA to just 7 µA. This reduction in consumption was achieved
first by removing the power indicator light-emitting diode (LED), and later by
removing the linear voltage regulator.
|