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

How to Use ATtiny85 20PU: Examples, Pinouts, and Specs

Image of ATtiny85 20PU
Cirkit Designer LogoDesign with ATtiny85 20PU in Cirkit Designer

Introduction

The ATtiny85 20PU is a small, low-power 8-bit microcontroller from the AVR family, designed for compact and efficient embedded applications. It features 8 KB of flash memory, 512 bytes of SRAM, and 6 general-purpose I/O pins. Despite its small size, the ATtiny85 is highly versatile and capable of handling a variety of tasks, making it ideal for simple control systems, IoT devices, wearable electronics, and other space-constrained projects.

Explore Projects Built with ATtiny85 20PU

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 20PU 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
ATmega328P-Based Sensor Hub with OLED Display and LIDAR
Image of TILTPCB: A project utilizing ATtiny85 20PU 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
ATtiny-Controlled LED Blinker Circuit
Image of led: A project utilizing ATtiny85 20PU 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
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
Image of wearable final: A project utilizing ATtiny85 20PU in a practical application
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ATtiny85 20PU

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 20PU 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 TILTPCB: A project utilizing ATtiny85 20PU 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 led: A project utilizing ATtiny85 20PU 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 wearable final: A project utilizing ATtiny85 20PU in a practical application
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • LED control and lighting systems
  • Small IoT devices and sensors
  • Wearable electronics
  • Battery-powered devices
  • Simple robotics and automation tasks
  • Signal processing and data logging

Technical Specifications

The ATtiny85 20PU is a DIP-8 (Dual Inline Package) 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
Maximum Clock Speed 20 MHz
I/O Pins 6
ADC Channels 4 (10-bit resolution)
PWM Channels 2
Power Consumption Low-power (active and sleep modes)
Package Type DIP-8

Pin Configuration and Descriptions

The ATtiny85 20PU has 8 pins, with the following configuration:

Pin Number Pin Name Description
1 PB5 (RESET) Reset pin (active low) or general-purpose I/O
2 PB3 (ADC3) Digital I/O, ADC channel 3, or external interrupt
3 PB4 (ADC2) Digital I/O, ADC channel 2, or external interrupt
4 GND Ground
5 PB0 (ADC0) Digital I/O, ADC channel 0, or PWM output
6 PB1 (ADC1) Digital I/O, ADC channel 1, or PWM output
7 PB2 (SCK) Digital I/O, 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 regulated 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 peripherals (e.g., LEDs, sensors, or buttons) to the I/O pins (PB0 to PB5) as needed.
  4. Clock Source: The ATtiny85 can use its internal 8 MHz oscillator or an external clock source. Configure this in the fuse settings during programming.

Important Considerations and Best Practices

  • Pull-Up Resistors: Enable internal pull-up resistors for input pins if no external pull-up is used.
  • Power Consumption: Use sleep modes to reduce power consumption in battery-powered applications.
  • Pin Limitations: Avoid exceeding the maximum current rating of 40 mA per pin or 200 mA for the entire chip.
  • Decoupling Capacitor: Place a 0.1 µF ceramic capacitor between VCC and GND to stabilize the power supply.

Example: Programming the ATtiny85 with an Arduino UNO

Below is an example of how to blink an LED connected to PB0 using the Arduino IDE:

// Include the necessary library for ATtiny85
// Ensure you have installed the ATtiny board package in Arduino IDE
void setup() {
  pinMode(0, OUTPUT); // Set PB0 (pin 5) as an output pin
}

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
}

Steps to Upload Code:

  1. Install the ATtiny board package in the Arduino IDE.
  2. Connect the ATtiny85 to the Arduino UNO as an ISP programmer:
    • Arduino UNO Pin 10 → ATtiny85 RESET
    • Arduino UNO Pin 11 → ATtiny85 PB0 (MOSI)
    • Arduino UNO Pin 12 → ATtiny85 PB1 (MISO)
    • Arduino UNO Pin 13 → ATtiny85 PB2 (SCK)
    • Arduino UNO GND → ATtiny85 GND
    • Arduino UNO 5V → ATtiny85 VCC
  3. Select "ATtiny85" as the board and "8 MHz (Internal)" as the clock in the Arduino IDE.
  4. Upload the code using "Upload Using Programmer."

Troubleshooting and FAQs

Common Issues and Solutions

  1. Problem: The ATtiny85 is not responding or programming fails.

    • Solution: Check the wiring between the programmer and the ATtiny85. Ensure the RESET pin is correctly connected.
    • Solution: Verify that the correct board and clock settings are selected in the Arduino IDE.
  2. Problem: The LED does not blink as expected.

    • Solution: Double-check the pin number in the code. For example, PB0 corresponds to pin 0 in the Arduino IDE.
    • Solution: Ensure the LED is connected with the correct polarity and has a current-limiting resistor (e.g., 220 Ω).
  3. Problem: Excessive power consumption in battery-powered applications.

    • Solution: Use sleep modes and disable unused peripherals in the code to reduce power usage.

FAQs

  • 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 reset the ATtiny85 fuse settings?
    A: Use an ISP programmer to reprogram the fuses. Be cautious when setting the clock source to avoid locking the chip.

  • Q: Can I use the ATtiny85 for I2C communication?
    A: Yes, the ATtiny85 supports I2C communication using software libraries like TinyWire.

By following this documentation, you can effectively integrate the ATtiny85 20PU into your projects and troubleshoot common issues.