Introduction: Program an ATtiny With Arduino

Picture of Program an ATtiny With Arduino

Follows are directions for programming the ATtiny microcontrollers using the Arduino IDE. In plain English, this is how to program 8-pin Atmel chips as you would normally an Arduino. This is cool because the ATtiny is tiny, and - well - this allows you to make tiny things that don't need a big ol' microcontroller.

The instructions I have posted here are pretty much the same as instructions given by the incredibly awesome High-Low Tech Tutorial. I posted my version of the instructions here because I plan to make a couple of upcoming projects using ATtiny chips and figured I would show my process.

Step 1: Go Get Stuff

Picture of Go Get Stuff

You will need:

- Arduino
- Breadboard
- ATtiny85 (or ATtiny45)
- 10uF 16V electrolytic capacitor
- 220ohm 1/4 watt resistor
- solid core hookup wire

Step 2: Wire the Circuit

Picture of Wire the Circuit
Connect the Arduino to the ATtiny as follows:
  • Arduino +5V      --->  ATtiny Pin 8
  • Arduino Ground --->  ATtiny Pin 4
  • Arduino Pin 10   --->  ATtiny Pin 1
  • Arduino Pin 11    --->  ATtiny Pin 5
  • Arduino Pin 12    --->  ATtiny Pin 6
  • Arduino Pin 13    --->  ATtiny Pin 7

Step 3: Program the Arduino

Picture of Program the Arduino

Select the "ArduinoISP" sketch from the "Examples" menu.

Upload the sketch to your Arduino as you would any other sketch.

Your Arduino is now configured as a serial programmer that can program other chips.

Step 4: Filter Cap

Picture of Filter Cap

Put the 10uF capacitor between ground and the Arduino reset pin. Make sure to keep an eye on the capacitors polarity (ground to ground!).

It is rumored you only need this for the Arduino Uno, but I have found it helped matters to include it with earlier versions as well. If you find that it is not working in the next steps, simple remove it and see if that helps.

Step 5: ATtiny Core Files

Picture of ATtiny Core Files

Take note of your sketchbook folder from the Arduino preference menu.

Create a new folder in your sketchbook folder called "hardware"

Then, go to this page and download the file:

Unzip this file and leave it in the new hardware folder.

Finally, restart the Arduino programming environment. The new cores should now be loaded.

Note that there are also core files for a number of other ATtiny chips. This page is a good starting point for interfacing with a wide range of them using the Arduino.

Step 6: Program the ATtiny

Picture of Program the ATtiny

Select from the top menu:
Tools --> Board --> ATtiny85 (w/ Arduino as ISP)

(Of course, you will want to select a different chip for this if you are using one.)

Then open the basic blink example and change the pin number from 13 to 0.

Finally, upload it as you would any other sketch.

It should give the following error twice:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85

Simply ignore the error message and you should be good to go.

Step 7: Test Circuit

Picture of Test Circuit

Connect a 220 ohm resistor to pin 5.

Connect an LED between the resistor and +5V.

It should blink.

Congratulations. You're done.


AT (author)2013-02-23

This looked like such a cool project. But I am running into an issue that I can't figure out. I get the error once and then it says:

avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

When I connect the LED, nothin. :-(

zextron (author)AT2013-03-08

I had your error with a tiny85 that I've already used to try this project earlier in 2012, but I think it was fried or I fried it, because then I tried with the same exact config but another one and it was up and running!

AT (author)zextron2017-12-09

That is exactly what happened. I put this project aside for a year and wend back at it and tried a new chip and it all worked great. I tried one of the chips that was an issue and it was still an issue. So bad chip, I fried it somehow? Who knows and who cares. I got it to work and the AT tiny85s are inexpensive.

AT (author)AT2013-02-23

I have the 1.0.3 version and switched back to 1.0.1 and getting the same error. I tried the trick that hydronics did but that didn't work either.

I have ATTINY85-20PU
Arduino UNO R3
Board is set to ATTINY 85 (external 20 MHz Clock)
Programmer as Arduino as ISP

Tried Upload and Upload using Programmer

I was able to get the Burn Bootloader to run once with the proper error messages. Nothing else seems to be going as it should.

Binary sketch size: 834 bytes (of a 8,192 byte maximum)
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

Jamebonds1 (author)AT2014-03-05

Don't bootloader and use External. It will damages core. I damaged mine.

PeterB57 (author)Jamebonds12017-12-07

Selecting "External" means you need a external crystal for it to work.

You can add a crystal, reprogram with "Internal" setting and remove external crystal.

iwilliams13 (author)AT2013-12-25

I have used that exact chip and got those errors to rectify it I did this
1 load *ArduinoISP* sketch to arduino board
2 Use ATtiny 85 (internal 1Mhz clock) as board
3 Double check your connections ( i say this because in my case I had reset connected to pin 9 instead of pin 10 when `i got this error)
4 Load a simple sketch like Blinky to see if it works

AT (author)iwilliams132014-02-03

I hope to get back to this project at the end of Feb. Thank you for the information. I was so excited about getting some stuff running on the ATtiny 85. I look forward to getting something to work! :-)

randofo (author)AT2013-02-24

Go even further back... Arduino 1.0.anything is not going to work. Go back to version 20 or earlier of the old IDE. For some reason the core files do not work with the new version. Unclear whether anyone is ever going to make an updated set of core files.

AT (author)randofo2013-02-25

I loaded up 20 and 22. These are working even worse. I can't even get the blink program to compile fore the ATTiny85. :-(

AT (author)randofo2013-02-25

That you for the tips. I will see about getting an older version. I have tried doing 1MHz and 8MHz and was getting the same issue. I will give these a try and comment back.

randofo (author)AT2013-02-24

Also, try it without setting the external clock. Try using the slowest possible internal clock. Sometimes the external clock causes strange errors until you get it configured correctly.

Bris32 (author)2017-09-18

Any ideas on controlling a servo with it?

thyme4soup (author)Bris322017-10-27

the ATtiny probably wouldn't be able to supply the current necessary to run a servo, try adding a BJT or a MOSFET or some kind of electric switch to take the binary signal from the ATtiny to allow current to drive the servo.

antisuru (author)2017-09-09

did not working on me

Why this happen when i select ATtiny85 (w/ Arduino as ISP)

can not compile

Blink.ino:10:21: error: Arduino.h: No such file or directory

Blink.ino: In function 'void setup()':

Blink:15: error: 'OUTPUT' was not declared in this scope

Blink:15: error: 'pinMode' was not declared in this scope

Blink.ino: In function 'void loop()':

Blink:20: error: 'HIGH' was not declared in this scope

Blink:20: error: 'digitalWrite' was not declared in this scope

Blink:21: error: 'delay' was not declared in this scope

Blink:22: error: 'LOW' was not declared in this scope

sebbithecool1 (author)2016-05-31

Would it work with a attiny25?

Nice and easy tutorial!

hey does attiny25 work ?

yes it does, if you use the right settings

im sorry, its a long time since i did this so i dont remember the settings. Also you have to use another library.

DadVentor made it! (author)2017-03-15

Thanks for the guide! I add the "heartbeat" "error" and "programming" status led's found in the AruduinoISP sketch.

JustinLovesTheTech (author)2017-03-10

So when I unzip the folder and restart the IDE, then open the board manager it just gives me the error "No valid hardware definitions found in folder attiny45_85" Any ideas??

dlchambers (author)2017-03-04

With ATtiny45, I find that the Arduino IDE's Clock setting has no effect - the instruction time is always 1us regardless of whether I set Internal clock to 1 or 8 or 16MHz.

Anyone else seen this? Any workarounds? I need the faster instruction cycle from a 16MHz clock.

SimonK97 (author)2017-01-04

So I just have a few 100uF capacitors...

Do they work as well?

AsifK4 (author)2016-07-10

will a resistor of 10uf 50 V work

DanteM13 (author)AsifK42016-12-25

Hi, I hope you understand that a resistor is one kind of component and a capacitor is onother. And yes a capacitor with a value of 10uf and 50 V should work very well :)

ChriseanA (author)2016-07-01

avrdude: Yikes! Invalid device signature.

Double check connections and try again, or use -F to override

this check.

Why does this message appear? :( I can't upload the sketch to attiny85

JánM3 (author)ChriseanA2016-10-31

Hi Chrisean, Did you solved your problem somehow? I have the same here.. :((

aashi7 (author)2016-10-09

how can I reprogram Attiny 13 ?

NghĩaT12 (author)2016-09-01

Can this download program for Attiny13 ?

sekramer10 (author)2016-06-29

Do you need to do anything with a bootloader?

Kepp27 made it! (author)2016-06-13

Used Arduino 1.6.5. Connected the pins, ran the ArduinoISP. Did not download the attiny85 files in this tutorial. Instead added this "" to additional boards in File->preferences. Downloaded the newest ATtiny plugin from Tools->Board:->Boards Manager->search "ATtiny" and installed newest version. Found this via the original page: Uploaded the blink program. The timing was completely off as I had picked a clock of 8 MHz internal and by default it runs at 1 MHz. Which would explain why it was like 8 times slower. Burned new bootloader. Uploaded blink program again and now it works perfect!

carlos.j.rincon1 (author)2016-06-10

Hi, for the ATtiny84A exist Bootloader?

HayderA8 (author)2016-04-27


After this procedure ,how can i add these code into microcontroller?

#include <avr/io.h>
int main(void)

DDRB = 0b00000001; //Data Direction Register setting pin0 to output and the remaining pins as input
PORTB = 0b00000001; //Set pin0 to 5 volts
{//Code would be in here if it needed to execute over and over and over ... endlessly


JamesZ16 made it! (author)2016-04-14

thank you so much. and yes high-low tech is an awesome site for this kind of stuff. basically every idea i have an uno is too large to be practical.

this is my first step to making the things i want to make rather than making things others have already made and was made just to learn.

(though i have a whole lot to learn and look forward to it)

thanks again will be checking out your "Tiny" builds next.

JamesZ16 (author)JamesZ162016-04-18

lol wanted to program more and got the dreaded errors:

stk500_getsync(): not in sync: resp=0x00.

set it up the exact same way.... 10uf and all.... triple checked everything....

very annoying how unreliable this sort of method is and i have a $3 ATTiny 85 programmer but it doesn't work... i need to make a shield...

JamesZ16 (author)JamesZ162016-04-21

figured it out again..... somehow.....

regardless, now that i have more than one uno to work with (6 actually and a mega) i am going to make a permanent shield once my 8 pin IC sockets arrive which haven't even shipped yet even though i ordered them over a month ago... (gotta be careful what and when i need something when buying from china) though just ordered some more from a US vendor and will be here in 3 days so that will be a fun project (nice break in between studying for finals) as i will go through them fast enough

elexhack (author)2016-03-31

AtTiny85 does not have Arduino boot loader in it, then how does it understand functions like digitalWrite(), analogWrite() and all other functions that are only used in Arduino programming and not in embedded C?

eddiea6987 (author)elexhack2016-04-07

that is what this instructables does, it puts the bootloader in it so it can understand those functions

MarkS366 (author)2016-03-17

Is there a good article that explains how to best utilize pins. For example, I have an Uno with a lot of digital and analog pins. I'm not really sure how to make it all work with this smaller CPU.

matti.virta.1 (author)2016-02-26

thanks working whit version arduino ide 1.6.7 but not has tools-boards-attiny as isp. but have only attiny and i use thats, load sketch good and blink working. thanks.

proplem has first only were found bootloader and burn thats, then all ok.make new folder "hardware" and copy these tiny files.then working :)

MatteoG3 (author)2015-08-21

i've this error...

avrdude: Yikes! Invalid device signature.

I don't know what i've to do....

i've tried a lot of things but without solutions....

Please help me!!!

anerdkb16 (author)MatteoG32016-02-07

I got the same error and what solved it is as follows. Press continuously the reset button on the arduino. While doing so take out the usb cablw out of the pc for a few secs and then put it back in (while still pressing the reset button) then upload your attinny85 sketch and only then while it uploads release the reset button on the arduino. Let us know how it works. Good luck!!

AndreasB2 made it! (author)2016-01-21

The shield works great!

Thank you for making this guide!

cosmicr (author)2016-01-18

Thanks I got it working no problems, but how come the LED is connected to 5v and not to ground? Does it make a difference?

Fezder made it! (author)2015-12-31

Yup, with that newer zip works like charm. Thanks for this 'ible!

demidroll made it! (author)2015-12-29

it's easy with tutorial. IDE 1.6.9 hw


pepelephew made it! (author)2015-09-04

Great Tutorial... Thanks...

AngelZ4 (author)pepelephew2015-11-06

bro that looks awesome, is there an instructable for this?

AlexP71 (author)2015-10-13

WARNING: This tutorial is now out of date. The zip you are instructed to download is not compatible with the current release of Arduino (1.6.5). Also this tutorial does not mention burning the boot loader to the ATtiny - I found this was required before I could upload sketches. There is an updated version of the original High-Low Tech tutorial linked in this Instructable which did work for me:

Hope this helps somebody!


andreasp11 (author)2015-09-10

i want to get a pulse in output of attiny45, do u know any code for it? or some link?

pradeepss (author)2015-09-05

Made it. Easy tutorial. Note: didn't need the 10uf capacitor.

About This Instructable




Bio: My name is Randy and I am a Community Manager in these here parts. In a previously life I had founded and run the Instructables ... More »
More by randofo:Large Motor ProjectsRemove a Wheelchair Motor BrakeBuild a Robot
Add instructable to: