Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Arduino & Microcontrollers

ATtiny85 Digispark Projects: Tiny USB Gadgets for Beginners

ATtiny85 Digispark Projects: Tiny USB Gadgets for Beginners

March 11, 2026 /Posted byJayesh Jain / 0

The Digispark ATtiny85 is arguably the coolest little microcontroller board you can buy for under ₹150. About the size of a 50-paise coin, it plugs directly into a USB port, can be programmed from the Arduino IDE, and runs perfectly well on just 5V from USB power. It’s the ideal platform for small, self-contained USB gadgets that don’t need the full power of an Arduino Uno.

In this guide, we’ll cover everything you need to get started with Digispark: setting up the Arduino IDE, understanding the ATtiny85’s unique constraints, and building five beginner-friendly projects ranging from a USB HID keyboard emulator to a tiny capacitive touch sensor.

Table of Contents

  1. What Is the Digispark ATtiny85?
  2. Arduino IDE Setup for Digispark
  3. ATtiny85 Constraints to Know
  4. Project 1: USB Keyboard Shortcut Button
  5. Project 2: NeoPixel LED Mood Light
  6. Project 3: USB Password Typer
  7. Project 4: Tiny Temperature Monitor
  8. Project 5: Capacitive Touch Lamp Dimmer
  9. Frequently Asked Questions

What Is the Digispark ATtiny85?

The Digispark is a development board by Digistump built around the Atmel ATtiny85 microcontroller. Here are its key specs:

Spec ATtiny85 / Digispark
CPU ATtiny85 @ 16.5 MHz
Flash 8KB (6KB usable — bootloader uses 2KB)
RAM 512 bytes SRAM
EEPROM 512 bytes
I/O Pins 6 (P0–P5), but P3/P4 = USB, P5 = reset (limited)
Usable I/O P0, P1, P2 reliably; P3/P4 shared with USB
ADC 4 channels (A0–A3), 10-bit
PWM P0, P1
USB USB 1.1 via Micronucleus bootloader + V-USB library
Power 5V USB or 7–35V VIN

The USB connectivity is implemented in software using the V-USB library and the Micronucleus bootloader. This means you can program it like an Arduino and create USB HID devices (keyboards, mice, joysticks) without any dedicated USB hardware.

Recommended: Arduino Pro Mini 328 – 3.3V/8MHz — If you need more I/O pins, hardware UART, and more flash than the ATtiny85, the Arduino Pro Mini is the next step up. Still compact and breadboard-friendly, it’s perfect when your project outgrows the Digispark.

Arduino IDE Setup for Digispark

Programming the Digispark requires adding Digistump’s board package to the Arduino IDE. Follow these steps:

  1. Open Arduino IDE (1.8.x or 2.x).
  2. Go to File → Preferences (Windows) or Arduino → Preferences (Mac).
  3. In “Additional Boards Manager URLs”, add:
    http://digistump.com/package_digistump_index.json
  4. Go to Tools → Board → Boards Manager. Search for “Digistump AVR Boards” and install it.
  5. Under Tools → Board, select “Digispark (Default – 16.5 MHz)”.
  6. Do NOT select a COM port — the Digispark uses a timing-based upload over USB, not a virtual serial port.
  7. To upload: click Upload in the IDE, wait for the “Plug in device now…” message, then plug the Digispark into USB within 60 seconds.

Windows driver issue: Windows 10/11 often doesn’t recognise the Digispark automatically. Download and run the Digistump drivers (zadig-based) from the Digistump GitHub releases page. Install the libusb-win32 driver for “Digispark Bootloader”.

Linux/Ubuntu: Add a udev rule to allow non-root USB access. Create /etc/udev/rules.d/49-micronucleus.rules with the appropriate VID/PID rule from the Digistump GitHub repository.

ATtiny85 Constraints to Know

Before diving into projects, understand these important limitations:

  • Only 3 reliably usable I/O pins: P0, P1, P2. P3 and P4 are shared with USB D+ and D– lines — you can use them in your sketch AFTER USB upload completes, but USB enumeration won’t work if you hold them in a conflicting state.
  • No hardware Serial: The ATtiny85 has no hardware UART. Use SoftSerial or the DigiCDC library for serial debugging over USB.
  • No hardware I2C: Use the TinyWireM library for I2C (bit-banged).
  • 6KB program space: Large libraries may not fit. The DigiKeyboard library alone uses ~2KB. Plan your libraries carefully.
  • 512 bytes RAM: Avoid String objects and large arrays. Use F() macro to store strings in flash.
  • 5 second delay on plug-in: The Micronucleus bootloader waits 5 seconds for an upload attempt before running your sketch. This is normal behaviour.

Project 1: USB Keyboard Shortcut Button

Create a single physical button that types a keyboard shortcut or macro when pressed. No drivers needed — the computer sees it as a standard USB HID keyboard.

Hardware: Digispark + 1 push button between P0 and GND.

#include "DigiKeyboard.h"

#define BUTTON_PIN 0

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
}

void loop() {
  DigiKeyboard.update();

  if (digitalRead(BUTTON_PIN) == LOW) {
    // Type Ctrl+Shift+T (reopen closed browser tab)
    DigiKeyboard.sendKeyStroke(KEY_T, MOD_CONTROL_LEFT | MOD_SHIFT_LEFT);
    delay(300);  // Debounce
  }
}

Customisation ideas: Change the key combo to mute/unmute microphone (Ctrl+D in Zoom), start a screen recording, or type a frequently used email address. You can also send multiple keystrokes in sequence to automate complex macros like opening a terminal and typing a command.

Project 2: NeoPixel LED Mood Light

Control a strip of WS2812B NeoPixel LEDs with beautiful colour animations powered by just the Digispark and USB power.

Hardware: Digispark + WS2812B strip (up to 8 LEDs from USB 5V, up to 30+ with external power) with Data → P0.

#include <Adafruit_NeoPixel.h>

#define PIN 0
#define NUM_LEDS 8

Adafruit_NeoPixel strip(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.setBrightness(50);  // Limit brightness for USB power safety
  strip.show();
}

void loop() {
  // Rainbow cycle animation
  for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256) {
    for (int i = 0; i < strip.numPixels(); i++) {
      int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
      strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
    }
    strip.show();
    delay(10);
  }
}

USB power limit: A standard USB 2.0 port provides 500mA at 5V. Each NeoPixel at full white draws up to 60mA. Limit brightness to 50/255 for safe USB operation without an external power supply.

Project 3: USB Password Typer

Store a long, complex password in the Digispark’s EEPROM and type it automatically when plugged into USB. Never type a long password manually again.

Security note: This stores a password in plain text in hardware. Do not use for high-security accounts. Keep the device physically secure. This is ideal for shared passwords on internal systems.

#include "DigiKeyboard.h"

// Change this to your password
const char* password = "MyS3cur3P@ssw0rd!";

void setup() {
  // Small delay to let the computer recognise the USB device
  DigiKeyboard.delay(2000);
}

void loop() {
  DigiKeyboard.sendKeyStroke(0);  // Wake up USB HID
  DigiKeyboard.print(password);
  DigiKeyboard.sendKeyStroke(KEY_ENTER);  // Optional: press Enter
  // Stop typing — halt forever
  while (true) { DigiKeyboard.update(); }
}

The password is typed only once when the Digispark is plugged in, then the loop halts. This prevents accidental re-typing if a window loses focus.

Project 4: Tiny Temperature Monitor

Read temperature from a DS18B20 sensor and send the reading over USB serial (DigiCDC) for logging on a PC.

Hardware: Digispark + DS18B20 temperature sensor on P2, with 4.7kΩ pull-up to 5V. The DS18B20 uses 1-Wire protocol — only one data pin needed.

#include <DigiCDC.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup() {
  SerialUSB.begin();
  sensors.begin();
  SerialUSB.delay(2000);  // Let PC recognise USB CDC device
}

void loop() {
  sensors.requestTemperatures();
  float tempC = sensors.getTempCByIndex(0);

  SerialUSB.print("Temp: ");
  SerialUSB.print(tempC);
  SerialUSB.println(" C");

  SerialUSB.delay(5000);  // Read every 5 seconds
}
Recommended: DS18B20 Temperature Sensor Module — The DS18B20 is the perfect companion for ATtiny85 projects: it uses a single wire for data, works at 3.3V and 5V, and has excellent accuracy (±0.5°C) in a tiny TO-92 package. Ideal for the tiny temperature monitor project above.

Project 5: Capacitive Touch Lamp Dimmer

Use the ATtiny85’s ADC to detect touch via capacitive sensing on a bare wire, and control an LED’s brightness via PWM. No dedicated touch IC needed.

Hardware: Digispark + 1MΩ resistor between P1 and P2 + bare wire or copper foil pad connected to P2 (touch electrode) + LED on P0 with 220Ω resistor to GND.

#define TOUCH_SEND_PIN 1
#define TOUCH_RECEIVE_PIN 2
#define LED_PIN 0

int brightness = 0;
bool increasing = true;

long readCapacitance() {
  long total = 0;
  for (int i = 0; i < 50; i++) {
    pinMode(TOUCH_RECEIVE_PIN, INPUT);
    pinMode(TOUCH_SEND_PIN, OUTPUT);
    digitalWrite(TOUCH_SEND_PIN, HIGH);
    delayMicroseconds(10);
    total += digitalRead(TOUCH_RECEIVE_PIN);
    digitalWrite(TOUCH_SEND_PIN, LOW);
    delayMicroseconds(10);
  }
  return total;
}

void setup() {
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  long cap = readCapacitance();
  bool touched = (cap > 35);  // Calibrate this threshold

  if (touched) {
    if (increasing) {
      brightness = min(255, brightness + 5);
      if (brightness == 255) increasing = false;
    } else {
      brightness = max(0, brightness - 5);
      if (brightness == 0) increasing = true;
    }
    analogWrite(LED_PIN, brightness);
    delay(20);
  }
}

Touch the wire electrode to ramp brightness up, lift your finger to pause at the current level. Touch again to reverse direction. Calibrate the 35 threshold by reading cap values with and without touch.

Frequently Asked Questions

Why is my Digispark not being recognised by Windows?

Windows requires a specific driver for the Micronucleus bootloader. Download Zadig (a Windows driver installer), select “Digispark Bootloader” from the device list (plug it in during the 5-second window), and install the libusb-win32 driver. After installing the driver, the Digispark should enumerate correctly. For Windows 11, you may need to disable driver signature enforcement temporarily during installation.

Can I use I2C sensors like OLED or BMP280 with the Digispark?

Yes, but you need the TinyWireM library instead of the standard Wire library. Connect SDA to P0 and SCL to P2. The OLED or BMP280 will work, but you’re limited to 6KB of program space — the Adafruit SSD1306 library alone may not fit. Use the more compact SSD1306xled library or u8x8 (text-only OLED mode) which are much smaller in flash footprint.

What is the difference between Digispark and Arduino Nano for beginners?

The Digispark is cheaper and more compact, but has severe limitations: only 3 usable I/O pins, no hardware Serial/I2C/SPI, and only 6KB flash. The Arduino Nano has 22 I/O pins, hardware UART, I2C, SPI, 32KB flash, and 2KB RAM. For learning Arduino programming and doing projects with sensors, displays, and motors, the Nano is far more capable. The Digispark shines specifically for tiny, self-contained USB gadgets where its built-in USB is the main feature.

How do I debug my Digispark sketch without a Serial monitor?

You have three options: (1) Use the DigiCDC library for USB serial output — open a terminal at 9600 baud after the 5-second bootloader window. (2) Flash the LED (P1 has the built-in LED) in patterns — e.g., fast blink = error state, slow blink = running normally. (3) Use the DigiUSB library with the DigiUSB Processing/Python client for bidirectional USB communication. Option 2 (LED blink codes) is the most reliable for simple debugging.

Can the Digispark power sensors and small components?

The 5V USB power pin on the Digispark can supply up to approximately 500mA from a standard USB port (the port’s limit). The Digispark’s onboard 3.3V regulator (if present on the clone) can supply around 100mA. For small sensors like a DS18B20, DHT11, or a single LED, USB power is more than sufficient. For power-hungry components like NeoPixel strips (>8 LEDs at full brightness), servo motors, or relay modules, use an external 5V supply and share only the GND with the Digispark.

Start your Digispark project today! Find Digispark ATtiny85 boards, Arduino Nano boards, sensors, and all components at Zbotic’s Arduino & Microcontrollers collection. Trusted by thousands of makers across India.

Tags: arduino projects, attiny85, digispark, digistump, microcontroller beginners, tiny usb gadgets
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Top Arduino Nano Clones in Ind...
blog top arduino nano clones in india ch340 vs cp2102 compared 595185
blog raspberry pi cm4 industrial grade pi for embedded projects 595190
Raspberry Pi CM4: Industrial-G...

Related posts

Svg%3E
Read more

Arduino Batch Programming: Flash Multiple Boards Quickly

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Based Radar System with Ultrasonic Sensor

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Automatic Plant Monitor: Sunlight, Moisture, Temperature

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Lie Detector: GSR Sensor Polygraph Project

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Metal Detector: Build a Treasure Finder

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now