How to Program the ATtiny85 With the Arduino Uno Board




Introduction: How to Program the ATtiny85 With the Arduino Uno Board

About: Arduino Tutorials by Team

In this tutorial we will use an Arduino board as an ATtiny programmer.

To do this we will use one Arduino UNO board as an ISP (programmer) and one ATtiny85 micro-controller.

We will use Codebender - online Arduino IDE.

With the following procedure you will be able to program easily the ATtiny45 and ATtiny85 micro-controllers.

So, let's get started!

Step 1: What You Will Need

For this tutorial you will need:

  • Arduino uno
  • Breadboard
  • ATtiny85
  • 10 uF capacitor
  • jumper wires

Step 2: About the ATtiny85

From Atmel:

The high-performance, low-power Atmel 8-bit AVR RISC-based microcontroller combines 8KB ISP flash memory, 512B EEPROM, 512-Byte SRAM, 6 general purpose I/O lines, 32 general purpose working registers, one 8-bit timer/counter with compare modes, one 8-bit high speed timer/counter, USI, internal and external Interrupts, 4-channel 10-bit A/D converter, programmable watchdog timer with internal oscillator, three software selectable power saving modes, and debugWIRE for on-chip debugging. The device achieves a throughput of 20 MIPS at 20 MHz and operates between 2.7-5.5 volts.

Datasheet: download

ATtiny85 pinout

  • Pin 1 - reset
  • Pin 2 - digital pin 3 / analog pin 3
  • Pin 3 - digital pin 4 / analog pin 2
  • Pin 4 - gnd
  • Pin 5 - digital pin 0 (PWM)
  • Pin 6 - digital pin 1 (PWM)
  • Pin 7 - digital pin 3 (PWM)
  • Pin 8 - Vcc (2.7~5.5V)

Step 3: Arduino UNO As an ISP

Here's the "Arduino ISP" code, embedded using Codebender!

Try downloading the Codebender plugin and clicking on the "Run on Arduino" button to program your Arduino board with this sketch. And that's it, you've programmed your Arduino with the ISP program!

Now disconnect the Arduino usb cable from your computer and proceed to next step.

Step 4: Connecting the Arduino Uno With the ATtiny85

The connections are pretty easy, see the above image with the breadboard circuit schematic.

Tip: The dot in the corner of the ATtiny shows the first pin.

  • Pin 1 to Arduino pin 10
  • Pin 2 -
  • Pin 3 -
  • Pin 4 to Arduino GND pin
  • Pin 5 to Arduino pin 11
  • Pin 6 to Arduino pin 12
  • Pin 7 to Arduino pin 13
  • Pin 8 to Arduino 5V pin

Connect a 10uF electrolytic capacitor between Arduino uno reset pin and ground.

Tip: The stripe on one side of the capacitor shows the negative pin and should connected with ground.

We will use the capacitor because it prevents the Arduino UNO from resetting, so we are sure that the Codebender (or Arduino IDE) talks to the ArduinoISP, and not with the bootloader, during the upload of sketches.

You can now connect again the Arduino uno to your computer and proceed to next step!

Step 5: Program the ATtiny85 With Codebender

We will use Codebender - online Arduino IDE - to program the ATtiny85 micro controller. Click here to connect with your Codebender account.

New to Codebender?

Codebender is an online Arduino IDE, and free of use! Why Codebender? You can write and program your Arduino boards from your browser and the best part is that you can store all of your sketches online! So there accessible from everywhere! Also you can share them with your friends and social networks.

With 517 builtin libraries, codebender offers the most comprehensive list of Arduino libraries in the world, and you can simply include them in your projects to use them.

Click here to make your new Codebender account for free!

Make a new sketch

We will make a new sketch for the ATtiny85 that will turn on an LED. We will connect the LED with a 220 Ohm resistor to digital pin 3 (pin 2 of ATtiny85).

Click on the "Create new sketch" button.

In the void loop() we will define the D3 as an outup: pinMode(3, OUTPUT); and we will turn on an LED with: digitalWrite(3, HIGH);.

For the next steps see the image above:

  • Select port (mine is COM3)
  • Select from boards menu the ATtiny85 with 8MHz internal osc
  • Click on advanced options button (gear icon on the right)
  • Select "Arduino as ISP"
  • Press the "Run on Arduino" button

That's it, you've programmed the ATtiny85 with this sketch!

Supported Arduino Commands:

  • pinMode()
  • digitalWrite()
  • digitalRead()
  • analogRead()
  • analogWrite()
  • shiftOut()
  • pulseIn()
  • millis()
  • micros()
  • delay()
  • delayMicroseconds()
  • SoftwareSerial()

Step 6: Well Done

Now you can remove the "programming" wires from the Arduino uno board.

You will only need power cables from 5V and GND. You can also use a rechargeable battery 3.7V or an external power source (max 5V)

You have successfully completed one more "How to" tutorial and you learned how to program the ATtiny85 micro-controller with the Arduino uno board!

I hope you liked this, let me know in the comments.

There will be more of them, so make sure to click Follow button!

Find more useful Arduino Tutorials here.

2 People Made This Project!


  • Go Big Challenge

    Go Big Challenge
  • Home and Garden Contest

    Home and Garden Contest
  • Electronics Contest

    Electronics Contest



3 years ago

I only have 6.8uf cap. Is that OK?


6 years ago

I flashed Blink to an ATTiny85, but it appears to be running on a 1MHz clock, even though I selected "8MHz internal". What am I doing wrong???


Reply 4 years ago

you’ll have to reburn the bootloader at 8mhz using the Arduino IDE. I had to do this earlier today so I know it can be done.


6 years ago

who has a spare arduino board please give me philippine

Tanmay Deuskar
Tanmay Deuskar

6 years ago


if I want to use a different pin as an output will I have to wire it differently wile programming it?



6 years ago

Well done. Just an well meant advise to anybody planning to program a few attiny's: make a small shield that sticks in your arduino. wiring up a breadboard become really tedious after a while :-)
As far as codebender goes: Really handy. No more fiddling with having the right boards installed. I do almost all my programming in codebender now


Reply 6 years ago

A ZIF socket on a breadboard would be perfect.


Reply 6 years ago

..true, but on a breadboard one is bound to use those stick in wires again and that is exactly what i wanted to get away from. With 2x4 legs the Attiny is not really hard to remove from its socket


Reply 6 years ago

I was a little unclear. I meant a ZIF socket on one of those $0.50 pc solder breadboards. I'm not sure that they are big enough to make a shield with, but there are different sizes. By the time you solder everything up though, you may be close to a $7 shield anyway.


Reply 6 years ago

have never seen a solder up breadboard so I am not sure about that. smallest zif I have seen is 14 pins and cost about 2 euro's. Danger with a bigger zif is misplacement. The regular 8 pin sockets are really very easy. screwdriver under the chip and they pop out fast easy and unharmed.
The shield I put together probably cost me around 1 euro: pins, socket, capacitor.
resistors and leds added but not really necessary