See how you can get a 7x battery life improvement on Arduino based projects. Also, learn about power consumption, regulator efficiency and battery life estimation.
In this experiment I investigate the power consumption of the Atmel ATmega328P-PU microcontroller which is the uC used in the Arduino Uno R3 boards (and others).
If you’re looking for the power consumption of the Arduino board instead, please refer to this article.
I focus on understanding the power consumption at different operating voltages (3.3v vs 5v) and oscillator frequencies (8MHz and 16MHz). The main reason for this study is to help a project designer select the right system parameters to achieve desired battery life.
I installed an ATMEGA328P-PU chip in a breadboard and installed the Arduino Uno Bootloader. Instructions on how to load the bootloader into the chip is found here
- Test setup used to measure voltage and current in this experiment
- Burn the Bootloader
- Upload using an Arduino Board – code used is Examples –> Blink. With no LED connected.
I uploaded the Blink LED example code and that is the code that I use in all experiments. Note that when taking the current and voltage measurements I disconnected the LED. So all my numbers are for the microcontroller alone running that simple code.
After collecting power consumption data at 16Mhz, I burned the 8MHz bootloader per this tutorial.
-caveat: I removed the 16Mhz oscillator to upload the 8Mhz bootloader but kept getting error. I tried several things but no luck. Finally I got it working when I put the 16Mhz oscillator back to the breadboard. Only THEN I was able to burn the 8Mhz Bootloader. Only after thatI then removed the external 16Mhz oscillator.
-caveat 2: I was not able to reflash to the microcontroller with the new Blink software. I kept getting errors compiling then uploading code. I followed some good tips listed here , but I gave up because realize I could still have good power consumptions measurements even with a led blinking in the wrong rate.
Arduino’s ATMega328 Power Consumption measurement
The table below shows all the numbers I captured in the test. Power calculated from measured voltage and current. Power = Voltage x Current
|Test 1 – using a regulated power supply|
|Oscillator||16Mhz (external)||8Mhz (internal)|
(Voltage reading varies a little likely because I changed volt meter in the 8Mhz setup)
Here’s the graph for the above data:
You can see in the graph above the default Arduino Uno configuration of 5v and 16Mhz consumes 81mW for the blink LED code (LED disconnected), and if we drop that voltage and frequency to 3.3v / 8Mhz there is a 6 fold power consumption reduction!
Estimating battery life
As stated in the intro, the main reason for these experiments is better estimate battery life, so now let’s add the battery to the tests. I use one AAA battery and since its nominal voltage is 1.5v we need a step-up regulator or Boost regulator to get 3.3v and 5v.
Regulator efficiency tells you how much power is wasted even before it get’s to the microcontroller.
|Test 2 – AAA cell and Boost Regulator (at 16Mhz)|
|3.3v Regulator||5v Regulator|
|Regulators:||NCP1402-5V Step-Up Breakout, PRT-10968|
|NCP1402-3.3V Step-Up Breakout, PRT-10967|
From above, when using the 3.3V regulator there is 18mA being drawn from the AAA battery. This is a power consumption of 27.5mW out of the battery (Power = Voltage x Current = 1.53 x 18mA = 27.5mW ). Now measuring the microcontroller current draw we see only 6.39mA at 3.37V. A power consumption of 20.9mW. With those two power figures we can calculate the regulator efficiency:
Efficiency = Power_out / Power_in = 20.9mW / 27.5mW = 75.9%
Similarly the 5v regulator has a 72.7% efficiency.
For a AAA battery with initial charge capacity is 1000mAh (typical value per Wikipedia) we can estimate run-time.
Runtime = Charge_AAA (mAh) * Regulator_Efficiency (%) / load_power_draw (mA)
For 3.3v/8Mhz: Runtime() = 1000mAh * 75.9% / 12.3mA = 61.5h
|Current (mA)||Runtine (h)||Losses (h)|
Taking the above numbers in a table:
If I have AAA battery and 5V step-up regulator running at 16Mhz I could run my setup for 8.9h. However if I drop the voltage to 3.3V and frequency to 8Mhz, battery would last 61.8h. That is a 700% improvement!
Important Note: my instruments were not calibrated for this experiment nor I used strict testing procedures. This means my numbers may be off by a lot. Use them for reference only. The key in this experiment is to (1) show the thought process in determining battery life (2) obtain a ball-park estimate of battery life.
Arduino Uno Power Consumption: Power consumption of the Arduino Uno board, in normal and sleep modes.