So I'm trying to power down my ATtiny85 to save power, but for some reason the ATtiny doesn't power down when I'm using the default IDLE mode, but when I start using the SLEEP_MODE_PWR_DOWN the ATtiny appears to go to sleep.

I'm testing it by calling a checkPower() method that blinks an LED after the sleepNow() method. In other words, if the ATtiny goes to sleep then the checkPower() method should not be reached and the LED should not blink. Here is the code:

void loop() 

void sleepNow()
    // Choose our preferred sleep mode:
    // Set sleep enable (SE) bit:
    // Put the device to sleep:
    // Upon waking up, sketch continues from this point.

void checkArrays()
  for(i = 0; i < 15; i++)
     digitalWrite(1, HIGH);
     digitalWrite(1, LOW);

Any idea why my LED would continue to blink when using the IDLE mode but no the PWR_DOWN mode?

1 Answer 1


In IDLE mode the timers still run. Arduino uses timer0 for millis. So when timer0 overflows the ATTiny will wake up and call the ISR.

So the ATTiny will go to 'sleep' but wake up a number of microseconds later.

  • So what can I use besides IDLE? If I try PWR_DOWN I won't be able to use an interrupt to wake the microprocessor. Is there an alternatice. Also how long does IDLE make the ATtiny sleep? Jun 21, 2016 at 17:44
  • 1
    You can wake from power down using either a pin change interrupt or a watchdog timer interrupt.
    – bigjosh
    Jun 21, 2016 at 18:30
  • @IsabelAlphonse: IDLE is fine. You just have to check, whenever you wake up, if there is job to do. If not, just go back to sleep. Jun 21, 2016 at 19:29
  • As bigjosh said, pin change and watchdog timer interrupts will wake the processor from power-down. See my page about power - not specifically about the Attiny85, but the same processor family.
    – Nick Gammon
    Jun 21, 2016 at 21:15

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.