Low power (5microA) ATtiny13A

I have read several posts to reduce the power consumption of micro-controllers and learned that the althought you can minimize the power consuption of arduino, usually you have other sensors/chips that cosume more power then customized low power arduino.
The idea now is to use ATtyni13A – Atmel picoPower 8-bit AVR RISC-based microcontroller as a timer switch for the all other circuits especially for projects, when you want your circuit run once an hour or less for only some seconds (data loggers,..). In this case the ATtyni13A is up and running 24/7 and everything else is without the power, so the consumption of the rest of the circuit is 0A. ATtyni13A consumption is only 0.005mA (5µA) in a sleep mode.


As you can see, ATtyni13A is used only as a controller of 1 N-channel MOSFET, that is turning on/off 5V booster for the Arduino UNO plugged with standard USB cable. For the tests used in this post I have used LED to measure power consumption instead of MOSFET. I have used these low power concept in my projects:

Check my other post that describes how to program ATtyni13A via Arduino board.

So what is the ATtyni13A power cunsuption?

The consumption of ATtyni13A in up time mode without any circuit is really low, less then 1mA. In my case my multi-meter showed 0.843mA powerd by 3.3V.

Low power ATtyni13A in sleep mode and interrupt

Less then 1mA is good but with just simple program changes (sleep and interrupt) we can get with power consumption during the sleep time even lower.

This code will wake up ATtiny13A every 8s and turn the LED on for 1 sec.

#include <avr/interrupt.h>
#include <avr/sleep.h>
// Pin 4 for LED
int led = 4;
ISR(WDT_vect) {
	digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
	delay(1000);               // wait for a second
	digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW

void setup() {
	// initialize the digital pin as an output.
	pinMode(led, OUTPUT);
	// prescale timer to 8s so we can measure current
	WDTCR |= (1<<WDP3 )|(0<<WDP2 )|(0<<WDP1)|(1<<WDP0); // 8s
	// Enable watchdog timer interrupts
	WDTCR |= (1<<WDTIE);
	sei(); // Enable global interrupts
	// Use the Power Down sleep mode
	for (;;) {
		sleep_mode();   // go to sleep and wait for interrupt...
// the loop routine runs over and over again forever:
void loop() {


The current during the sleep mode is 0.250mA.


Disabling ADC controller of ATtyni13A

By disabling the ADC converter in ATtyni13A we can go even lower! Add the following line to turn the ADC off on ATtyni13A:

ADCSRA &= ~(1<<ADEN)

To enable it, if you use ADC during the ATtyni13A uptime just put this line:

// initiate conversion
ADCSRA |= (1 << ADSC);
// wait for completion
while (ADCSRA & (1 << ADSC));

By turning off the ADC converter we can go down to 0.005mA with 3.3V!  This is lower then was my expectations at the begging.


Other Hints

The line:

WDTCR |= (1<<WDP3 )|(0<<WDP2 )|(0<<WDP1)|(1<<WDP0); // 8s

is setting the timers configuration and 8s is the max Other values are listed:

16MS   (0<<WDP3 )|(0<<WDP2 )|(0<<WDP1)|(0<<WDP0)
32MS   (0<<WDP3 )|(0<<WDP2 )|(0<<WDP1)|(1<<WDP0)
64MS   (0<<WDP3 )|(0<<WDP2 )|(1<<WDP1)|(0<<WDP0)
125MS  (0<<WDP3 )|(0<<WDP2 )|(1<<WDP1)|(1<<WDP0)
250MS  (0<<WDP3 )|(1<<WDP2 )|(0<<WDP1)|(0<<WDP0)
500MS  (0<<WDP3 )|(1<<WDP2 )|(0<<WDP1)|(1<<WDP0)
1S     (0<<WDP3 )|(1<<WDP2 )|(1<<WDP1)|(0<<WDP0)
2S     (0<<WDP3 )|(1<<WDP2 )|(1<<WDP1)|(1<<WDP0)
4S     (1<<WDP3 )|(0<<WDP2 )|(0<<WDP1)|(0<<WDP0)
8S     (1<<WDP3 )|(0<<WDP2 )|(0<<WDP1)|(1<<WDP0)

If we need timer for more then 8 seconds we will just introduce the counter of 8s. E.g. timer for 2min would be:

int count = 0;
int led = 4;
ISR(WDT_vect) {
	count = count +1;
	if (count > 15) // if interrupted 15. times ( after 15*8sec = 120s = 2min )
		digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
		delay(1000);               // wait for a second
		digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
		count = 0;

This method is very useful if the up time of the circuit behind the ATtyni13A is lower then 8s. I have used Arduino UNO dataloger sample that needs ~4 sec to measure and then it is completely turned off by N-channel MOSFET controlled by ATtyni13A. I have used 1 battery and 5V power booster that supply the Arduino UNO via USB cable.

Other related posts

Read the low power circuit post if you are interested in simple disconnecter circuit controlled by arduino.

other tips you can google:

ADCSRA &= ~(1<<ADEN); //Disable ADC
ACSR = (1<<ACD); //Disable the analog comparator
DIDR0 = 0x3F; //Disable digital input buffers on all ADC0-ADC5 pins.

Battery Life Calculator
High pulse drain impact on CR2032 coin cell battery capacity
Coin cells and peak current draw. Protection by capacitor

Related Posts

Program ATtiny13A via Arduino board

Programming ATtiny micro-controller is quite easy if you have all the needed information in one place. That is the reason to put all needed files, hints in one post so next time I will need it,[…]

Continue reading ...

Battery Powered Wifi IoT – Temperature, Humidity & Soil Moisture Sensors

I have just made a prototype of ESP8266 (ESP-01) IoT temperature & humidity SI7021 sensor and also 2x three pin soil moisture sensors with only 0.006mA (6µA) current drain during the sleep.

Continue reading ...

ESP8266 – WiFiManager and EEPROM

ESP8266 WiFiManager EEPROM My next addition to previous projects battery-wifi-iot-temp-hum-soil-moisture-sensors and battery-powered-esp8266-iot-logger is to make wifi configuration smooth and fast.

Continue reading ...