power consumption/sleep questions

with the following code and nothing connected the Diecimila uses 9 milliamps. the board uses about 32ma before it goes to sleep. i was expecting it to be a lot less than this. has anybody been able to do better than this?

Jeff O'Brien

#include <avr/sleep.h>

void setup()
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);   // sleep mode is set here

void loop() {


Don't recall what regulator the Decimilla uses, but the NG uses a 78m05, with a quiescent current of 4.5 to 9 mA.

Assuming you are measuring unregulated voltage input at the coax power jack, my guess is you are seeing in part the power dissipated by the regulator and reverse-protection diode.


i am using a 9 volt battery into the VIN pin and my meter is connected in series with one of the lines from the 9v battery. is this not the correct way of measuring current draw?


Yes, that's the correct way of measuring it, especially if a) you are interested in the real-world current consumption, and b) that's the way you plan to operate it.

You could, for example, be using a regulated 5V source and measuring the current into the 5V pin, in which case my comments about the regulator would not apply.

Does using the "9v" pin bypasses the diode? I can't remember...

Is there a power LED? If so, that is drawing some power as well. (can't recall, I've been using my single sided serial arduinos lately.)

If you are extremely concerned about power consumption, you can do things like use an external switching regulator that is more efficient than the linear 78m05 on board, and remove power indicator LEDs, etc.


On the Diecimila, the FTDI chip is powered even if you're running on external power (to prevent it from generating noise on the serial lines), so that might increase the power consumption.

I've been reading section. 9.8 "Minimizing Power Consumption" (pg42) of the atmega168 doc. some of the recommendations are to disable analog to digital converter, disable the watch dog timer, and configure all port pins to use minimum power. i would like to try all this but i don't have a clue as to do this. i'm really new to this stuff and the bit manipulation stuff is a little foreign to me. does any body know of any code examples for this stuff.

here is my side question. i'm trying to make a pulse counter that will be able to run on a battery. lets say the log interval will be two minutes. it will be asleep but counting pulses, then wake up every two minutes and dump its pulse count to some kind of memory device. i actually have this whole thing working quite nicely while being plugged into the wall, but the power consumption is way too high for a battery. my current config uses an external interrupt to count pulses from the reed switch. my fear is that this interrupt will cause the chip to wake up from sleep mode. also i have studied the sleep example from the playground and i don't fully understand the wake up part. i believe they are using the external interrupt to cause the wake up from sleep but could it be done with a timer? if it does wake up from the external interrupt then my guess is that i won't be able to use an interrupt to count reed switch pulses. so how else would you quietly count pulses? and how would you set it up to wake from a timer?

i know there are a lot of random thoughts/questions in the above paragraph. let me know if you need me to clarify anything