Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use ATTiny85: Examples, Pinouts, and Specs

Image of ATTiny85
Cirkit Designer LogoDesign with ATTiny85 in Cirkit Designer

Introduction

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. Its compact size and ease of programming make it a popular choice for applications where space and power efficiency are critical.

Explore Projects Built with ATTiny85

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ATtiny85 and OLED Display Based Interactive Game with Buzzer and LED
Image of FIRST CIRCUIT: A project utilizing ATTiny85 in a practical application
This circuit is a simple interactive game system powered by a 5V battery, featuring an ATtiny85 microcontroller, an OLED display, a buzzer, an LED, and multiple pushbuttons. The OLED displays a menu with options to start a game, which is controlled by the ATtiny85. The buzzer and LED provide audio-visual feedback, and the pushbuttons are used for user input to navigate the menu and play the game.
Cirkit Designer LogoOpen Project in Cirkit Designer
ATtiny-Controlled LED Blinker Circuit
Image of led: A project utilizing ATTiny85 in a practical application
This circuit consists of an ATtiny microcontroller that controls an LED through one of its GPIO pins (PB4). A resistor is connected in series with the LED to limit the current. The ATtiny is powered by a 3.3V battery, and the LED is designed to turn on when the ATtiny is powered up.
Cirkit Designer LogoOpen Project in Cirkit Designer
ATmega328P-Based Sensor Hub with OLED Display and LIDAR
Image of TILTPCB: A project utilizing ATTiny85 in a practical application
This circuit features an Mtiny Uno ATmega328P microcontroller as its central processing unit, interfacing with a variety of sensors and peripherals. It includes a 0.96" OLED display and an MPU6050 accelerometer/gyroscope for user interface and motion sensing, respectively. The circuit also integrates a TF LUNA LIDAR for distance measurement, a DHT11 sensor for temperature and humidity readings, and uses a 9V battery with a 7805 voltage regulator for power management. Communication with a computer for programming and data exchange is facilitated by an Adafruit FTDI Friend module.
Cirkit Designer LogoOpen Project in Cirkit Designer
ATMEGA328 Battery-Powered LED Blinker with FTDI Programming
Image of Homemade Arduino using ATmega328: A project utilizing ATTiny85 in a practical application
This circuit is a basic microcontroller setup using an ATMEGA328, powered by a 5V battery, and includes an FTDI programmer for serial communication. It features a pushbutton for reset functionality and two LEDs controlled by the microcontroller, with one LED blinking at a 1-second interval as programmed.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ATTiny85

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of FIRST CIRCUIT: A project utilizing ATTiny85 in a practical application
ATtiny85 and OLED Display Based Interactive Game with Buzzer and LED
This circuit is a simple interactive game system powered by a 5V battery, featuring an ATtiny85 microcontroller, an OLED display, a buzzer, an LED, and multiple pushbuttons. The OLED displays a menu with options to start a game, which is controlled by the ATtiny85. The buzzer and LED provide audio-visual feedback, and the pushbuttons are used for user input to navigate the menu and play the game.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of led: A project utilizing ATTiny85 in a practical application
ATtiny-Controlled LED Blinker Circuit
This circuit consists of an ATtiny microcontroller that controls an LED through one of its GPIO pins (PB4). A resistor is connected in series with the LED to limit the current. The ATtiny is powered by a 3.3V battery, and the LED is designed to turn on when the ATtiny is powered up.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TILTPCB: A project utilizing ATTiny85 in a practical application
ATmega328P-Based Sensor Hub with OLED Display and LIDAR
This circuit features an Mtiny Uno ATmega328P microcontroller as its central processing unit, interfacing with a variety of sensors and peripherals. It includes a 0.96" OLED display and an MPU6050 accelerometer/gyroscope for user interface and motion sensing, respectively. The circuit also integrates a TF LUNA LIDAR for distance measurement, a DHT11 sensor for temperature and humidity readings, and uses a 9V battery with a 7805 voltage regulator for power management. Communication with a computer for programming and data exchange is facilitated by an Adafruit FTDI Friend module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Homemade Arduino using ATmega328: A project utilizing ATTiny85 in a practical application
ATMEGA328 Battery-Powered LED Blinker with FTDI Programming
This circuit is a basic microcontroller setup using an ATMEGA328, powered by a 5V battery, and includes an FTDI programmer for serial communication. It features a pushbutton for reset functionality and two LEDs controlled by the microcontroller, with one LED blinking at a 1-second interval as programmed.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Wearable electronics
  • IoT (Internet of Things) devices
  • LED control and lighting systems
  • Sensor-based projects
  • Small robotics and automation systems
  • Prototyping and hobbyist projects

Technical Specifications

The ATTiny85 is a versatile 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
Communication Interfaces SPI, I²C (TWI), and UART (via USI)
Power Consumption Low-power modes available
Package Types DIP-8, SOIC-8, QFN-8

Pin Configuration and Descriptions

The ATTiny85 has 8 pins, with the following configuration:

Pin Number Pin Name Description
1 PB5 (RESET) Reset pin (active low) or GPIO
2 PB3 (ADC3) GPIO, ADC input channel 3, or external interrupt
3 PB4 (ADC2) GPIO, ADC input channel 2, or external interrupt
4 GND Ground
5 PB0 (ADC0) GPIO, ADC input channel 0, or PWM output
6 PB1 (ADC1) GPIO, ADC input channel 1, or PWM output
7 PB2 (SCK) GPIO, SPI clock, or external interrupt
8 VCC Power supply (2.7V - 5.5V)

Usage Instructions

How to Use the ATTiny85 in a Circuit

  1. Power Supply: Connect the VCC pin to a power source (2.7V to 5.5V) and the GND pin to ground.
  2. Programming: Use an ISP (In-System Programmer) such as an Arduino UNO or a dedicated USB programmer to upload code to the ATTiny85.
  3. I/O Connections: Connect sensors, actuators, or other peripherals to the GPIO pins (PB0 to PB5) as needed.
  4. Clock Source: The ATTiny85 can use its internal 8 MHz oscillator or an external clock source for higher precision.

Important Considerations and Best Practices

  • Pull-up Resistor on RESET Pin: If the RESET pin is used as a GPIO, disable the reset functionality in the fuse settings. Otherwise, use a pull-up resistor (10 kΩ) to prevent accidental resets.
  • Decoupling Capacitor: Place a 0.1 µF ceramic capacitor between VCC and GND to stabilize the power supply.
  • Programming Voltage: Ensure the programmer's voltage matches the operating voltage of the ATTiny85.
  • Pin Limitations: Avoid exceeding the maximum current rating of 40 mA per pin or 200 mA for the entire chip.

Example: Programming the ATTiny85 with Arduino UNO

The following example demonstrates how to blink an LED connected to PB0 using the Arduino IDE:

Circuit Setup

  1. Connect the Arduino UNO to the ATTiny85 as follows:
    • Arduino UNO Pin 10 → ATTiny85 Pin 1 (RESET)
    • Arduino UNO Pin 11 → ATTiny85 Pin 5 (MOSI)
    • Arduino UNO Pin 12 → ATTiny85 Pin 6 (MISO)
    • Arduino UNO Pin 13 → ATTiny85 Pin 7 (SCK)
    • Arduino UNO GND → ATTiny85 Pin 4 (GND)
    • Arduino UNO 5V → ATTiny85 Pin 8 (VCC)
  2. Connect an LED with a 220 Ω resistor to PB0 (Pin 5) of the ATTiny85.

Code Example

// Blink an LED connected to PB0 (Pin 5) of the ATTiny85

void setup() {
  pinMode(0, OUTPUT); // Set PB0 (digital pin 0) as an output
}

void loop() {
  digitalWrite(0, HIGH); // Turn the LED on
  delay(1000);           // Wait for 1 second
  digitalWrite(0, LOW);  // Turn the LED off
  delay(1000);           // Wait for 1 second
}

Uploading the Code

  1. Open the Arduino IDE and install the "ATTinyCore" library via the Boards Manager.
  2. Select "ATTiny85" as the board and configure the clock settings (e.g., 8 MHz internal).
  3. Upload the code using the "Arduino as ISP" programmer.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Problem: The ATTiny85 is not detected by the programmer.

    • Solution: Check the wiring between the programmer and the ATTiny85. Ensure the RESET pin is connected correctly.
  2. Problem: The LED does not blink.

    • Solution: Verify the LED and resistor connections. Ensure the correct pin is used in the code.
  3. Problem: The ATTiny85 is not running at the expected clock speed.

    • Solution: Check the fuse settings and ensure the correct clock source is selected.
  4. Problem: Excessive power consumption in low-power applications.

    • Solution: Use the ATTiny85's sleep modes and disable unused peripherals in the code.

FAQs

  • Q: Can the ATTiny85 be reprogrammed multiple times?
    A: Yes, the ATTiny85 supports up to 10,000 write/erase cycles for its flash memory.

  • Q: Can I use the ATTiny85 without an external clock?
    A: Yes, the ATTiny85 has an internal 8 MHz oscillator, which is sufficient for most applications.

  • Q: How do I use the EEPROM on the ATTiny85?
    A: The EEPROM can be accessed using the EEPROM library in the Arduino IDE for storing non-volatile data.

  • Q: What is the maximum current the ATTiny85 can source or sink?
    A: Each pin can handle up to 40 mA, with a total maximum of 200 mA for the entire chip.