Mystery footprints and random logic
Guess the electronic component based on its footprint and learn what makes the Space Dice tick
Pop quiz, hotshot:
Which electronic component leaves this footprint on its PCB?

Answer after this short commercial educational break...
Space Dice Determinism

The Oskitone Space Dice is an electronic dice machine that generates random values between one and six ("1D6" in D&D parlance) and makes space laser noises. Of course.
Its functionality isn't accomplished with a pre-programmed microcontroller like you'd expect. Instead, it uses individual microchips designed for single low-level functions, and these chips' functions combine to perform more complex tasks.
It's like programming with bare metal instead of code!

The Space Dice has three of these chips. Here's how they work together:
- Its CD4093 is a group of four NAND logic gates. A logic gate performs logic: give input, get output. The 4093 is special because its gates can be made to oscillate up-and-down-and-back-and-forth by connecting an output back into its input. (With some other stuff too, but that's the gist of it.) The result is a square wave, and that lil button you see on the PCB's right side starts it.
- The square wave is fed into a CD4040, typically used for counting in binary. Pulse the 4040's input and its twelve outputs present the tally count as bits. In practical terms, give it a fast wave to get back a dozen successively slower waves. A machine that does this is called a "prescaler."
- So a fast oscillator drives a prescaler and makes slower oscillators, and one of these oscillators goes to the input of a CD4017. The 4017 is also a counter like the binary 4040, except it outputs only in decimal: one of its output pins will be "high" and the rest will be "low". They connect to LEDs as the six sides of standard dice. When the seventh 4017 output is high, it's set to reset and cycle back to the first LED again.
- Faster 4040 output bits connect to the remaining three 4093 NAND gates to crudely amplify their signal to drive a speaker for audio. Additional oscillator RC network trickery creates the frequency drop characteristic of laser sounds.
Cool? So what?
Logic gates are deterministic. Their decision making process will always produce the same result for a given input. "Not true is false. False and true is false. False or not false is true." Et cetera.
So how can a deterministic machine make a random number, something that's inherently non-deterministic?
The answer is the fleshy human controlling it.
Because the oscillator from step one is fast enough for its individual pulses to be indiscernible and its length will be arbitrary based on how long its button is held, the resultant count of its pulses sure seems random enough for most people's purposes. Electronic dice kits have been around for decades, and they almost all work this same way.
To further explore the phenomenon and build an Open-Source 3D-printed random number generator of your own, please purchase an Oskitone Space Dice DIY Electronics Kit or explore its assembly guide that I spent a very long time writing with my fleshy human brain.
Makes a fine gift for any number nerd or tabletop gamer. Complementary zine and other ephemera yours free with purchase while supplies last.
Back to our footprint mystery and what I've been hacking on
What kind of component makes a footprint like this?

It was a trick question. Sorry!
It's actually two components stacked together. The inner square and its four corner pins are from the 6x6 tactile switch used in all Oskitone kits. The outer square and its bigger holes are from a Cherry keyboard switch, the same kind used in fancy mechanical keyboards.
In OpenSCAD, back and forth:

IRL, side by side:

The idea is that with one footprint I can easily swap between two very different types of switches on the same PCB, allowing me to see which I like more IRL and on-device without doubling my PCB order.
KiCad didn't immediately love it but OSH Park fabbed it just fine. And it worked as expected too!
Yours forever in the existential crisis of the AI era,
Tommy from Oskitone
P.S. Email me back to guess what that is ^^^