Introduction: The LED Dicebox

About: I work at Middle Tennessee State University as a Professor of Physics and Astronomy and direct the Computational and Data Science Ph.D. Program. I've been a programming nerd, a woodworking geek, an astronomy d…

I started playing D&D in the 1970s with high school friends. After a long absence, I started playing again a few years ago through Roll20. Besides being an excellent game, playing gives me a chance to hang out with some dear friends who live in another state. Naturally, I started thinking about D&D projects I could make in my shop.

A few years ago, the people at Elderwood Academy created CNC carved hexagonal boxes for D&D dice. Although others have reproduced them, this is still the go-to place to find these beautiful boxes.
Because I have a CNC machine, I decided to make a few of these boxes as gifts for my friends. As I was building them, I started thinking about how to modify the design to be a bit more magical. After some experimentation, I found that programmable LEDs shining through transparent acrylic dice could produce beautiful colored designs. I decided to embed programmable LEDs into a carved wooden dicebox, and then create a translucent carved cover to reveal the lights within.

I think my favorite innovation in the project was developing a technique to create a delicate carved wooden pattern in a translucent lid. Doing this involved a two-sided CNC carve with two epoxy pours:

  • A layer of epoxy inside the lid that provides a foundation for the delicate carve.
  • A layer of epoxy on the outside of the lid that fills in the gaps between the wood.

Doing this carve took a bit of experimentation, but I think the results were worth the effort.

This project has four different phases:

  1. Carving the box
  2. Creating the led circuit board
  3. Mounting and connecting the electronics
  4. Programming the Arduino

You can (and should) modify the different aspects of the project to suit your abilities, time, and interest. You could, for example, use a 3d printer instead of a CNC machine for the box construction. Using a different set of programmable led's or even a small backlight screen would work well as an alternative to soldering a printed circuit board. Hopefully, the tutorials on the process will provide some inspiration for you to create something similar for your gaming table.

All the files for the project are available at:

The CNC design is available through the Inventable's Easel at:

There are a lot of different options for reproducing this project, but for my design I used:

  • X-carve CNC machine with a 1/4, 1/8, and 1/32 inch bit to carve the box
  • Hand drill with countersink and Phillips #2 bit
  • Hand sander
  • 3d printer for creating the electronics frame
  • Soldering iron, solder
  • Fusion 360, Eagle, and Inventables Easel software
  • Laptop to program the CNC, 3d printer, and design the circuit board

Ok - roll for initiative, and then let's get started.

Supplies

  • Hardwood or plywood piece for a sacrificial board - 24 x 11 x 1/2 inch
  • Hardwood piece for the dicebox - 18 x 5.5 x 0.9 inches (although this can be adjusted)
  • 7 WS2812B PTB Programmable LEDs from Sparkfun
  • 1 330 Ohm Resistor
  • 1 Arduino Nano
  • 1 4 x AAA battery case
  • 1 Pushbutton locking switch
  • Hookup wire
  • 2 - #4 x 3/4 inch screws
  • 3 - #6 1 1/4 inch wood screws
  • PLA for printing the 3d frame
  • Clear epoxy - about 3 ounces
  • Finishing supplies including sandpaper, shellac
  • You will also need to order a circuit board
  • Optional - clear glitter

Step 1: Two-sided CNC Carving Primer

A key element in the design of this project was creating two-sided CNC carvings. I wanted to spend a few paragraphs on the principles of the project before we get into the harder details.

The majority of CNC projects are one-sided signs or cutouts of projects from larger sheets of wood. Creating three-dimensional two-side projects might seem a bit daunting at first, but it turns out that your machine can do this easily as long as you use a few tricks for aligning your wood and your design when you carve the backside.

The best way that I have found to do this is to create a sacrificial alignment board to place under the piece you are carving. This piece needs to be firmly attached to your CNC base during the entire carve of the project. Place your workpiece on top of the sacrificial board, drill and countersink screw holes, and then attach it using woodworking screws. Drilling and countersinking the screw holes is critical to prevent you from you straining or even splitting your workpiece. You don't need to have the screw hole locations perfectly placed. The dowel holes will take care of the alignment, so you can be a bit sloppy where you drill the screw holes. For my layout, I placed the screws to be approximately at the middle of the left side of the piece. On the right side of the workpiece, I drilled the screw holes near the top and bottom corners.

In your project design, create a template to drill three holes at the left and right edges of your piece. In the design, the holes need to be positioned symmetrically above and below the centerline of the workpiece. I place them in the top and bottom corners on the left side and in the center on the right side to complement the placement of the woodworking screws.

When you fire up your CNC machine, let it align to machine-zero with your limit switches. Next, move the router head to find the approximate location of the bottom left corner of the workpiece. Mark the location of your workpiece in your machine as the workpiece zero. I also like to write down the x and y location of the bottom left corner just in case I manage to lose the alignment for some reason. The great thing about this process is you don't have to measure the location of your workpiece's corner precisely. As long as the machine remembers where it the workplace zero, the relative position of the design is measured from the alignment holes we create.

After aligning the workpiece and machine zero, you can carve the alignment holes using a 1/4 inch bit. The holes need to go through the workpiece and about 1/4 inch into the sacrificial board. If you remove the board from the machine, you will be able to realign it quickly using wooden dowels and a rubber mallet. Just place the dowels in before you screw your workplace back to the board.

The alignment holes make having precise alignment of the reverse side of the board easy. You just flip the board over, use dowels to align the holes, then drill, countersink, and screw the workpiece back to the sacrificial board.

If your design references the centerline of the centerline between the top and bottom edges of the workpiece, this alignment trick is nearly impossible to mess up.

In the pictures above, you how all these steps fit together. The final image shows the first stage of the carve, but you can also see the alignment holes and screw holes located on the left-hand side of the piece. You do not need to exactly align the screw holes and the dowel holes on the workpiece. This carve will still work fine as long as the design is inside these boundaries.

I included screenshots of the Easel design of the sacrificial wasteboard and the alignment holes as well. The wasteboard I used was made from 1/2 plywood and was about 24 x 7 inches. The workpiece for the project is 18 x 5.5 inches.

Step 2: Carving the Front Side of the Dicebox

After I set up your alignment holes, I carved the front side of the box. (Calling this the "frontside" is a bit arbitrary, but I will stick with that convention for these instructions.). The carve creates three pieces of the box:

  1. The lid of the box (left)
  2. The center of the box that holds the dice (center)
  3. The bottom of the box that holds the electronics and LEDs (right)

The workpiece used in this project was a 4/4 piece of walnut that was 0.91 inches thick. The workpiece was 5.5 inches across and 18 inches long. Any hardwood board would work, but I wanted to use a wood with a darker color to contrast the LEDs.

In the CNC pattern I created, I did this part of the carve in two stages. First, I did a two-pass carve of the lips and hexagons to hold the dice. For this stage, I used 1/4 inch and 1/8 inch bit. This stage took about 45 minutes to carve.

The second stage was to "hog out" the spaces in the box lid and the box bottom. I also carved the edge around the workpiece at the same time. The machine removes a large volume of wood in this cut, so it takes about 3 hours to complete.

I used a 1/4 inch bit in the second stage to define the edges of the workpiece. Since the thickness of the wood was 0.91 inches, the 1/8 inch bit I used would not be long enough to cut through the entire piece.

Step 3: Pouring the First Layer of Epoxy

After the front side of the project was carved, I removed the workpiece from the CNC machine. I did some light sanding to clean up the box edges. I then mixed approximately 1.5 ounces of clear epoxy and poured it into the lid of the box. I let this epoxy cure for about 24 hours before proceeding to the next step. Before doing this step, make sure to have a clean work area and a pair of gloves. If you are like me, you might want to wear an apron as well.

The purpose of this epoxy layer is to provide a solid foundation for carving the delicate pattern on the lid when I flip the workpiece over. I wanted the light from the LEDs to shine through the box lid, so this clear layer will form the structure that holds the pattern together.

Step 4: Carving the Backside of the Workpiece

Once the epoxy is hard, I returned the workpiece to the CNC machine. Before doing this, I sprayed a layer of shellac on the backside of the piece. It seals the top layers of the wood and made it a bit easier to clean up the final epoxy pour.

I then flipped the board over so the backside of the wood is facing the router. I used the alignment holes and some small pieces of 1/4 dowels to lock its position on the sacrificial board. I drilled, countersunk, and screwed the workpiece to the board.

I divided the carves on the backside of the workpiece into three sections.

  1. Cuts created with a 1/4 inch bit to drill the led holes and create a space for the PC board.
  2. Cuts created with a 1/8 inch bit to create the screw holes to attach the bottom electronics section to the dice holder and create a button hold for turning the lights off and on.
  3. Two-stage cuts using a 1/8 inch bit and 1/32 inch bit that creates the pattern in the lid.

I set all the depths in the pattern in Easel for a work board that is 0.91 inches thick. You need to use thick pieces of wood for this project to ensure that there is room in the base for the electronics. You also must make sure the pattern you carve in the box lid reaches through to the epoxy layer below.

The first two carves take less than 15 minutes to complete. The final design carve took about an hour to complete.

When I completed these three carves, remove the workpiece from the CNC machine and free the pieces.

Step 5: Pouring the Top Epoxy Layer

Once the carving was complete, I could pour the final epoxy layer for the box top.

For my project, I added some "spectral glitter" into the groves of the dragon pattern. I liked how the glitter defused the light. I mixed up about 1 ounce of epoxy and used a glue syringe and some popsicle sticks to spread it into the pattern. I tried to be as neat as possible, but some epoxy did flow outside the dragon pattern. I cleaned it up as much of the excess epoxy as I could with the edge of a clean popsicle stick. Ultimately I had to do some sanding to make it look acceptable.

One of the big surprises in the project happened when I poured the epoxy over the glitter. I had expected to see white crystals through the epoxy, but the glitter became almost transparent. The index of refraction of the glitter was nearly identical to the epoxy, so the glitter disappeared immersed in the liquid.

The glitter does slightly diffuse the light, but it wasn't quite the effect I was going for when I conceptualized the project. More experimentation is needed to fix this in a future revision.

I let the epoxy harden for at least 24 hours before I started finishing the box.

Step 6: Finishing the Box

Once the epoxy was dry, I cleaned up all the edges and surfaces of the box. I used a combination of files, sandpaper, and even a scraper to smooth the edges. For the epoxy lid, I did some light hand sanding up to 3000-grit after using a 60-grit sander to remove the epoxy overflow. Going to the 3000-grit sandpaper was probably not necessary, but I wanted the acrylic to be clear and shiny.

I sprayed the box with five thin layers of shellac. Shellac is my go-to finish because it is so easy to use. It produces a nice surface with very little hassle. It helps to do some light sanding between coats with 400-git paper.

Step 7: Creating a Circuit Board for the LEDs

Creating a circuit board for 7 LEDs seemed like overkill until I tried to do direct wiring in the project. The wiring nest with beautiful red, black, and green wires might make an excellent entry into the Rainbow contest by itself, but it wasn't easy to keep everything neat and functional. Despite careful soldering the components together and using shrink wrap to bind the connections, there were the inevitable connection problems that occur when you make create a rats nest.

I had built some printed circuit boards before, but mostly in the distant past. For this project, I decided it was worth taking some time to learn how to use Eagle. The tutorials by the Autocad experts were fantastic. After a few hours, I had imported the parts from Sparkfun, created a circuit diagram, aligned the LEDs to the location LED holes in the wooden box, and uploaded the design for manufacturing. About $20 and a week later, I had five copies of a PC board for my project. Note: all the files for this project including the Gerbel files are available at https://github.com/jfwallin/dicebox.git

For other new users of Eagle, here are some types from another newbie:

  1. Watch and follow along with the youtube tutorials. They are very well done and will give you a feel for what things you need to know to get started.
  2. Learn how to import parts libraries. You can also design custom parts if needed, but most of the basic designs are out there somewhere.
  3. Start with something simple to hone your design skills. When you layout the circuit diagram, you can use ground and power supply connectors instead of running wires everywhere.
  4. When you are happy with the electrical design, move to the physical layer. To align the board to the box, I used a combination of careful measurements on the actual piece and the carving design from Easel.

I made the board as simple as possible, so I didn't use any surface mount soldering. I opted instead to use the WS2812B Sparkfun LEDs in the PTH format. These are programmable LEDs individually packaged.

When you soldered the parts into the board, you should double-check my connections with a multimeter to avoid soldering them backward.

The board for this project has only eight parts:

Three wires also connect to the board - +6 volts, ground, and the signal from the Arduino.

When I first designed this board and the case, I decided to make a hexagonal recess in the wood to hold the board. I trimmed the edges of the rectangular PC board to fit this recess. In the final version of the CNC file in Easel, I created a rectangular space to hold the circuit board instead.

I opted not to mount the Arduino Nano or the battery case on this circuit board. I might change this in a future design, or even just create a surface mount board that integrates the CPU directly into the design.

Instead of making a more complicated board, I opted to mount the power switch, the battery box, and the Arduino on a 3d printed frame that attached to the bottom of the wooden base.

Step 8: Programming the Arduino

The Arduino program for this project is pretty simple. I modified a sketch from an addressable light project and then did some experiments to make the colors look pretty.

Programming a pleasing LED display using an Arduino involves some creative choices. I opted to create a color table with 120 values and store it into an array. I assigned each LED in the outer ring (U1 to U6) as a sequence of colors. I set the middle LED (U7) to be the complement of LED 1 (U1). I even set the brightness of the central LED to be twice as high as the others to balance the colors. At the start of the program, I add a 4-second delay. I included this purely for dramatic effect.

Every cycle, the code:

  • Updates the LEDs in the outer circle
  • Update the LED in the center
  • Changes the location of the color table to sample from
  • Displays the colors
  • Pause for 200 Milliseconds

The process repeats, filling the dice with colorful light.

Step 9: Mounting the Arduino, the Batteries, and the Power Switch

To mount the other electronic components, I created a small 3d printed platform that fits inside the bottom of the carved box. It is only 4mm thick and made from PLA. I epoxied this base into place and then epoxied the power switch as well. I used a small self-locking pushbutton switch similar to this for this project. I soldered the power wires to the switch before I glued it, and adjusted the switch height so that it extended through the hole in the base, but still was flush to the bottom of the box.

The battery box for the project holds 4 AAA-batteries locks into the base. The Arduino Nano fits into the slot in the PLA as well. I used hot glue to mount these components into the plastic so I could easily pull them out if needed. I used simple wiring to connect these parts. I ran the ground from the battery box to the Gnd on the Nano and then to the circuit board. We route the positive wire from the battery box to the switch. From the switch, the power goes to Vin on the Nano and Vdd on the circuit board. Pin 6 from the Nano goes to the signal pin on the circuit board. Try to keep the wiring short and neat. Use shrink wrap to insulate any exposed solder joints.

Once you have double-checked the wiring, you can power it up and see if the lights work.

Step 10: Final Assembly

The final step is to use the #4 screws to attach the bottom of the box to the piece that holds the dice. I carefully aligned the parts and then drill pilot holes to prevent the wood from splitting. I used a hand screwdriver to make sure everything nicely together. You can optionally glue small magnets into the lid and dice holder if you wish. Also, you may want to add a final layer of wax on the box to bring the finish to a shine.

The lights will start above four seconds after you power up the project. The light refracting through the transparent dice is striking. It was difficult to capture pictures that show how beautiful this is.

I can't guarantee the LEDs will supercharge your dice, but your party might draw some inspiration from the magic in this project. Good luck and happy gaming!

Colors of the Rainbow Contest

Participated in the
Colors of the Rainbow Contest