

The ATTiny85 is a small, low-power microcontroller from Atmel's AVR family, designed for embedded systems and DIY electronics projects. It features an 8-bit architecture, 8 KB of flash memory, 512 bytes of SRAM, and 6 I/O pins, making it a versatile choice for compact and low-power applications. Its small size and ease of programming make it a popular choice among hobbyists and professionals alike.








The ATTiny85 is a highly capable microcontroller with the following key specifications:
| Parameter | Value |
|---|---|
| Architecture | 8-bit AVR |
| Flash Memory | 8 KB |
| SRAM | 512 bytes |
| EEPROM | 512 bytes |
| Operating Voltage | 2.7V - 5.5V |
| Clock Speed | Up to 20 MHz (with external clock) |
| I/O Pins | 6 |
| ADC Channels | 4 (10-bit resolution) |
| PWM Channels | 2 |
| Timers | 2 (8-bit) |
| Communication Interfaces | SPI, I²C (TWI), and UART (via USI) |
| Power Consumption | Low-power modes available |
| Package | 8-pin PDIP, SOIC, or QFN |
The ATTiny85 comes in an 8-pin package. Below is the pinout and description:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | PB5 (RESET) | Reset pin (active low) or GPIO |
| 2 | PB3 (ADC3) | GPIO, ADC input channel 3, or SPI MOSI |
| 3 | PB4 (ADC2) | GPIO, ADC input channel 2, or SPI MISO |
| 4 | GND | Ground |
| 5 | PB0 (ADC0) | GPIO, ADC input channel 0, PWM output, or SPI SCK |
| 6 | PB1 (ADC1) | GPIO, ADC input channel 1, PWM output |
| 7 | PB2 (ADC4) | GPIO, ADC input channel 4, or I²C SDA |
| 8 | VCC | Power supply (2.7V - 5.5V) |
The ATTiny85 is a versatile microcontroller that can be programmed using the Arduino IDE or other AVR programming tools. Below are the steps to use the ATTiny85 in a circuit:
Setup the Arduino IDE:
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.jsonConnect the ATTiny85 to a Programmer:
| Arduino UNO Pin | ATTiny85 Pin |
|---|---|
| 10 (RESET) | Pin 1 (RESET) |
| 11 (MOSI) | Pin 2 (PB3) |
| 12 (MISO) | Pin 3 (PB4) |
| 13 (SCK) | Pin 5 (PB0) |
| GND | Pin 4 (GND) |
| 5V | Pin 8 (VCC) |
Select the Board and Programmer:
Upload Code:
The following example demonstrates how to blink an LED connected to Pin 0 (PB0) of the ATTiny85:
// Blink an LED on ATTiny85 Pin 0 (PB0)
#define LED_PIN 0 // Define the LED pin (PB0)
void setup() {
pinMode(LED_PIN, OUTPUT); // Set the LED pin as an output
}
void loop() {
digitalWrite(LED_PIN, HIGH); // Turn the LED on
delay(500); // Wait for 500 milliseconds
digitalWrite(LED_PIN, LOW); // Turn the LED off
delay(500); // Wait for 500 milliseconds
}
Problem: The ATTiny85 is not detected by the programmer.
Solution:
Problem: The uploaded code does not run as expected.
Solution:
Problem: The LED does not blink in the example code.
Solution:
Can I use the ATTiny85 with I²C sensors?
Yes, the ATTiny85 supports I²C communication using the USI (Universal Serial Interface). Libraries like TinyWire can simplify I²C communication.
How do I reset the ATTiny85 to factory settings?
Use a high-voltage programmer to reset the fuse bits to their default values.
Can I use the ATTiny85 for battery-powered projects?
Yes, the ATTiny85 is ideal for low-power applications. Use sleep modes to conserve power when the microcontroller is idle.