Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Digispark ATTINY85: Examples, Pinouts, and Specs

Image of Digispark ATTINY85Design with Digispark ATTINY85 in Cirkit Designer

Introduction

The Digispark ATTINY85 is a compact, low-cost microcontroller development board manufactured by Digistump. It is based on the ATtiny85 microcontroller chip and is designed for rapid prototyping and development of small-scale electronic projects. The board is compatible with the Arduino IDE, making it accessible to both beginners and experienced developers.

Explore Projects Built with Digispark 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 ATtiny85 and OLED Display Based Interactive Game with Buzzer and LED: A project utilizing Digispark 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.

Open Project in Cirkit Designer
Image of ATmega328P-Based Sensor Hub with OLED Display and LIDAR: A project utilizing Digispark 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.

Open Project in Cirkit Designer
Image of ATtiny-Controlled LED Blinker Circuit: A project utilizing Digispark 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.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The Digispark ATTINY85 is a versatile board with the following key specifications:

Specification Details
Microcontroller ATtiny85
Operating Voltage 5V
Input Voltage (USB) 5V
Flash Memory 8 KB (6 KB available for user code after bootloader)
SRAM 512 bytes
EEPROM 512 bytes
Clock Speed 16.5 MHz (internal oscillator)
Digital I/O Pins 6 (all can be used as PWM outputs)
Analog Input Pins 3
USB Support Built-in USB interface for programming and communication
Dimensions 25 mm x 18 mm

Pin Configuration and Descriptions

The Digispark ATTINY85 has 6 I/O pins, which are multifunctional and can be used for digital, analog, or PWM operations. Below is the pinout description:

Pin Name Function
P0 D0 Digital I/O, PWM, USB+ (used during USB communication)
P1 D1 Digital I/O, PWM, USB- (used during USB communication)
P2 D2 Digital I/O, PWM, Analog Input (A1)
P3 D3 Digital I/O, PWM, Analog Input (A3), I²C SDA
P4 D4 Digital I/O, PWM, Analog Input (A2), I²C SCL
P5 D5 Digital I/O, PWM, Reset (active low, used for programming)

Usage Instructions

How to Use the Digispark ATTINY85 in a Circuit

  1. Install the Arduino IDE: Ensure you have the Arduino IDE installed on your computer.
  2. Add Digispark Board Support:
    • Open the Arduino IDE.
    • Go to File > Preferences.
    • In the "Additional Board Manager URLs" field, add the following URL:
      http://digistump.com/package_digistump_index.json
    • Go to Tools > Board > Boards Manager, search for "Digistump AVR Boards," and install it.
  3. Connect the Digispark:
    • Plug the Digispark ATTINY85 directly into a USB port on your computer.
    • No external USB cable is required.
  4. Write and Upload Code:
    • Select Tools > Board > Digispark (Default - 16.5 MHz) in the Arduino IDE.
    • Write your code in the IDE.
    • Click the "Upload" button. When prompted, unplug and replug the Digispark to initiate the upload process.

Example Code: Blinking an LED

The following example demonstrates how to blink an LED connected to pin P0 (D0):

// Blink an LED on Digispark ATTINY85
// Connect the positive leg of the LED to P0 (D0) and the negative leg to GND.

void setup() {
  pinMode(0, OUTPUT); // Set pin P0 (D0) 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
}

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues and Solutions

  1. Problem: The Digispark is not recognized by the computer.
    Solution: Ensure the necessary drivers are installed. Visit the Digistump website to download and install the drivers for your operating system.

  2. Problem: Code upload fails or times out.
    Solution: Unplug the Digispark, click "Upload" in the Arduino IDE, and replug the board when prompted.

  3. Problem: USB communication is unstable.
    Solution: Avoid using P0 and P1 for other purposes while USB communication is active. Ensure the USB port provides stable power.

  4. Problem: The board does not power on.
    Solution: Check the USB connection and ensure the port is functional. Try a different USB port if necessary.

FAQs

This documentation provides a comprehensive guide to using the Digispark ATTINY85 for your projects. With its small size and ease of use, the Digispark is an excellent choice for compact and cost-effective designs.