Digispark DIY: the Smallest USB Arduino

479,054

621

74

Introduction: Digispark DIY: the Smallest USB Arduino

About: A place for DIY projects

Digispark is an ATtiny85 based microcontroller development board come with USB interface. Coding is similar to Arduino, and it use the familiar Arduino IDE for development.

Digispark is copyrighted by Digistump LLC (digistump.com) and the full license is here: http://digistump.com/wiki/digispark/policy

Specification:
Support for the Arduino IDE 1.0+ (OSX/Win/Linux)
Power via USB or External Source - 5v or 7-35v (automatic selection)
On-board 500ma 5V Regulator
Built-in USB (and serial debugging)
6 I/O Pins (2 are used for USB only if your program actively communicates over USB, otherwise you can use all 6 even if you are programming via USB)
8k Flash Memory (about 6k after bootloader)
I2C and SPI (vis USI)
PWM on 3 pins (more possible with Software PWM)
ADC on 4 pins
Power LED and Test/Status LED (on Pin0)

Step 1: Prerequisite

AVRISP MKII In-System Programmer
ATTINY85 Microcontroller
2 x 3.6V zener diode
2 x 68 ohm resistor
1 x 1.5K resistor
USB cable (get from broken mouse or keyboard)
Some wires


Step 2: Burning Bootloader to ATTINY85

Like Arduino, Digispark require a bootloader to be running on ATTINY85. The bootloader will occupied 2KB flash memory.

Download bootloader
1. Download Micronucleus bootloader for ATTINY85
2. Extract the file (micronucleus-t85-master.zip) to any folder
3. You can find the bootloader file at micronucleus-t85-master\firmware\releases folder
4. Use micronucleus-1.06.hex for the bootloader

Burning bootloader to ATTINY85
You must use the correct fuses bit for the bootloader

Extended: 0xFE
High: 0xDD
Low: 0xE1

Note: The above fuse bit will not enable reset as I/O, so you can have only 5 I/O instead of 6 I/O. I'm still try to figure out on how to set it to 6 I/O

I'm using AVRISP MKII In System Programmer and AVR Studio software for burning bootloader.

Step 3: Installing Digispark USB Driver

Digispark use USB to communicate with computer, so your computer must install Digispark USB driver
1. Download Arduino for Digispark which come with USB driver
2. Extract the file (DigisparkArduino-Win32-1.0.4-March29.zip)  to any folder
3. Execute DigisparkArduino-Win32\DigisparkWindowsDriver\InstallDriver.exe to start installing the USB driver

Step 4: Digispark Schematic

I provide two schematics, first one is the official schematic for Digispark, the other one is for testing purposes which the 5v is get from USB port and hence it is lesser components and much more simple.

Step 5: Plug in Digispark to Computer

1. Plug in Digispark to the USB port of computer
2. USB device is detected for first time use and prompt you to installing Digispark bootloader.
3. Click on Next button until finish.

Step 6: Configure Digispark Software

1. Run DigisparkArduino-Win32\Digispark-Arduino-1.0.4\arduino.exe to starting Arduino IDE
2. Click on Tools>Board>Digispark (Tiny Core)
3. Click on Tools>Programmer>Digispark

Step 7: Upload Sketch to Digispark

Upload an example. Click on File>Examples>Digispark_Example>Start
Coding is look like this:

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(0, OUTPUT); //LED on Model B
  pinMode(1, OUTPUT); //LED on Model A  
}
// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(0, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(1, HIGH);
  delay(1000);               // wait for a second
  digitalWrite(0, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(1, LOW);
  delay(1000);               // wait for a second
}


Follow step below to upload sketch to Digispark.
1. Unplug Digispark from computer before click on the Upload button 
2. Click on Upload button now
3. Plug in Digispark to computer when it prompt for "Plug in device now..."
4. If you see "running: 100% complete". Congraturation! you have own a working Digispark. 

Step 8: Test the Digispark

Connect a 330ohm resistor & LED to both pin5(Digital 0) and pin6(Digital 1) of ATTINY85. Plug the Digispark to computer,  both LED is start blinking now.

Step 9: What Can Do With Digispark

2 People Made This Project!

Recommendations

  • Make It Bridge

    Make It Bridge
  • Big and Small Contest

    Big and Small Contest
  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge

74 Comments

0
TDHofstetter
TDHofstetter

Question 9 months ago on Step 9

DigiSpark is a dead project, though, isn't it?

3
JerryE4
JerryE4

Tip 3 years ago

My wonderful wife of 50 plus years developed glucoma some five years ago. She needs to self administer eye drops in her eyes every morning and at bedtime. After putting in the drops she needs to keep her eyes closed for a designated period of time, each medicne has a different time requirement. So, since her eyes are closed she needed something to let her know when the time was up. I built her count down timers using the attiny85 by digispark, I used 4 digit 7 segment displays, and a buzzer so the time is displayed and it plays a little tune when it is safe for her to open her eyes. She loves them, I powered them with 9 volt batteries, one battery lasts nearly a year as it takes very little juice to run the timers. They are mounted in very small project boxes and I put a nice toggle switch on each device. Along the same line, I built another for my car because I am required to run it for 5 minutes every time I gas up my motor home, the car is towed behind the rig. I start the car, and let her run with the timer in the windshield so I can work around the rig while it runs. These things are worth their weight in gold and a blast to build simple devices with.

0
ShannonO2
ShannonO2

Question 4 years ago

I found a couple of tiny-85 dev boards in my stash but have no idea what to do with them. They have a attiny 85 micro controller and a micro USB interface with six pads labeled 0-5. Would your boot loader and USB driver likely with with this board? It looks like a lilypad but with the USB and without the graphics. It is labeled with a phrase DIY MORE but their web site doesn't have any reference to this product.

15486323969393321559650940617089.jpg1548632454209960170403234301974.jpg
0
ridvanaltun
ridvanaltun

4 years ago

if do you want to disable reset pin for a one more I/O pin, use this fuse setting

High fuse: 0x5d

1
SasikumarP
SasikumarP

6 years ago

I want to interface ultrasonic sensor to ATtiny microcontroller is it possible?

0
beamzer
beamzer

Reply 6 years ago

have a look here:

http://www.14core.com/didispark-attiny85-with-ultrasonic-hc-sr04-sensor/

0
WajahatN
WajahatN

6 years ago

this is also a nice method to burn bootloader using arduino UNO explained in the video.


0
alexandera51
alexandera51

6 years ago

i have a question, how can i use serial with the attiny85 so i can see a sensor reading or so? please help me want to build a remote control bt i need to see some ir signals to program the chip. thanks

0
smching
smching

Reply 6 years ago

Digispark works with Software Serial

0
kbckiwi
kbckiwi

Reply 6 years ago

I have a cuestion. I'm currently working on a project that uses an Attiny85 as the uC rather than an Arduino UNO (using one would be completely overkill as it'll be used just to measure temperature and displaying it) The hardware is realy basic. It's an LM35 as a temperature sensor and a 16x2 LCD display with an I2C interface. Now, with this Attiny85 board is it really necesary to burn the bootloader? Or is it already installed (or burned) into the uC? Being that is an SMT chip. How can I burn the bootloader? Can it be done via usb? Or using the Arduino IDE? Thanks.

0
smching
smching

Reply 6 years ago

Digispark Infrared Receiver:
http://ediy.com.my/blog/item/74-digispark-infrared-receiver

0
pillola
pillola

6 years ago

nothing to do with windows 10 !!! i must program with arduino and wire connections!

Windows 10 does not recognize the digispark !

0
jplaiss
jplaiss

Reply 6 years ago

One of the driver files wouldn't install, there is an address problem downloading and installing the Digispark version of the Arduino IDE, and now I'm discouraged.

Any suggestions?

0
alexandera51
alexandera51

6 years ago

one more question how can i program the attiny85 digispark usb with my tablet?

1
smching
smching

Reply 6 years ago

I can't help you on this matter because I do not own a tablet.

0
andysuth
andysuth

7 years ago

I'm having problems with the USB driver, it keeps saying board has been removed and timing out on the USB install.

It's not showing up in device manager.

Any Tips?

I remember someone once posted an alternative driver for Chinese origin ones.

0
smching
smching

Reply 7 years ago

Have you read this?
http://digistump.com/wiki/digispark/tutorials/connecting

If the computer will not recognize the Digispark try the following:
1. Try connecting it to another USB port or system.
2. Try connecting it to the rear ports (if a desktop)
3. Try connecting it to a USB hub.
4. Try a powered USB hub.
5. Try a different cable.

I like the intent behind this Instructable, but I have a couple issues with how it was presented. You're using "Digispark" as if it were your name, and there's no reference to to the actual Digispark product after reading through the whole writeup. You use the Digispark schematic, but removed the creative commons license, and didn't mention where it came from. It would be nice if you gave your project a unique name, e.g. "DIYspark - a Digispark clone", and at least put some links to Digispark in your writeup.