-
Portable Digital Dice Tower w/Empower Feature
07/24/2022 at 07:58 • 0 commentsI recently built a Digital Dice Tower for myself. This one is designed to be used with a 5th edition sorcerer that has the empower spell feature. So, I added some functionality and built it in a unique and very portable case. Like my other bubble 7 segment LED designs, this one is powered by a single 9 volt battery and uses power saving mode in the CPU to extend battery life.
-
Digital Dice Towers based on Heathkit HD-16 Code Oscillator
07/24/2022 at 07:44 • 0 commentsHere's a series of Digital Dice Towers based on the Heathkit HD-16 Code Oscillator. This kit was available from Heathkit from the late 60's until the mid 70's. It's a battery powered buzzer and speaker in a sheet metal case. HAM radio operators would connect it their morse code key switch to practice.
The HD-16 case is a nice compact size with an excellent speaker. So, I decided to built a series of Digital Dice Towers based on this excellent period case.
The first piece utilizes a nixie tube display and is based on the software and hardware for the revised design for the 1975 Bell & Howell IMD-202 digital multimeters. So, it packs a custom 170 volt power supply, CPU board, amplifier, rotary encoders, roll button, indicator LEDs, and power switch in the little case. The nixies and the 7441 decoders/drivers were harvested from one of my spare Bell & Howell digital multimeters.
The sockets and drivers were hand wired to a protoboard.
Fitting everything into the case was a bit of a challenge.
The bubble seven segment display piece was just as complicated. However the audio only version was noticeably easier to build.
See the files attached to this project for the source files for these digital dice towers. The zip files include all the source and the Atmel Studio project files. Comments in main.c document the pinout on the ATMega 328p processor.
Here's a video demonstrating the operation of all three pieces in this series.
-
Revised Bell & Howell Digital Multimeter base Digital Dice Towers
07/24/2022 at 07:17 • 0 commentsOver the past few years, I have continued to amass a collection of the 1975 Bell & Howell IMD-202 digital multimeters with nixie tube displays. With some patience, I've been able to buy them on Ebay for less than $50 each. Given the case, power supply, nixie tubes, and 7441 decoder/drivers, that's a pretty good deal I haven't been able to pass up. However, now I have a bunch of these. So, I decided to revise the original audible dice tower design to simplify resto-modding these.
To achieve this goal, I've implemented the following changes.
- Rotary encoders to select dice count and dice type - These encoders utilize the original faceplate holes that mounted the original mutli-way rotary switches. Therefore there are no modifications to the faceplate required. I can just clean off the original faceplate graphics with some acetone, apply new graphics (printed water slide or embossed labels), and install the encoders, button, led, and power/volume pot. The only modification to the case required is drilling holes to mount the speaker.
- Simple class D amplifier - These little boards can be bought very reasonably from several sources and they simplify the audio amplifier circuit that was originally implemented with a LM386 op amp. It can be seen mounted upside down on the left of the protoboard in the picture below. Mounting this way lines up the polarity of power and ground correctly.
- Larger protoboard that simplifies wiring and interconnect with original PCB - Using a larger protoboard that spans the dip sockets required for all the I/O and provides room for the processor and amplifier.
This video demonstrates how these revised pieces operate.
- Rotary encoders to select dice count and dice type - These encoders utilize the original faceplate holes that mounted the original mutli-way rotary switches. Therefore there are no modifications to the faceplate required. I can just clean off the original faceplate graphics with some acetone, apply new graphics (printed water slide or embossed labels), and install the encoders, button, led, and power/volume pot. The only modification to the case required is drilling holes to mount the speaker.
-
Sear Silvertone Digital Dice Towers with LED Display
07/24/2022 at 06:36 • 0 commentsI built a couple more Digital Dice Towers based on the 1960's and 1970's Sears Silvertone radios. These add a 3 digit 7 segment LED display so the user can see the dice count, selection, and roll result. The software for these is based on the original audio only Sears Silvertone piece. But, this version adds support for the 10 outputs and logic to drive the display. These are battery powered as well and use the same power management mode the audio only version introduced.
Internally these look very similar to the original audio only version.
This video demonstrates their operation.
-
Another Digital Dice Tower for a vision impaired gamer
07/24/2022 at 06:29 • 0 commentsHere's yet another audible dice tower I built by request for a vision impaired gamer. This one is built using the case and original speaker for a Heathkit HD-16 code oscillator. The HD-16 was available as a kit in the late 60's and early seventies. It was used by HAM radio operators to practice morse code.
This one includes some new features like rotary encoder knobs to select dice count and dice type, exploding dice, and Dungeon Master mode. See the video below to see how it works.
-
Admiral Digital Dice Tower for the vision impaired
07/24/2022 at 06:25 • 0 commentsI built another audible digital dice tower in an old Admiral tabletop AM radio case. This one has no display like the previous piece and utilizes the same hardware and software. I really like the simplicity of the towers without the display.
-
Audible Digital Dice Tower finds a new audience
07/24/2022 at 06:18 • 0 commentsRecently I posted video of one of my Digital Dice Towers to a group of fellow tabletop RPG gamers on another social media site. Someone replied to the posting, "My blind wife would love this. A real shame they don't make anything like this more compact."
I had already thought of building a voice only version without the display. I was impressed with the quality of the voice that my Heathkit dice tower produced. But, I hadn't considered how much someone who is visually impaired would really appreciate something that generates randomized dice results and reports the results audibly. I was immediately inspired and committed to building an audible dice tower for a fellow D&D'er.
So, I re-thought the requirements of the original digital dice towers and came up with this list.
- Visual display not required
- Must provide audible output of the "dice roll" results
- The interface should be simple to use with decent tactile and possibly audible feedback
- The device should be battery powered. Plug in cords are cumbersome
- The case should be easy to transport or hold and shouldn't have sharp edges or corners common with sheet metal enclosures
- Could be handheld or tabletop depending on user preference
- Tabletop model should minimize footprint
- Handheld model should be easy to hold in one hand and operate with the other
- It must be cool. If you play D&D or other tabletop RPG's, you'll know that everyone loves to have their own unique dice. There's a number of companies and individuals making all kinds of colorful dice. The options are colorful, unique, elegant, classic, brilliant, shiny, and/or sparkly. This should be no different
This documents my first effort to make an audible only dice tower. For this one, I decided on a tabletop design. For cool factor, it "recycles" the case and speaker from a 60's-70's Sears Silvertone radio.
It re-uses a simple interface I built in a previous project not documented here on Hackaday. A single 5 way "joystick like" switch is used for all input. Pushing left-right on the stick will select the dice type. Pushing forward-back on the stick will select the dice count. And, pressing straight down on the stick will roll the dice and report the result.
The first step is disassembling the original radio.
Here's everything inside the case. The radio, antenna, and transformer must go. I'll be keeping the speaker and original potentiometer with on/off switch.
Making more room for the new stuff.
Removed the rest of the parts, speaker grill, and lower faceplate. Painted the front panel with some silver spray paint, painted the radio dial sight glass solid blue with a silver glitter (accidental over spray, left it because it looked cool), reassembled it all. Note: In this picture you can also see the five way switch that will implement the user interface for selecting dice type, dice count, and rolling.
Close up of the 5 way switch before it was soldered to the protoboard.
5 way switchd mounted to the radio front panel where the tuning knob used to be. I used some hot glue and nylon cable clip to keep it in place.
Installed an electric guitar style 9v battery holder in the base of the case.
Controller board with ATmega328, voltage regulator (to run off 9v battery), audio filter, small class D audio amp, ISP connector for programming, and connector for 5 way switch all soldered up in a tight little package.
Everything installed in the case ready for re-assembly.
Lastly, the software updates were pretty simple. Since this is piece is battery operated, the software was updated to enable power saving mode on the processor. The inputs from the 5 way switch are configured as interrupts that awake the processor on state change. The software implements the user input (increase/decrease dice count, change dice type, or roll) and goes back to sleep. This extends battery life.
-
It speaks to me!
07/24/2022 at 05:39 • 0 commentsFor the second iteration of the Digital Dice Tower, I decided to add some sound. At first, I was simply going to add some beeps and boops to make the die rolling a little more interesting. But, then I decided to take it to the next level with sampled PCM sound of dice rolling in one my "analog" dice towers. Once I got that working, I decided to challenge myself to make it talk. After all, how hard could that be?
Before I could worry about making sounds, I needed to build the next piece. Again, I decided to "recycle" a Bell & Howell IMD-202-2 Multi-meter.
Gut it and Prep it...
Step 1, open the case.
Remove the switches and PCB. Note: I notched the PCB to make room for the speaker, button, LED daughter board.
Install a rocker switch in the rear of the case for power on/off.
Wire up the transformer to the new power rocker switch.
We Have Assumed Control...
The next step is to build the controller board and interface it with the original PCB with power supply, 7441 decoders/drivers, and nixie tubes.
I started with the interface to the PCB. I wired up the a small piece of protoboard with four 7 pin single row headers and a 10 pin dual row header. The single row headers line up with the 7490 decode counter sockets in the original PCB. To make that work, I pressed the single row headers into the sockets and then put the protoboard onto the headers. I soldered the headers to the protoboard there in place. This ensured they line up perfectly. Then I wired up the Vcc, Gnd, Output A, Output B, Output C, and Output D to the 10 pin connector.
For more details and schematics regarding the original PCB, checkout these logs from the original project: Let there be light... and Getting Started...
The protoboard that interfaces to the original PCB looked like this when I was done.
Next, I wired up the controller board. It contains the ATmeg328 microcontroller and connectors to the original PCB, thumbwheel switch, rotary switch, LED/push button/speaker daughter board, and ISP programming/debug port. I am using the integrated oscillator so once again the controller board is just the controller, wires, and connectors.
Note: If you look closely, you can see where I cut traces on the protoboard so I could used the dual row connectors. I've seen some breadboard style protoboards lately that have the traces on both sides under a solder mask. Don't buy those. I really like these Adafruit protoboards because they use thin traces that are easy to cut and the holes are plated through.
Lastly, I selected a location on the original PCB to mount the controller board. I picked a spot on the right side of the board behind the switched where I could drill without cutting existing traces.
Installed the standoffs.
And, installed the controller board.
Mod the Case...
Now that I had the control board built and connected to the original PCB, I needed to modify the case so the new switches can be installed. As mentioned before, I tried to simplify the modifications to the front faceplate this time. Instead of cutting a larger hole in the original faceplate and riveting a new faceplate over it, I decided to modify the original faceplate to install square thumbwheel switch and use existing holes in the faceplate for the rotary switch, LED, push-button, and speaker hole.
The first task was cleaning the old graphics off the original faceplate. I used some 100% acetone and rag to do that.
Then I drew up a template for the 22.5 mm x 22.5 mm square hole required for the 2 Digit Omron A7BS BCD encoded thumbwheel switch and end caps. I used Inkscape to draw it to scale and printed it.
I then taped this paper template to the front faceplate of the case and secured it to a scrap piece of 2x4. I was generous with the template and painters tape used to secure it. This provides a protective barrier the prevents scratches on the faceplate while drilling, filing, cutting, etc.. Once secured in the vise, I punched the center point of the marked drill holes in the template.
Next I drilled the holes and used a square file to start squaring off the corners marked by the template. I had to be a little careful to keep everything inside the lines of the template. The aluminum sheet metal files very easily.
Once three of the four holes were squared to the corners of the template square, I used a jigsaw to cut out each side of the square. The filed holes were just large enough to fit the jigsaw blade flush to each side of the square. Again, I had to be very careful to cut slowly following the template line and not cutting past the perpendicular line of the next side.
With the cuts complete and the remaining bit of metal removed, I used a larger metal file to clean up the square a little. I then test fitted the thumbwheel switch and filed a little more until it slid in snugly. My template was intentionally about .2 mm too small so I wouldn't end up with a hole too large. I knew filing the last .1 - .2 mm would be more precise than cutting. It was easy to file and took just a couple minutes to get it just right.
Once I was satisfied with the fit, I pulled off the tape and template paper.
And, the fit for the switch looked like this. BTW, don't press the switch into place just yet. Once it snaps into place it's difficult to remove. I still needed to configure and solder the cable to the switch.
The rest of the holes will be used as is. In the pics above, you can see that I also test fitted the panel mount LED holder as well.
User Interface Circa 1978
The next step was to configure/build the new user interface switches, button, and speaker and wire those to the controller board.
The two digit Omron Thumbwheel is configurable. It comes with pins that you install. This pins act as stops preventing the user from selecting a range of numbers. This is useful because I could reduce the range of selectable dice counts down to something realistic and reduce the number input pins required on the microcontroller. So, I installed the stops making the selectable tens digit range 0-3. This makes the user selectable range for the number of dice 0-39 and reduces the pins required for the dice count input from 8 to 6.
The pins that came with the switch are rather small and difficult to handle with my fingers. But, they are made of a ferrous metal. I discovered that I could used the magnetic end of my scribe tool to hold the pins and install them.
With those in place, the two digits snap together and the end caps snap onto each side of those.
After the thumbwheel was all configured, it was a simple matter of soldering a 10 pin cable to the 4 BCD traces of the ones digit, the common on the ones digit, the 2 low order BCD traces of the tens digit, and the common on the tens digit.
The rotary switch required a little more effort to wire up. Just like the previous version of the dice tower, I used a simple single pole 8 way rotary switch. However, I wanted to minimize the cable conductors and controller input pins required. So, I wired up a 74HC148 8 line to 3 line priority encoder on a small proto-board.
I then wired the board to the common and 8 selector lugs and used a couple stand-offs to connect it to the back of the switch.
Lastly, I cut another small piece of proto-board and soldered up a connector, LED, push button, and speaker to it so they lined up with the holes in the case.
It looks like this installed.
It Speaks!
With all that done, how do I get sound out of a ATmega328? The short answer is you use the PWM peripheral to output a signal (wave) that drives a speaker. In fact, the outputs on the AVRs are stout enough to drive a tiny speaker directly. I think Sparkfun and/or Adafruit sell the little speakers. The sound is a little quiet, but it's pretty good. In this latest build of the dice tower, I added a simple LM386 op amp circuit to drive a slightly bigger 8 ohm speaker for better sound. I also inserted a simple RC low band pass filter circuit between the timer compare output pin on the AVR and the op amp. I used a .01 uf capacitor with a 200 ohm resistor to filter out frequencies roughly above 8 kHz.
There's lot more details to reproducing sound involved here. But, I'm not going to try an explain all of that. I assume there are several sources on the inter-webs and text books that explain pulse code modulation or why I added a low band pass filter much better than I can.
I wrote a simple AVR PWM "driver" that sets up the ATmega's Timer/Counter 2 in fast PWM mode, sets the period to 7812 Hz at the 8 mHz internal oscillator clock rate, and loads 8 bit pulse code modulated (PCM) data from the program space (flash) into the comparator each cycle.
At this point, I had a dice tower that could play PCM sound data. I sampled the sound of dice tumbling down one of my "analog" dice towers and set it up to play when the pushes the roll button.
So how do I make it talk?
This isn't a full speech to text implementation. It can only speak the numbers 1 through 999 and pronounce "Dee" as in the letter "D" or "roll six D six for damage on that fireball." But, that's still pretty good for a little 8 bit microcontroller with just 32K of Flash, 2 K of RAM, and a simple built-in PWM peripheral. For perspective, that 32K of Flash will store just 4 seconds of 8 bit PCM encoded mono sound sampled at ~8 kHz. Try to count from 1 to 999 out loud in less then 4 seconds and make it easy to understand. It ain't gonna happen.
So, I figured I could just sample the unique words that are used to say the numbers one to nine hundred and ninety nine. I started by snagging an older version of the Microsoft text to speech demonstration application TTSApp. I liked the dated quality of the speech generated by the app and it was very easy to generate wave source files of the words I wanted. I could even control how fast the words were spoken. I generated .wav files for all the words that represent the numbers 1 to 20 and Thirty, Forty, ..., and Ninety. I then used the Audacity application on my little Linux notebook to max out the sound levels on the samples.
Next, I needed to get those .wav files into the ATmega328's flash memory. The easiest way to do that with the minimum amount of additional program memory overhead is to convert the data the sound files represent into C arrays and link that code with my application. There are likely some existing programs out there to do that, but I decided to write one myself. I figured there was a good chance I might want to do some additional processing on the data.
I wrote a simple Linux command line application in C to convert the .wav files into text files that represent the data as C arrays of type uint8_t. To save the headache of trying to figure out how to decode a .wav file and add some additional features like converting mpeg and other sound/video files and changing the sample rate from any source sample rate to a user provided rate, I piped the output from the FFMPEG application into my app and output the text file with all the C required stuff. Now my source file could be just about any type of media file and I could convert it to mono 8 bit PCM data at any sample rate I chose and my little command line app would spit out some statistics like the total size of the data.
I used the new app to build a single .h file with the C arrays from the .wav files I mentioned above. Once it completed, it reported that the total length of the sampled sound was over 8 seconds and the memory required to store it would be more than 64K. At that point, I just about gave up on the whole speech idea. But, I decided to see what I could do with a little compression on the data.
First, I added simple run length encoding. This lossless form of compression simply substitutes a reserved value followed by a count whenever it comes across more than one instance of the same value sequentially in the source data. So, if the source .wav file had the value 0x80 ten times in row it would replace that with two bytes. The first byte would be the reserved token 0x00 and the second byte would be 0x0a (the value ten). In this manner, 10 bytes in the source data is stored as 2 bytes. 8 bit PCM sound data represents a wave form. Values greater than 0x80 represent a "positive" pulse and values less that 0x80 represent a negative pulse. If all is quiet in the original source data, the value 0x80 is repeated at the sample rate. Looking at the source data for the sound samples I could see this 0x80 value repeated from time to time. Very few other values seemed to be repeated more than twice. I decided that I would reserve the token 0x00 followed by another byte representing 0-255 bytes of repeating values 0x80. I coded this up and re-ran my little command line application. I got about 20% - 30% compression on my original sources.
This wasn't enough but it was a pretty good start. I looked at the raw source data again and saw that sound waves didn't instantly return 0x80 as the source data got quieter. It tended to bounce around the value 0x80 plus or minus a small number. These low energy pulses would barely be audible and might not even move the diaphragm on my cheap little speaker. So, I changed the app again. Now I could provide a value that would be used as a +/- deadband around the value 0x80. I rebuilt the .h file from the original .wav sources using a deadband value of +/- 5. This gave even better compression. I then modified my AVR application to recognize this new token and expand it appropriately as it loaded bytes into the counter comparator for the PWM. I played one of the sampled words and it sounded great. I then tried to link all the words/numbers. Unfortunately, my data was still just a little too big.
So, I rebuilt the .h file one more time using a deadband value of +/- 7. This just barely fit when I linked all the numbers and the sound for "D". I had like 100-200 bytes to spare. But how would it sound? Well, scroll to the bottom of this log post and hear for yourself.
The rest was just a matter of selecting and playing the sound samples sequentially to represent the numbers selected by the user and resulted from the pseudo-random number generator.
And it works...
-
Dungeon Delvers Digital Dice Tower v1.0
07/24/2022 at 00:52 • 0 commentsThis piece "recycles" a Bell & Howell IMD-202-2 Multi-meter. These devices were part of the DeVry University electronics curriculum back in the mid-70's. If I understand it correctly, this multi-meter was a project that students built. The design is based on a Heathkit IM-1212 multi-meter. Bell & Howell apparently acquired the rights to recreate that design in a different form factor and enclosure. These multi-meters were produced in fairly large numbers. You might have one in your attic right now. Or, you can easily find functional examples on eBay. If you have a little patience, you can even buy them cheap. By cheap, I mean cheap for a project case, a couple nixie tubes, a couple 7441's to drive them, and power supply that provides the 170 volts for the tubes and the 5 volts for your custom electronics/micro-controller.
I selected a ATtiny88 AVR microcontroller for this piece. This controller is highly integrated with flash, SRAM, reset logic, integrated oscillator, etc.. I feel like I'm cheating when I use these parts. My controller board is just a 28 pin DIP socket, some wires, and 4 connectors. There is no RC circuit for the power on reset, no crystal and caps, no external bus logic, no external pull up resistors. These AVR controllers also simplify integrating with original 7400 series logic ICs. There are some limitations like the original 74xx and 74LSxx outputs can't reliably drive an AVR input logic level. But, that's not a problem for this application.
The hand built controller board with the processor is integrated with the original PCB and power supply in the Bell & Howell Multi-meter. To simplify integration, I simply removed the two DIP socketed 14 pin 74490 decade counters that are directly connected to the 7441 nixie decoder/drivers and plugged my custom board in there using a couple in-line headers.
The sockets provide +5V, GND, and the two 4 bit BCD interfaces needed to power the controller board and drive the display.
The rest was just a matter of removing the old switches and banana plugs, riveting in a new face plate, installing new switches, connecting them to the controller board, writing some simple code, and applying new graphics. In this case, I used a 8-way rotary switch for the dice type select, a two digit thumbwheel switch to select the number of dice to be rolled, and a square panel mount push button to roll the dice. Software was developed from scratch using the freely available Atmel Studio 7.0 IDE and toolchain. And, the new graphics were printed on water slide decal paper and transferred to the new face plate.
The resulting piece looks and works like this.