Reducing your ATtiny85 power consumption

      No Comments on Reducing your ATtiny85 power consumption

In this post, we will look at different techniques to reduce your AVR micro-controller power consumption. This is especially useful if you are running your device from batteries since it will allow them to last longer. More specifically, we will look at the impact of changing the micro-controller speed (frequency) and also at the impact of using sleep modes so you can take this into account while designing a new project.

All the measurements are performed on an ATtiny85 but the results should be similar on the other models.
I will assess that assumption when I have some spare time.

I programmed the chip with the following program:

int main(void)
{
   while(true);
}

Impact of micro-controller speed (5V)

By default, the micro-controller is configured to run at 1 MHz.
It’s internal clock is running at 8 MHz, but it’s fuses (CKDIV8) are configured so the micro-controller runs at 1/8th of his internal clock speed.

Consumption while running at 1MHz.
attiny85-1MHz-PowerConsumption

Consumption while running at 8MHz.
attiny85-8MHz-PowerConsumption

Consumption while running at 16MHz (I don’t have 20MHz crystals).
attiny85-16MHz-PowerConsumption

So, we can see that the micro-controller speed really have an impact on power consumption:
1MHz = 3.46mA
8MHz = 7.77mA
16MHz = 11.2mA

Impact of reducing voltage to 3.3V

By running the chip at 3.3V instead of 5V, the power consumption drops significantly while running the same tests:
1MHz = 0.89mA
8MHz = 3.64mA
16MHz = 6.4mA

Interesting! 🙂

Impact of using sleep modes (back to 5V and still running at 16MHz)

Idle sleep mode

int main(void)
{
   set_sleep_mode(SLEEP_MODE_IDLE);
   while(true) {
	   sleep_mode();
   }
}

attiny85-16MHz-IDLE_alonePowerConsumption
It gets us from 11.2mA to 6.17, so around 50% less power consumption.

Power down sleep mode

int main(void)
{
   set_sleep_mode(SLEEP_MODE_PWR_DOWN);
   while(true) {
	   sleep_mode();
   }
}

attiny85-16MHz-PWR_DOWN_alonePowerConsumption
Much better, it goes dowm to 0.88uA.
Of course, in a real project, we would enable at least an interrupt and maybe the watch dog so the micro-controller wakes-up on some conditions. So, the consumption would be a bit higher than that.

I did the same test, but with the chip running at 1MHz and 3.3V and the consumption went down to 0.14uA! Now we are talking!

Power down sleep mode + turn off ADC reference voltage

I gave it a try and got the same results as for the previous test with PWR_DOWN sleep mode.
Some sites are saying that there may be some power consumption if the ADC uses the internal reference voltage.
The internal reference voltage is what the micro-controller uses by default and I haven’t changed the in the ADMUX register.
Maybe this doesn’t apply to the Attiny85?

Fuses setting I used

attiny85-16MHz-PWR_DOWN_fuses

Conclusion

If your project is powered with batteries, then it makes sense to run the micro-controller at the lowest frequency possible to decrease power consumption. Also, making sure you put the chip to sleep (in power down mode) as much as possible will also help increasing your batteries life. Finally, it really sounds like a good idea to use 3.3V for our projects, when that’s possible.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Spam Plugin