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.


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.

KKing88 (author)2015-08-30

got the core files to load but now the IDE isn't recognizing any of the calls... getting errors like

"delay was not declared in this scope"

its for evrything?!? dunno HELP

MatteoG3 (author)2015-08-21

TimRogers (author)2015-07-21

Can I use a 22uF capacitor? That's the closest I can find at hand.

Thanks for the great Instrucatble.

DayvsonR (author)TimRogers2015-08-21

it think so, I am using two of 4.7uf in parallel and works, the capacitor is to avoid the reset in the upload

DayvsonR made it! (author)2015-08-21


if you are using Arduino IDE 1.6.5 read this, it is the same but more simples.

MontezumaG (author)2015-07-25

Please help!!!

How can you programm an AATTiny24.

i can't find libraries.


aizozeo (author)2015-06-29

i got a problem, the program is fine, and i uploaded blink program perfectly with errors

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45

but led is still not blinking,

i've changed the pins from 13 to 0, still doesn't work, i'm using arduino 1.0.6 and arduino nano, thank you and sorry for my bad english

hypnocool (author)2015-06-18

*I cant write to my ATtiny...can't upload... changed USB, all parameters correct. Im using windows 7 home edition... maybe bad attiny? how to find out if my tiny is working? prior sending data?

hypnocool (author)hypnocool2015-06-22

arduino was defective... i bought a nano instead

BuffaloFan32 made it! (author)2015-06-07

good instructable, only problem I had was the missing Arduino.h file. I posted a work around below.

abhinavonowinew (author)2015-04-23

Hey everyone!

I have tried uploading the blink program on the arduino (i have selcected ATTiny 85 w/ Arduino as ISP option)

Arduino shows me this error whiile compling!

Blink.cpp:8:21: fatal error: Arduino.h: No such file or directory

compilation terminated.

Please help!

I had the same problem until I found this:

Create an Arduino.h in ...\Arduino\hardware\attiny45_85\cores\attiny45_85 containing


at this link:

About This Instructable




Bio: My name is Randy and I founded the Instructables Design Studio. I'm also the author of the books 'Simple Bots,' and '62 Projects to ... More »
More by randofo:Large Motor ProjectsRemove a Wheelchair Motor BrakeBuild a Robot
Add instructable to: