I keep a stash of exciting hardware, and wait, like an insect waits, for opportunities to put parts into play. This stash includes a couple of these gnarly 7-segment displays
And speaking of play, gaming is and has been a muse for some time, and board-games have been especially exciting as of late. One of the games I’ve been playing is called Cave-Evil, and it is truly wicked.
A four-sided Dice is a critical element, determining whether your mining efforts have uncovered 1) Gore 2) Metals 3) ShadowFlame or 4) Chaos.
So! When, browsing the web and looking for compelling inspiration, I stumbled across an accelerometer-based seven-segment dice and I saw an opportunity to create a different, potentially more accessible, version. My task is clear.
Main Components Needed to get this off the ground :
- 1 – 12″ Seven-Segment Display
- 7 – TIP31AG 40W Transistors
- Assorted Resistors
- 1 – 74HC595 8Bit Shift Register
- 1 ProtoBoard
- 1 Radioshack PCB
- 1 – 16 Pin IC Socket
- Arduino Uno
The basic jist –
This is pretty Straightforward. Here is a good primer on Shift Registers, 7-Segment Displays, and the Arduino. and Here is Pretty Solid Youtube Video. Here’s a third guide.
Arduino sends a set of 8Bits to the Shift Register. The shift register sets its output pins to HIGH or LOW according to the set of bits in the register. The “latch” on the shift register is then closed, and those 8 Pins remain in their respective states. Then you open up the latch and send it a set of new bits.
The added complexity with the transistors stems from the relatively high-voltage demanded by the large seven-segment display. It gets plugged into and demands something around the order of 36Volts @ 0.7A. Transistors just work as switches, taking the relatively low power generated by a HIGH Pin out of the shift register and enable the electrons to flow through a completed circuit, which in turn highlights that segment on the display.
The one difficulty I had with this project involved the open-source sets of arrays to control the 74HC595 – even having wired things up carefully, the segments of my display did not correlate to the given (expected) values expressed in code I found online. However, I started tinkering with the following set of values :
// 10-1F: Figure-8 drawing (8-character cycle)
B01000000, B00100000, B00000001, B00000100, // 1-segment
B00001000, B00010000, B00000001, B00000010,
and worked from there.. turns out my segments are labeled in a slightly more orderly fashion ..
// B01000000, // middle segment
// B00100000, // bottom left
// B00010000, // bottom
// B00001000, // bottom right
// B00000100, // top right
// B00000010, // top
// B10000000, // top left
// B01000000, // middle
It’s about being visually loud
I thought a good bit about the remote whoopie-cushion story, and how this afforded someone an opportunity to demonstrate an otherwise-difficult-to-manifest sense of humor. This project is, on its surface, just selecting a number 1-4, but selecting it with the dial turned to 11, IYKWIM.
Another thing of note. Running this from the breadboard was lackluster, because some of the connections were iffy. I could tell it was working and took the leap to a soldered PCB because I knew I could get better and more consistent performance… but this is a drawback if someone was unable to solder…
Whats next – well. firstly, I need to finish up the code that controls a random output, maybe cycling through digits in suspenseful fashion.
but in thinking about super-fun-necromancer-style unconventional switches… the notion of using a Capitative Sensor I’ve got kicking around is quite appealing…