Using AtTiny2313 microcontroller Build an electronic polyhedral die

Summary of Using AtTiny2313 microcontroller Build an electronic polyhedral die


This article describes building an electronic polyhedral die using an AtTiny2313 microcontroller. Ideal for travelers and soldering beginners, the project replaces physical dice with a digital alternative. The device features 7-segment displays to show random numbers and includes tilt detection and a pushbutton for operation. It is powered by a CR2032 coin cell battery and housed in a custom or optional enclosure.

Parts used in the Electronic Polyhedral Die:

  • AtTiny2313 microcontroller
  • 20 pin dip socket
  • Tilt switch
  • Pushbutton switch
  • 20 mm battery holder
  • 33 ohm resistor
  • CR2032 20 mm 3 V coin cell battery
  • 2 X 3 break off pin header
  • eDice printed circuit board
  • Common cathode 2 digit 7 segment displays (red)
  • Solder
  • Wire
  • Glue
  • Heat shrink tubing

Dice are fun. Polyhedral dice used in D & D are even more fun, particularly in big handfuls of different sizes. But a handful isn’t always practical.
Ever since I saw the dragon bone electronic die wand advertised in the back pages of Dragon magazine when I was a kid, I wanted an electronic device to act as a substitute for all my dice.
electronic polyhedral dieThis device won’t substitute for the tactile feel of rolling a handful of funny dice, but its great for traveling games and is a fun project as an introduction to soldering and micro controllers. Having one of these proclaims to all your geek friends that you are another kind of geek entirely.
If you like this, please vote for it in the laser challenge. The box is pretty enough, but if I had a laser cutter I would make my own in the shape of a 12 sided die, cutting the sides out of acrylic with a precision that I could never achieve on my own.
Please see the notes in step 15 for more of my thoughts on what I would do with a laser cutter if I were to win the contest.

You will need the following tools:
  • Soldering iron.
  • Dremel and/or other tools to cut and shape the enclosure if needed.
  • Diagonal cutters.
  • Hot glue gun (optional).
  • Vice or Helping Hands to hold the board while soldering (optional, but highly recommended).
  • Multimeter for testing.
  • USBTinyISP or other AVR programmer to program the firmware. See step 10 for other options.

Electronics (Prices in US $ from mouser.com)

1- AtTiny2313 microcontroller $1.85
1- 20 pin dip socket $0.17 (optional, for AtTiny 2313)
1- tilt switch $1.51
1- Pushbutton switch $0.91 (Use any momentary pushbutton you like).
1- 20 mm battery holder $0.91 (for cr2032 battery)
2- 33 ohm resistor — 2 X $0.10 = $0.20
1 cr2032 20 mm 3 V coin cell battery $0.45 (these are ridiculously expensive in stores)
1- 2 X 3 break off pin header $0.10 (For ISP)
1- eDice printed circuit board — ~1.6 square inches = $?? (Depends on how you get it printed)
1- Common cathode 2 digit 7 segment displays (red) $1.57 (Also comes in Yellow, Green and Blue)

Total = $7.22 + board cost and optional enclosure.
Other Materials:

  • Solder.
  • Wire (for connecting button and battery)
  • Glue (I prefer hot) to attach device in optional enclosure.
  • Small bit of heat shrink tubing.
  • The optional box or other object you are mounting the die in.

For more Detail: Using AtTiny2313 microcontroller Build an electronic polyhedral die

Quick Solutions to Questions related to Electronic Polyhedral Die:

  • What is the primary purpose of this electronic device?
    The device acts as a substitute for physical polyhedral dice, specifically useful for traveling games.
  • Can this project be used as an introduction to soldering?
    Yes, it serves as a fun project for learning about soldering and microcontrollers.
  • How is the device powered?
    The device uses a single CR2032 20 mm 3 V coin cell battery held in a 20 mm battery holder.
  • Does the design include a way to detect movement?
    Yes, a tilt switch is included to detect orientation changes.
  • What type of display is used to show the results?
    A common cathode 2 digit 7 segment display is used to show the generated numbers.
  • How can I program the firmware for the microcontroller?
    You can use a USBTinyISP or other AVR programmer to program the firmware.
  • Is a dip socket required for the microcontroller?
    No, the 20 pin dip socket is optional for the AtTiny2313 microcontroller.
  • What tool is recommended for holding the board while soldering?
    A vice or Helping Hands are highly recommended to hold the board during soldering.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top