2

According to the Atmega328P-PU Datasheet (side: 589) the current consumption of the microcontroller should be around 9.5mA (at 16MHz and 5V).
But I measured 15mA. (Nick Gammon who did some pretty good power saving research(gammon.com.au/power) got the same)
There is nothing connected to the outputs. The code I ran was this:

void setup () {}
void loop () {}

Now I'm wondering if this is just a normal deviation (datasheet to real world) or if Atmel measured their current consumption in a state that is different from mine?

EDIT:

I forgot to mention.. I didn't use it with the Arduino Uno board but as standalone device. There was only a 16Mhz oscillator with two capacitors connected. Power came directly form Power supply.

Now that I think about it.. Datasheet says this regarding the current measurement: "A sine wave generator with rail-to-rail output is used as clock source."

Is it possible that the oscillator needs that extra 5mA?

EDIT2:

Here is a screenshot of my schematic: enter image description here

And a screenshot of the ATmega328P-PU Datasheet: enter image description here

4
  • 1
    Perhaps if you show your schematic. I have got consistent results from my tests.
    – Nick Gammon
    Commented Sep 30, 2015 at 11:21
  • Thank you! I added a schematic and screenshot of the datasheet. By consistent you mean that the results of your measurements were as one yould expect after reading the datasheet?
    – elperro
    Commented Sep 30, 2015 at 12:39
  • What kind of meter are you using. Also, try adding a bypass cap to the VCC line (unlikely to help, but still good practice). Do you have any other ATMega328 chips around, or just this one? Did you set the correct fuses?
    – Gerben
    Commented Sep 30, 2015 at 15:07
  • Set all your IO pins to outputs and set them LOW. Then disable all timers and interrupts. What results do you get then?
    – Majenko
    Commented Sep 30, 2015 at 16:18

2 Answers 2

1

According to the datasheet:

All current consumption measurements are performed with all I/O pins configured as inputs and with internal pull-ups enabled.


That was the critical point. Trying this sketch:

int main ()
  {
  for (int i = 0; i < 20; i++)
    pinMode (i, INPUT_PULLUP);
  }  // end of setup

Note that timers are not running (your sketch would have timer 0 running):

With that sketch, even using the crystal and capacitors (I actually had a resonator) the consumption at 5 V at around 20 °C was 9.2 mA which is within spec.

Fuses:

Signature = 0x1E 0x95 0x0F 
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xFF 
HFuse = 0xDF 
EFuse = 0xFF 
Lock byte = 0xFF 
Clock calibration = 0x96 

If we turn pull-ups off:

int main ()
  {
  }  // end of setup

Now it consumes 14.4 mA, closer to what you measured.


And with your actual test sketch:

void setup () {}
void loop () {}

It consumes 15.5 mA, which is more, because Timer 0 is running (started in the init function). It is also close to what I had on my page about power - 15.15 mA.


So, working as expected. Those pull-ups are important, to stop the input drivers consuming current.

I did mention further down in my page the importance of configuring the pins:

Testing in SLEEP_MODE_PWR_DOWN:

  • All pins as outputs, and LOW: 0.35 µA (same as before).

  • All pins as outputs, and HIGH: 1.86 µA.

  • All pins as inputs, and LOW (in other words, internal pull-ups disabled): 0.35 µA (same as before).

  • All pins as inputs, and HIGH (in other words, internal pull-ups enabled): 1.25 µA.

Notice the difference there of 0.9 µA when asleep. It would appear that there is an ever greater difference if the processor is awake.

1
  • Thank you so far! I have to wait until my new chip arrives and I can test this.
    – elperro
    Commented Oct 4, 2015 at 16:01
0

Probably Atmel measured the chip consumption without any code. An empty sketch has some code in it (believe it or not). Another possibility is the remaining components like voltage regulator, usb chip are also consuming some current. Try to test in a bare minimum configuration.

3
  • 1
    Thank you for your reply! I forgot to mention.. I didn't use it with the arduino uno board but as standalone device. There was only a 16Mhz oscillator with two capacitors connected. Power came directly form Power supply.
    – elperro
    Commented Sep 30, 2015 at 9:02
  • Now that I think about it.. Datasheet says this regarding the current measurement: "A sine wave generator with rail-to-rail output is used as clock source." Is it possible that the oscillator needs that extra 5mA?
    – elperro
    Commented Sep 30, 2015 at 9:08
  • @elperro, now that you've added the info from those two comments to question, feel free to delete the comments. Commented Sep 30, 2015 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.