Hey guys! This is an Instructable for making your own ATtiny85/45 5 LED POV (Persistence Of Vision) display!

This is my second Instructable, also for the Elemental LED contest, so drop a comment and vote it up!

The total parts cost for this POV display is under $10! (If you get the parts from a wholesale supplier, like Mouser or Digi-Key)

I apologize for all the horribly blurry pictures, I'm using my iPod touch to take them (what a crap camera on that one, right?) I will be taking the pictures with a different camera for my future Instructables. :)

Step 1: Parts List

Things you will need:

1x ATtiny85/45 microcontroller
1x 8 pin DIP socket
1x 2 position slide switch
1x 100-220 Ohm resistor
1x 2 AA battery pack
5x LEDs (any color) (I used rectangular 2x5mm LEDs because they fit right next to each other without a gap on the perfboard)
Some bits of wire
Some perfboard

1x AVR programmer (can be an Arduino, go here for instructions)
1x Saw or Dremel for cutting the perfboard down to size

Step 2: Circuit Schematic

Here's the schematic for the circuit. I have attached the Eagle .sch file at the bottom.

Step 3: Program the ATtiny MCU

I made an Arudino sketch to upload to the ATtiny, so the Arduino would be the logical choice for uploading to the ATtiny. You can find a guide on how to do this here. (You can skip the guide if you already know how)

After you followed the guide above, hook up the ATtiny, and upload the sketch.

To change the message displayed, open the sketch, and scroll all the way down to the bottom. There will be a line that says "displayString("wow!!");", you can change the text inside quotes if you want to change the message. After you have done that, just re-upload the sketch to the ATtiny and you're ready to go.

Here's the code (for some reason it's not letting me upload the .pde file, it keep saying either HTTP Error or ir gets stuck at 100%. If anybody knows how to fix this please do tell.):

int delayTime = 2; //sub-char delay time
int charBreak = 5; //char delay time

int LED1 = 0;
int LED2 = 1;
int LED3 = 2;
int LED4 = 3;
int LED5 = 4;

void setup()
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  pinMode(LED4, OUTPUT);
  pinMode(LED5, OUTPUT);
  pinMode(7, INPUT); 

int a[] = {1, 6, 26, 6, 1};
int b[] = {31, 21, 21, 10, 0};
int c2[] = {14, 17, 17, 10, 0};
int d[] = {31, 17, 17, 14, 0};
int e[] = {31, 21, 21, 17, 0};
int f[] = {31, 20, 20, 16, 0};
int g[] = {14, 17, 19, 10, 0};
int h[] = {31, 4, 4, 4, 31};
int i[] = {0, 17, 31, 17, 0};
int j[] = {0, 17, 30, 16, 0};
int k[] = {31, 4, 10, 17, 0};
int l[] = {31, 1, 1, 1, 0};
int m[] = {31, 12, 3, 12, 31};
int n[] = {31, 12, 3, 31, 0};
int o[] = {14, 17, 17, 14, 0};
int p[] = {31, 20, 20, 8, 0};
int q[] = {14, 17, 19, 14, 2};
int r[] = {31, 20, 22, 9, 0};
int s[] = {8, 21, 21, 2, 0};
int t[] = {16, 16, 31, 16, 16};
int u[] = {30, 1, 1, 30, 0};
int v[] = {24, 6, 1, 6, 24};
int w[] = {28, 3, 12, 3, 28};
int x[] = {17, 10, 4, 10, 17};
int y[] = {17, 10, 4, 8, 16};
int z[] = {19, 21, 21, 25, 0};

int eos[] = {0, 1, 0, 0, 0};
int excl[] = {0, 29, 0, 0, 0};
int ques[] = {8, 19, 20, 8, 0};

void displayLine(int line)
  int myline;
  myline = line;
  if (myline>=16) {digitalWrite(LED1, HIGH); myline-=16;} else {digitalWrite(LED1, LOW);}
  if (myline>=8)  {digitalWrite(LED2, HIGH); myline-=8;}  else {digitalWrite(LED2, LOW);}
  if (myline>=4)  {digitalWrite(LED3, HIGH); myline-=4;}  else {digitalWrite(LED3, LOW);}
  if (myline>=2)  {digitalWrite(LED4, HIGH); myline-=2;}  else {digitalWrite(LED4, LOW);}
  if (myline>=1)  {digitalWrite(LED5, HIGH); myline-=1;}  else {digitalWrite(LED5, LOW);} 

void displayChar(char c)
  if (c == 'a'){for (int i = 0; i <5; i++){displayLine(a[i]);delay(delayTime);}displayLine(0);}
  if (c == 'b'){for (int i = 0; i <5; i++){displayLine(b[i]);delay(delayTime);}displayLine(0);}
  if (c == 'c'){for (int i = 0; i <5; i++){displayLine(c2[i]);delay(delayTime);}displayLine(0);}
  if (c == 'd'){for (int i = 0; i <5; i++){displayLine(d[i]);delay(delayTime);}displayLine(0);}
  if (c == 'e'){for (int i = 0; i <5; i++){displayLine(e[i]);delay(delayTime);}displayLine(0);}
  if (c == 'f'){for (int i = 0; i <5; i++){displayLine(f[i]);delay(delayTime);}displayLine(0);}
  if (c == 'g'){for (int i = 0; i <5; i++){displayLine(g[i]);delay(delayTime);}displayLine(0);}
  if (c == 'h'){for (int i = 0; i <5; i++){displayLine(h[i]);delay(delayTime);}displayLine(0);} 
  if (c == 'i'){for (int it = 0; it <5; it++){displayLine(i[it]);delay(delayTime);}displayLine(0);}
  if (c == 'j'){for (int i = 0; i <5; i++){displayLine(j[i]);delay(delayTime);}displayLine(0);}
  if (c == 'k'){for (int i = 0; i <5; i++){displayLine(k[i]);delay(delayTime);}displayLine(0);}
  if (c == 'l'){for (int i = 0; i <5; i++){displayLine(l[i]);delay(delayTime);}displayLine(0);}
  if (c == 'm'){for (int i = 0; i <5; i++){displayLine(m[i]);delay(delayTime);}displayLine(0);}
  if (c == 'n'){for (int i = 0; i <5; i++){displayLine(n[i]);delay(delayTime);}displayLine(0);}
  if (c == 'o'){for (int i = 0; i <5; i++){displayLine(o[i]);delay(delayTime);}displayLine(0);}
  if (c == 'p'){for (int i = 0; i <5; i++){displayLine(p[i]);delay(delayTime);}displayLine(0);}
  if (c == 'q'){for (int i = 0; i <5; i++){displayLine(q[i]);delay(delayTime);}displayLine(0);}
  if (c == 'r'){for (int i = 0; i <5; i++){displayLine(r[i]);delay(delayTime);}displayLine(0);}
  if (c == 's'){for (int i = 0; i <5; i++){displayLine(s[i]);delay(delayTime);}displayLine(0);}
  if (c == 't'){for (int i = 0; i <5; i++){displayLine(t[i]);delay(delayTime);}displayLine(0);}
  if (c == 'u'){for (int i = 0; i <5; i++){displayLine(u[i]);delay(delayTime);}displayLine(0);}
  if (c == 'v'){for (int i = 0; i <5; i++){displayLine(v[i]);delay(delayTime);}displayLine(0);}
  if (c == 'w'){for (int i = 0; i <5; i++){displayLine(w[i]);delay(delayTime);}displayLine(0);}
  if (c == 'x'){for (int i = 0; i <5; i++){displayLine(x[i]);delay(delayTime);}displayLine(0);}
  if (c == 'y'){for (int i = 0; i <5; i++){displayLine(y[i]);delay(delayTime);}displayLine(0);}
  if (c == 'z'){for (int i = 0; i <5; i++){displayLine(z[i]);delay(delayTime);}displayLine(0);}
  if (c == '!'){for (int i = 0; i <5; i++){displayLine(excl[i]);delay(delayTime);}displayLine(0);}
  if (c == '?'){for (int i = 0; i <5; i++){displayLine(ques[i]);delay(delayTime);}displayLine(0);}
  if (c == '.'){for (int i = 0; i <5; i++){displayLine(eos[i]);delay(delayTime);}displayLine(0);}

void displayString(char* s)
  for (int i = 0; i<=strlen(s); i++)

void loop()

Step 4: Breadboard It!

Now assemble the circuit on a breadboard to make sure that it is working properly. Power it with a 3 volt power source (such as 2 AA batteries or a CR2032 3V coin cell battery)

Make sure that the LEDs are in the right order. I will put the LED order first, and then the ATtiny pin it connects to.

Top LED - pin 3
Second LED from top - pin 2
Middle LED - pin 7
Second LED from bottom - pin 6
Bottom LED - pin 5

Step 5: Solder It!

When you have made the circuit on a breadboard and checked that it is working, you can solder it to a small piece of perfboard.
I used a piece about 12 holes long by 17 holes wide, but I'm sure you could make it smaller if you want.

I used rectangular 2x5mm LEDs because they fit right next to each other without a gap on the perfboard, and that makes the picture look better.

Step 6: Make It Look Nice!

I attached the battery pack to the back of the perfboard with hot glue, and then I used my Dremel to cut the part of my perfboard with the circuit on it to as small as I could. Then I used a sanding bit on the Dremel to make the edges nice and smooth and rounded.

Now it looks a lot better ;)

Step 7: Now You're Done! Good Job!

Now you can test out your brand-new POV display. You can change the text that displays on it as many times as you want by simply hooking it back up to the Arduino for programming, changing the message at the bottom of the code (in to "void loop()" function), and re-uploading to the ATtiny.

If it is not working, try using it upside-down instead.

Have fun!
<p>Great first POV project!</p><p>attiny45 NOTE: I'm using ATtiny 45 <br>on this, and ran into a problem of memory overflow. I don;t know why, <br>because the 45 is supposed ot have 4k on it, but it would not do <br>anything, even thpough the compiler only counted about 2.5k???. The <br>only workaround I found to make it function was to reduce the code <br>size. I // commented out the all the 'if (c==' lines in the displayChar <br> method that weren't included in my dispay word, and it works fine. (In <br> the &quot;wow! case, only the w, the o, and the ! remained un-</p><p>commented-out) <br> now it works. Probably not a problem with the 85. Also if using 3v, <br>you can probably use less of a resistor (or none, I have mine jumped <br>out) because it's pretty dim with 220.</p>
<p>The bootloader takes up about 2K, that is why your compiler reports <br>about 4-2 = 2K. Program the Attiny45 without bootloader (with a <br>programmer or Arduino) or easier, use an Attiny85 which have 6K.</p>
<p>Have you upload with ATTiny85 1 MHz? 8 MHz doesn't work well because it is equal to or less than 3 Volt. </p>
<p>Updated the code for anyone still interested. The letters on the device are capital letters, but the input is lowercase. This was a gotcha that needed to be fixed. Also added a character for a space, so you could put a space between words. <br><br>int delayTime = 2;<br>int charBreak = 5;<br>int LED1 = 4;<br>int LED2 = 3;<br>int LED3 = 2;<br>int LED4 = 1;<br>int LED5 = 0;</p><p>void setup()</p><p>{<br>pinMode(LED1, OUTPUT);<br>pinMode(LED2, OUTPUT);<br>pinMode(LED3, OUTPUT);<br>pinMode(LED4, OUTPUT);<br>pinMode(LED5, OUTPUT);<br>}</p><p>int A[] = {7, 10, 18, 10, 7};<br>int B[] = {31, 21, 21, 10, 0};<br>int C[] = {14, 17, 17, 10, 0};<br>int D[] = {31, 17, 17, 14, 0};<br>int E[] = {31, 21, 21, 17, 0};<br>int F[] = {31, 20, 20, 16, 0};<br>int G[] = {14, 17, 19, 10, 0};<br>int H[] = {31, 4, 4, 4, 31};<br>int I[] = {0, 17, 31, 17, 0};<br>int J[] = {0, 17, 30, 16, 0};<br>int K[] = {31, 4, 10, 17, 0};<br>int L[] = {31, 1, 1, 1, 0};<br>int M[] = {31, 12, 3, 12, 31};<br>int N[] = {31, 12, 3, 31, 0};<br>int O[] = {14, 17, 17, 14, 0};<br>int P[] = {31, 20, 20, 8, 0};<br>int Q[] = {31, 17, 17, 19, 31};<br>int R[] = {31, 20, 22, 9, 0};<br>int S[] = {8, 21, 21, 2, 0};<br>int T[] = {16, 16, 31, 16, 16};<br>int U[] = {30, 1, 1, 30, 0};<br>int V[] = {24, 6, 1, 6, 24};<br>int W[] = {28, 3, 12, 3, 28};<br>int X[] = {17, 10, 4, 10, 17};<br>int Y[] = {17, 10, 4, 8, 16};<br>int Z[] = {19, 21, 21, 25, 0};<br>int eos[] = {0, 1, 0, 0, 0};<br>int excl[] = {0, 29, 0, 0, 0};<br>int ques[] = {8, 19, 20, 8, 0};<br>int spc[] = {0, 0, 0, 0};</p><p>void displayLine(int line)<br>{<br>int myline;<br>myline = line;<br>if (myline&gt;=16) {digitalWrite(LED1, HIGH); myline-=16;} else {digitalWrite(LED1, LOW);}<br>if (myline&gt;=8) {digitalWrite(LED2, HIGH); myline-=8;} else {digitalWrite(LED2, LOW);}<br>if (myline&gt;=4) {digitalWrite(LED3, HIGH); myline-=4;} else {digitalWrite(LED3, LOW);}<br>if (myline&gt;=2) {digitalWrite(LED4, HIGH); myline-=2;} else {digitalWrite(LED4, LOW);}<br>if (myline&gt;=1) {digitalWrite(LED5, HIGH); myline-=1;} else {digitalWrite(LED5, LOW);}<br>}</p><p>void displayChar(char c)<br>{<br>if (c == 'A'){for (int i = 0; i &lt;5; i++){displayLine(A[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'B'){for (int i = 0; i &lt;5; i++){displayLine(B[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'C'){for (int i = 0; i &lt;5; i++){displayLine(C[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'D'){for (int i = 0; i &lt;5; i++){displayLine(D[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'E'){for (int i = 0; i &lt;5; i++){displayLine(E[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'F'){for (int i = 0; i &lt;5; i++){displayLine(F[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'G'){for (int i = 0; i &lt;5; i++){displayLine(G[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'H'){for (int i = 0; i &lt;5; i++){displayLine(H[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'I'){for (int it = 0; it &lt;5; it++){displayLine(I[it]);delay(delayTime);}displayLine(0);}<br>if (c == 'J'){for (int i = 0; i &lt;5; i++){displayLine(J[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'K'){for (int i = 0; i &lt;5; i++){displayLine(K[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'L'){for (int i = 0; i &lt;5; i++){displayLine(L[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'M'){for (int i = 0; i &lt;5; i++){displayLine(M[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'N'){for (int i = 0; i &lt;5; i++){displayLine(N[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'O'){for (int i = 0; i &lt;5; i++){displayLine(O[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'P'){for (int i = 0; i &lt;5; i++){displayLine(P[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'Q'){for (int i = 0; i &lt;5; i++){displayLine(Q[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'R'){for (int i = 0; i &lt;5; i++){displayLine(R[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'S'){for (int i = 0; i &lt;5; i++){displayLine(S[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'T'){for (int i = 0; i &lt;5; i++){displayLine(T[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'U'){for (int i = 0; i &lt;5; i++){displayLine(U[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'V'){for (int i = 0; i &lt;5; i++){displayLine(V[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'W'){for (int i = 0; i &lt;5; i++){displayLine(W[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'X'){for (int i = 0; i &lt;5; i++){displayLine(X[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'Y'){for (int i = 0; i &lt;5; i++){displayLine(Y[i]);delay(delayTime);}displayLine(0);}<br>if (c == 'Z'){for (int i = 0; i &lt;5; i++){displayLine(Z[i]);delay(delayTime);}displayLine(0);}<br>if (c == '!'){for (int i = 0; i &lt;5; i++){displayLine(excl[i]);delay(delayTime);}displayLine(0);}<br>if (c == '?'){for (int i = 0; i &lt;5; i++){displayLine(ques[i]);delay(delayTime);}displayLine(0);}<br>if (c == '.'){for (int i = 0; i &lt;5; i++){displayLine(eos[i]);delay(delayTime);}displayLine(0);}<br>if (c == ' '){for (int i = 0; i &lt;5; i++){displayLine(spc[i]);delay(delayTime);}displayLine(0);}</p><p> delay(charBreak);</p><p>}</p><p>void displayString(char* s)<br>{<br>for (int i = 0; i&lt;=strlen(s); i++)<br>{<br>displayChar(s[i]);<br>}</p><p>}</p><p>void loop()</p><p>{</p><p>displayString(&quot;GOD BLESS AMERICA!!!.... &quot;);</p><p>// displayString(&quot;JULIUS! &quot;);</p><p>}</p>
<p>I made a PCB using Fritzing. Here is link : https://github.com/B45i/ATtiny85-45-POV-display</p>
<p>Popsicle stick POV</p><p>http://youtu.be/ono6w5bb4YU</p>
Hey, great project! <br> <br> <br>...But I can't read the obviously &quot;modulated&quot; blinking &quot;WOW!!&quot;. <br>1. I only had common anode LEDs.... So I switched the HIGH for LOW, and vice versa. <br>2. It runs different speeds depending on whether I program using attiny85@1MHZ or 8MHz... Not sure if that is the problem....persistence? <br> <br>Should I have changed the delay times as well? <br> <br> <br>Thanks beforehand for your speedy response. <br> <br>Chas
Common anode LEDs? You use 5 separate LEDs. You should have 5 cathodes and 5 anodes, so i don't see what you're getting at. <br> <br>Since 8MHz is a faster clock speed than 1MHz, the code will run faster on 8MHz, therefore you will probably have to wave the device faster to see them message.
...And yes, I am using 5 Rgb-LEDs. <br> <br>C <br>
Sorry for the addendum, but not only a newbie...I'm OLD. <br> <br> I believe you may be able to use six LEDs if you eliminate the reset pin 1 function, and use it as an additional output.... Think I've seen that several times... <br> <br>I'll shaddup and wait for a response. <br> <br>C
<p>you can but then it would be harder to program as you would need a High Voltage Programmer a better option for more LED's would be to charlieplex them and you could do up to 20 LEDs on the ATTiny85/45(well i guess if you set the reset pin as an I/O pin then you could do 30 LED's but Pin5(reset) doesn't have as much source/sink current so an LED would be much dimmer on that pin so then you would need to use a transistor and well everything just gets more complicated for this use :p I found a good writeup about using pin5 as I/O here: http://www.robotroom.com/Atmel-ATtiny-STK500-Programming-4.html</p>
1. Having no descrete LEDs, I am using one common(anode NOT cathode) and one color of some spare Common Anode RGB-leds...thus the reversal of the digitalWrite(HIGH,LOW) scenario. Sorry I didnt mention that. <br>2. Actually, setting my programmer to 8Mhz runs slower than at the 1Mhz setting! I've seen this many times before in the ATtiny forums...and yes it IS counter-intuitive. I'd love to hear an explanation....but as I said, I am not sure the speed is the issue. ...UNLESS it causes the delay() Fn, to work differently/ perhaps opposite?; to what we would expect. <br> <br>Thanks for your quick response. <br> <br>Chas
Did you get it to work?
Yup....shore did....found som spare std. LEDS AND TOOK YOUR CODE BACK TO THE ORIGINAL.....sorry for the shouting....one caveat. ...I messed up spelling my wife's name in caps.....no blinking....WTF??? <br> <br>Thennnnn I looked at the code and realized it only provided for lower case, and voila!!! Put her on a lazy Suzan and there it was!! <br> <br>Thanks, <br>Chas
how would a person make the display a clock?
<p>I made it with Etched PCB. It work pretty good. Don't need much wire messy and is cheapest than order custom PCB online and not need EAGLE skill since you can use black marker. </p>
Hi! I just finished your great project!<br/>As other people commented, I also find the line pinMode(7, INPUT); in "void setup" does not anything there…<br/>I used a 3v. button battery (CR2032) and since the ATtiny85 and the LEDs can work with its voltage I didn't used any resistor.<br/>Just a question: do you think there is way to use the remaining PIN 1 to do something with it?<br/>Anyone knows about it?
Worked great after I changed the DelayTime to 1 <br> <br>
Nice Instructable! <br> <br>Couple of comments: <br>I think it should be pinMode(5, INPUT); not pinMode(7, INPUT); in the setup <br>Also it would be great to see some comments in the code (or separately) to step through the software. <br> <br>
Great Instructable, But I seem to be having trouble with my 4th LED, 2nd from the bottom... any idea?
Make sure your connecting the LED the right way. Maybe you don't have the polarity right, or you don't have the right pin connected to the LED. Try replacing the LED with another one also. If none of that works, try re-uploading the code.
I realized that in your code there was a Input, When I deleted that everything now works. Thanks for the great project to make late at night, From start to finish took me about 2-3 hours
I'm glad you figured that out. Id that how it was in the code i posted here? because if it is and its an error, i want to fix it.
i had the same problem with 4th led, i then removed the pinMode(7, INPUT); from the setup because it did not make sense, because the attiny has only 5 pins for interface. Now it works fine. :) you should remove this
Do you make your own PCBs? I've tried to make them myself but with no luck. If you could tell me how (PM me) i would appreciate it :)
Would someone be so kind as to do a quick Youtube demo of what we are supposed to see, not the fabrication process. <br> <br>Thanks, <br> <br>Chas
http://www.youtube.com/watch?v=ono6w5bb4YU&amp;feature=youtube_gdata_player <br>What do you see? <br>Hint, it's my wife's name, but very uncommon
is it... malia?
maliya? <br>
...but no ceegar....grin
I have no idea.... mikayla?
Hint2 use you're pause button?.. A free phone answering message in MP3 format, done by me(professional actor and voice specialist) to the first one to guess it right.<br><br>c
I believe it says &quot; MAYLA! &quot;
Annnnndwehaveawinnnnnaaaaa!<br><br>Right you are...though There were two explanation marks. I attribute that to the spacing Of my LEDs and t'he rather limited 5x5 font.<br><br>Give me your Ideas and text of your free custom ringtone/home phone Message as an mp3, and I'll start working on it! . Reply to hesynergy@gmail.com.
Nice ible. <br>To see the POV working what do you do, wave it around? <br>
You turn it on, and wave it side to side. From my experience and the one I made, if I turn it on with the switch on the bottom and the LEDs on the left side, it works best if I wave it from left to right. It comes out backwards otherwise.

About This Instructable




Bio: I'm a big Arduino fan. I'm always looking for new and exciting things to do with electronics and Arduino. I also like video ... More »
More by xBacon:DIY Infrared Proximity Sensor (Arduino Compatible) Color Changing LED Tree Plug-in LED Color Fading Night Light 
Add instructable to: