Arduino’s ATMega328 Power Consumption

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.

Intro

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.

Setup

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 for Arduino's ATMega328 Power Consumption measurement
Test setup used to measure voltage and current in this experiment
  1. Burn the Bootloader
  2. 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 3.3 3.43
Current (mA) 6.6 3.6
Power (mW) 21.8 12.3
Voltage 4.98 5.2
Current (mA) 16.43 12.2
Power (mW) 81.8 63.4

 

(Voltage reading varies a little likely because I changed volt meter in the 8Mhz setup)

Here’s the graph for the above data:

atmega328p-pu power_consumption

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.

The regulators I used are from Spark Fun electronics (3.3v and 5v) and are based on the ON Semiconductor’s NCP1402. Here’s the schematic of the voltage regulator (schematic from here)

3_3v regulator

 Regulator Efficiency

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
Input Output Input Output
Voltage 1.53 3.27 1.53 5.02
Current (mA) 18.00 6.39 70.00 15.50
Power (mW) 27.5 20.9 107.1 77.8
Regulator efficiency 75.9% 72.7%
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.

Calculation Example:

Runtime = Charge_AAA (mAh) * Regulator_Efficiency (%)  / load_power_draw (mA)

For 3.3v/8Mhz:  Runtime() = 1000mAh * 75.9% / 12.3mA = 61.5h

Estimated Runtime
Current (mA) Runtine (h) Losses (h)
3.3V, 8Mhz 12.3 61.5 19.5
3.3V, 16Mhz 21.8 34.8 11.1
5V, 8Mhz 63.4 11.4 4.3
5V, 16Mhz 81.8 8.9 3.4

Taking the above numbers in a table:

 

atmega328p-pu_aaa_batt_life

Conclusion

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.

Additional studies:

Arduino Uno Power Consumption: Power consumption of the Arduino Uno board, in normal and sleep modes.