Hacettepe University Logo

Empirical Power Analysis of Embedded Devices

FOSSketeers Logo

Evaluating Algorithmic Efficiency through Real-World Energy Consumption on Microcontrollers

Buğra Kağan Acar, Furkan Şimşekli, İlker Avcı
Hacettepe University, Dept. of Computer Engineering
Supervised by Assoc. Prof. Harun Artuner

Project Overview

With embedded and IoT systems shaping modern computing, energy efficiency has become a crucial metric in algorithm and system design. This project investigates how theoretical time complexity correlates with actual power consumption on real devices. By using both 8-bit and 32-bit microcontroller platforms, we aimed to quantify the energy profiles of various algorithms including sorting, cryptographic routines, and even AI-generated code.

Our project culminated in an academic paper, submitted to the IEEE Signal Processing and Communication Applications Conference (SİU 2025). We are pleased to share that the paper was accepted and will be published on IEEE Xplore.

Experiment Setup

Our experimental setup involved two target platforms: Arduino Uno R3 (AVR, 8-bit) and Uno R4 Minima (ARM Cortex-M, 32-bit). The Nordic Power Profiler Kit II (PPK2) was used in sourcemeter mode to provide stable power and high-precision current measurements. The entire pipeline—from benchmarking orchestration to result collection—was automated through a custom software stack built with PlatformIO.

Benchmarks included a diverse set of algorithms executed under identical input constraints, with precise control over data size and structure. Results were processed using custom Python scripts and visualized to highlight correlations and anomalies.

Block Diagram of Setup
Figure 1 - Block diagram showing the general structure of the experimental setup.
Physical Wiring Setup
Figure 2 - Diagram showing the actual wiring and physical layout of the devices.

Each test run followed a structured sequence: code upload, isolation, measurement initiation, and analysis. The infrastructure ensured reproducibility and minimized noise from uncontrolled variables.

Key Findings

The study yielded several notable insights into how algorithmic characteristics impact power usage on different microcontroller architectures. These findings not only align with some prior literature but also challenge others—most notably the claim that time and power are not strongly correlated.

  • We found a strong correlation ([0.98, 1.00], p < 0.0001) between time complexity and power consumption across tested algorithms.
  • Quick Sort was the most efficient algorithm in both runtime and energy consumption on both platforms.
  • Radix Sort, despite its linear complexity, performed poorly on R3 due to software-emulated division instructions.
  • Among AEAD schemes, Ascon128 led on R3, while ChaCha20-Poly1305 outperformed others on R4.
  • Code generated by ChatGPT showed ~3% better energy efficiency than Gemini and Claude.
  • An LSTM model achieved ~65% accuracy classifying algorithms based on current draw profiles.
Block Diagram of Setup
Figure 3 - Time complexity and power consumption correlation diagrams
Block Diagram of Setup
Figure 4 - Results of the Crypto benchmark highlighting the differences between R3 and R4
Block Diagram of Setup
Figure 5 - Results of the LLM Sort benchmark on R4

Video

Project Resources

The entire project—including source code, experimental scripts, raw measurements, and visualization tools—is available as open source. We invite researchers, educators, and embedded systems developers to explore and extend it.