Bare ATmega328P in sleep mode still consumes 20mA?!

Hello,

This is confusing the heck out of me. I followed the instructions in http://arduino.cc/en/Tutorial/ArduinoToBreadboard and got a bare ATmega328P chip working on a breadboard. I'm using the 8MHz internal oscillator minimal bootloader from that page. I successfully uploaded a sketch to the chip that makes it sleep until woken by an external interrupt. It works great, except that I'm trying to reduce power usage to the microamp level, and for some reason even in SLEEP_MODE_PWR_DOWN the chip consumes 20mA! When woken up, it consumes 30mA. I'm powering it directly from an FTDI cable, so there's no regulator or anything to drain power while the chip is asleep. I have my multimeter in series between VCC on the FTDI cable pin 8 (VCC) on the chip. Any idea what could be going on?

Many thanks!

Solved this myself. Apparently just having the FTDI cable connected adds 20mA to the total current usage. When I power from a battery, sleep mode uses 870uA. Much better, although this chip is supposedly capable of 1uA. Here's my sleep code if anyone has any suggestions:

void loop ()
{
  //select which sleep mode
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);
  
  //allow sleep to happen when called
  sleep_enable();
  
  ADCSRA &= ~(1<<ADEN); //Disable ADC, saves ~230uA
  
  //go to sleep
  sleep_mode();
  
  ADCSRA |= (1<<ADEN); //Enable ADC
  
  //woken up, so disable sleep possibility
  sleep_disable();
}

Apparently just having the FTDI cable connected adds 20mA to the total current usage

Yes, you are probably powering the FT232 chip inside the cable, maybe even through your Tx signal.


Rob

Compare to this code, which results in well below 1µA.

Check also NIck Gammons 'lecture' about saving energy - http://www.gammon.com.au/forum/?id=11497 -

Thanks guys! Jack, your code worked perfectly. I also realized that my Adafruit HT16K33 LED backpack consumes a little power even when no LEDs are on, so figuring that out plus using your code got me down to between 0-10uA (my multimeter only has 10uA precision). That's exactly what I was looking for, so thank you.

If anyone else is searching for how to make the HT16K33 sleep (aka standby mode), you have to use this code:

      Wire.beginTransmission(0x70); // access the device using its i2c address of 0x70
      Wire.write(0x20);  // set it to standby mode by accessing the 0x20 register
      Wire.endTransmission(); // end transmission

To wake it up again, use the same code except substitute 0x21 instead of 0x20.

you should check the return value of endTransmission() to see if it succeeded!

osmithy:
so figuring that out plus using your code got me down to between 0-10uA (my multimeter only has 10uA precision). That's exactly what I was looking for, so thank you.

You need to get yourself an EEVBlog micro-current meter!

Adafruit used to sell these. I think Dave is between runs, they seem to be out.

osmithy:
figuring that out plus using your code got me down to between 0-10uA (my multimeter only has 10uA precision).

Doesn't matter. If it went down to about 10uA then you're doing it right.

Almost anything else will jump up to hundreds of microamps. I don't think there's much grey area between right/wrong.

fungus:

osmithy:
figuring that out plus using your code got me down to between 0-10uA (my multimeter only has 10uA precision).

Doesn't matter. If it went down to about 10uA then you're doing it right.

Almost anything else will jump up to hundreds of microamps. I don't think there's much grey area between right/wrong.

WRONG! It's an excuse to buy another, better, piece of equipment! XD

Hahahaha true on both counts!! The current got low enough for my purposes, but I totally put my name and email down to be notified when Adafruit gets them back in stock. That thing looks SWEET.

Another way is to use a resistor with a switch across it. Power the Arduino through that with the switch closed, upload the program as normal.

When it goes into sleep mode you open the switch and measure the voltage drop across the resistor. With a 100k resistor each volt is 10uA.