Introduction: Pov Spinner

So i was thinking: let's make something obvious.
This instructable is on making a spinner with a persistence of vision illusion inside.

Step 1: Parts and Wiring

  • ATtiny 45 ic
  • 5 smd led (1206)
  • 5 smd resistor (47 Ohm)
  • 2 small pieces of pcb
  • 1 coin battery (3v - 16mm)
  • 8 pieces of metal (for balance)
  • a piece of mdf (3mm) for the spinner itself
  • a 22mm metal ball-bearing (center)

The wiring is pretty straight forward. I followed the datasheet from Atmel (see screenshot above)

  1. The positive pins on the led go to PB0 - PB4 on the ic. I added a resistor in between.
  2. negative pins go to GND.
  3. Power the ic by connecting the battery to VCC and GND.

Step 2: Programming the Ic

In order to put code on the Attiny we need to follow a few steps:

  1. Upload the 'ArduinoISP' example to the Arduino board ( located in the examples folder)
  2. In Arduino preferences point to https://raw.githubusercontent.com/damellis/attiny... or look for attiny library (by David A. Mellis) and install it
  3. In Tools> programmer select the ‘Arduino as ISP’ option
  4. Attiny 45 runs on 1 Mhz but can be changed under ’Tools’. That's a bit to slow for persistence of vision: change it to 16 Mhz (normal clock on a regular Arduino)
  5. If you do the previous step you have to burn the boot loader. (Tools > burn bootloader)
  6. wire the Attiny to the Arduino board (see this page for the exact wiring or look at screenshot above). You also need a 10 uF capacitor between reset and ground to avoid reset (and starting the bootloader)
  7. upload the code below to the attiny.
  8. done.

arduino / attiny code from the spinner:

<p>int letterSpace;<br>int dotTime;</p>byte invader[] = {1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0};
byte invader2[] = {0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1};
int amount = 12;
void setup()
{
  // setting the ports of the leds to OUTPUT
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  letterSpace = 2;
  dotTime = 1;<br>}<br>
void printImage(byte pix[]){
int y, i;
// image
for (i = 0; i < amount; i++) {
	for (y = 0; y < 5; y++) { 
		digitalWrite(y, pix[y + (i * 5)]);
	}
	delay(dotTime);
}
// space between images
for (y = 0; y < 5; y++) {
	digitalWrite(y, 0);
}
delay(letterSpace);
}
void loop(){
	printImage(invader);
	printImage(invader2);
}

Step 3: Simple Spinner Images

create images

The spinner needs an image to display so i've made a small browser page to create sequences / images for the spinner. (attached as file)

It has an interface of multiple input tags (type: checkbox) and two functions: one to create a new column and one to create the sequence of 0 and 1.

My son (6) had a good time making some invader like sequences.

js:

var start = 8; // start with 8 columns

// a function to create a column of inputs. i have 5 led in the spinner..
function makeColumn() {
  var box = document.createElement("div");
  box.id = "col"; // check css for styling.
  for (var i = 0; i < 5; i++) {
      var input = document.createElement("input");
      input.type = "checkbox";
      box.appendChild(input);
  }
  document.body.appendChild(box);
}
// function attached to load event. Creates the buttons and the columns based on the amount stored in start variable
function create() {
  var b = document.createElement("button");
  b.innerHTML = "create";
  b.addEventListener('click', generate);
  document.body.appendChild(b);
  var b2 = document.createElement("button");
  b2.innerHTML = "add row";
  b2.addEventListener('click', addNew); // event for adding a new column
  document.body.appendChild(b2);
  var input = document.createElement("p");
  input.id = "result";
  document.body.appendChild(input);
  for (var i = 0; i < start; i++) {
      makeColumn();
  }
}
// adds a new column
function addNew() {
   makeColumn();
   start++;
}
// function to generate the sequence of 0 and 1
function generate() {
   var inputs = document.querySelectorAll("input");
   var result = [];
   for (var i = 0; i < inputs.length; i++) {
       var r = inputs[i].checked ? 1 : 0;
       result.push(r);
   }
   var pusher = document.querySelector("#result");
   pusher.innerHTML = result;
}
// start everything when page is loaded.
window.addEventListener('DOMContentLoaded', create);

css:

#col {
   display: inline-block;
}
input {
   display: block;
   -webkit-appearance: none;
   width: 20px;
   height: 20px;
   background: black;
   margin: 1px 1px 0;
}
input:checked {
    background: yellow;
}

The spinner itself was made with NodeBox 3 - an interesting tool for design. The svg output is included.

Comments

author
Sembot made it! (author)2017-06-23

I love this project, I made it myself

What I had to do is change the code of the image in reverse, so 1 becomes 0 and 0, becomes 1

And then I have another problem, the bottom 2 LEDs, connected properly, do not display the actual figure

Can you please help me?

Regards

DSC01591.JPGMOV01590.MPG
author
lievn_m made it! (author)Sembot2017-06-23

Hi, thx for liking it!

I don't understand why you had to change the 0 - 1 sequence to make it work. Did you use the html page (included in last step) that generates the sequence?

I tried out a simple drawing first: once that works a more complex one will do fine. Make shure the amount variable is the amount of 'columns' (in this case: 9) in your drawing. A good idea is to change the variables for speed (dotTime and letterSpace) to see what happens. I tried to example below (following the instructable) and it seems to work fine. Are you shure the wiring is correct?

Screen Shot 2017-06-23 at 13.46.40.pngupdownled.m4v
author
Sembot made it! (author)lievn_m2017-06-23

Hai ,

1000 x sorry, I found the error, it's completely my fault

The last 2 resistors were connected to each other on the ATtiny85 pins, pin 2 (A3 / D3) and pin 3 (A4 / D4)

And because I want to build as little as possible with ordinary components, it's a bit hard to see (my eyes are not too good after 63 years of Hi)

Thank you for sharing this project with us , I love it so match

DSC01586a.jpg
author
lievn_m (author)Sembot2017-06-26

Good that your problem is solved.
thx again for liking it!

author
lievn_m made it! (author)Sembot2017-06-23

something funny with the previous picture: the idea is a up an down cycle:the sequence i tried in the movieclip (9 columns : 5 led):

0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1

updown.png
author
kukulcangod (author)2017-06-21

Have you patent it? Because you would loose the right by publically posting it..Shame because this is would be fascinating, too much for the uninformed buyer.

author
lievn_m (author)kukulcangod2017-06-22

i'm out of luck then, it seems to be too late already :)
anyway: pov is not really new, i can't be held responsible for inventing the illusion, let alone patent it..

author
attanayaka (author)2017-06-15

nice very nice

author
lievn_m (author)attanayaka2017-06-16

thx!

author
deluges (author)2017-06-16

Thats pretty cool! Although I still don't undertand the spinner trend which I guess makes me an old fart :(

author
lievn_m (author)deluges2017-06-16

i wouldn't worry about it, it don't really get the trend either but when my son came home with one it seemed like an ideal construction for a funny pov experiment

About This Instructable

4,697views

70favorites

License:

More by lievn_m:Pov SpinnerVideo DrummerFinger Powered Record Player
Add instructable to: