Hanukkah Dreidel POV Display Using ATtiny85

by tweeto in Circuits > LEDs

2088 Views, 10 Favorites, 0 Comments

Hanukkah Dreidel POV Display Using ATtiny85

20201205_010254.jpg
3D Printed Hanukkah Dreidel POV ATtiny85
20201205_220106.jpg
20201205_220054.jpg
20201205_012042.jpg

I've made this Dreidel, SEVIVON (סביבון‎) in Hebrew, for the upcoming Hanukkah, you can spin a virtual one here:

https://www.google.com/search?q=spin+a+dreidel

A dreidel is a four-sided spinning top, played during the Jewish holiday of Hanukkah, Each side of the dreidel bears a letter of the Hebrew alphabet: 'נ‎' (nun), 'ג'‎ (gimel), 'ה‎' (hei), 'ש'‎ (shin), represent the Hebrew phrase 'NES GADOL HAYAH SHAM' ("a great miracle happened there").

In Israel we replace the letter Shin with the letter 'פ'‎ (pe), to represent the phrase 'NES GADOL HAYAH POH' ("a great miracle happened here").

Basically it's the old times Spinner, you can read more about this ancient Holidays toy here: https://en.wikipedia.org/wiki/Dreidel

The inspiration for this Instructable came from this well known Instructable, Thanks: https://www.instructables.com/ATtiny8545-POV-Displ... It has a great explanation of the physics behind POV display.

P.S. It is my first Instructable and as you probably already noticed, English is not my native language so please bear with me.

Supplies

  1. 3D printer (I used my Creality Ender 3 V2)
  2. Arduino or an ATtiny85 programmer
  3. ATtiny85
  4. 8DIP Socket
  5. Breadboard
  6. Soldering iron
  7. 4 x 5mm White LEDs
  8. Toggle Switch
  9. CR2032 3V Battery
  10. CR2032 Socket
  11. 10uf Capacitor
  12. 0.1uf Capacitor (optional)
  13. Wires (22-28 AWG)
  14. Basic tools

Disclosure: The links above contain affiliate links that at no additional cost to you, I may earn a small commission, this is the exact BOM I used for this project from the same suppliers I personally ordered from, Thanks.

3D Print All the Parts

20201204_142916.jpg
Screenshot 2020-12-05 223601.png
20201204_142901.jpg
20201204_142926.jpg
dreidel_3.png
dreidel_4.png

I designed the Dreidel using Autodesk Fusion 360 Personal and I highly recommended it.

I 3D printed each part by it self (had to test a couple of iterations on the handle for optimal fitting) using my Creality Ender V2. You get the optimal model and you can print all at once, or use different colors.

Slicing for the Ender 3 V2 was done using Cura with the basic settings, nothing special, except for the infill:

  • Handle - 80% - about an hour
  • Cover - 100% - 3 hours
  • Base - 50% - 6 hours

The Cover and Base are fitting tightly and smoothly, you might need to sandpaper the edges on the lips where they meet each other, you also want to make sure your printer is well calibrated.

Soldering and Cover Assembly

20201204_142844.jpg
20201205_234917.jpg
20201204_142907.jpg
20201204_142853.jpg
20201204_142849.jpg

Measure your wires roughly, there is plenty of room inside the base and you don't want to come up short.

Before soldering, Fit the LEDs inside their sockets and bend the legs, then take them out and solder.

Make sure you solder everything outside the cover, PLA is very sensitive to heat and you can easily damage this part.

The only part I soldered, Carefully and quickly, while mounted inside was the LEDs cathodes, for solid fitting.

Assemble everything, I know the fittings are fragile so be gentle and it should all snap fit, I'll probably design a second version for the cover with more robust fittings.

Programing the ATiny85, Codding and Testing

20201205_010212.jpg
Screenshot 2020-12-06 001614.png
Screenshot 2020-12-06 001637.png
Screenshot 2020-12-06 001718.png

First you will have to be able to program the ATtiny85, I learned how to do it from this great Instructable https://www.instructables.com/How-to-Program-an-At... , Thanks.

(At the beginning I used a breadboard but later on I've built my own basic programmer shield for ease of use, but it is not necessary).

For the code I just simplified vishalapr code and streamlined it for the Dreidel, using 4 pixels in a column instead of 5, and modify it for only 4 Hebrew letters.

#define delayTime 3
#define charBreak 6

#define LED1      0
#define LED2      1
#define LED3      2
#define LED4      3

#define charWidth 4

void setup()
{
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  pinMode(LED4, OUTPUT);
}

int g[]   = {15,  10,  10,  11};
int h[]   = {15,  8,   8,   11};
int n[]   = {15,  9,   9,   1};
int p[]   = {15,  9,   9,   13};

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

void displayChar(char c)
{
  if (c == 'g'){for (int i = 0; i < charWidth; i++){displayLine(g[i]); delay(delayTime);} displayLine(0);}
  if (c == 'h'){for (int i = 0; i < charWidth; i++){displayLine(h[i]); delay(delayTime);} displayLine(0);} 
  if (c == 'n'){for (int i = 0; i < charWidth; i++){displayLine(n[i]); delay(delayTime);} displayLine(0);}
  if (c == 'p'){for (int i = 0; i < charWidth; i++){displayLine(p[i]); delay(delayTime);} displayLine(0);}
  
  delay(charBreak);
}

void displayString(char* s)
{
  for (int i = 0; i <= strlen(s); i++)
  {
    displayChar(s[i]);
  }
}

void loop()
{   
  displayString("n  g  h  p");
}

In case you want to add more letters, graphics and icons, vishalapr, in his Instructable at Step 9, explains the math behind this special display and how it works.

Or you can just use my spreadsheet https://drive.google.com/file/d/16xpVROUolVtDFwU0d... which simplify it and auto calculate each column for you, just play with the 1's and 0's.

After playing with the delay times for best outcome I've set delayTime to 3 and charBreak to 6, it depends on the surface you spin on and your force, so just play with the numbers for best results.

Downloads

Play!

20201205_011637.jpg
20201205_011303.jpg
3D Printed Hanukkah Dreidel POV Using ATtiny85
20201205_011639.jpg
20201205_011313.jpg

Turn it on, cover the base, screw the handle and just play.

Happy Hanukkah!

Conclusion and Future Upgrades

Screenshot 2020-12-06 022455.png

As I quickly learned my design have some cons and to be honest with you, I'll list all of them below, and try to suggest solutions and workarounds:

  1. Flimsy fittings on the cover - I hope to be able to upload a new version of the cover with stronger fittings, but, if you just assemble it for the first time and don't take the circuit apart, you should be good.
  2. Poor Balance - the Dreidel balance is not so good, probably because the circuit weight is not evenly mounted, if you just attach the handle to the base without the cover, it spins perfectly and smoothly, I'll try to add some weight at the bottom of the base to counter the cover weight.
  3. Inaccessible Toggle Switch - mounted inside makes you remove the cover for each use and shutdown - this can be easily fixed by replacing the toggle switch with a Vibration Sensor switch like the SW-18010P which will make the dreidel On automatically when it spins.
  4. Short Readable Display Time - Because the Dreidel has no power, it starts with the speed you gave it and decelerate until full stop, standard POV displays count on a steady speed for smooth display, I already started to investigate a solution: adding a gyro - MPU6050 - and calculating the display delays on the fly. This solution will leave me with one less pin for the LED's so I'll have to upgrade to WS2812B LED strip utilizing only one pin for the data, it will also make me upgrade the power source... :) if it all works out I'll post another instructable - Dreidel V2.