Skip to content
ProjectsDigital & Software Systems / Mechanical & Hardware Design

An electronic dice built from logic gates

Karnaugh map to simulation to a soldered board

Image needed

/images/electronic-dice/hero.webp

The electronic dice PCB under test on a bench, with an oscilloscope probe clipped onto the board and two of the seven display LEDs lit

hero.webp
Measuring the voltage traces against the PSpice simulation.
Context
Digital electronics, journal assignment
Year
2019
Role
PCB design
Team size
2
Tools
PSpice · PCB123 · Karnaugh maps · 74HC logic · Oscilloscope
Contribution
Team of 2, focused on the PCB design and layout

An electronic dice showing 1 to 6 on seven LEDs, designed from a Karnaugh map, simulated in PSpice, laid out in PCB123 and then soldered and measured against the simulation.

The design

The circuit runs a 74HC393 dual 4-bit binary counter into four logic gates, being an OR, a NOR, an AND and a NAND, and the gate expressions came out of a Karnaugh map where we worked out which variables could take both states without affecting the output. This means that one loop reduces to Qb multiplied by Qa and another to Qb multiplied by Qd, since in each case two of the variables turn out not to matter. The display resistors were calculated from 5V and roughly 15 mA per diode, which gives 333.33 ohm, and we used 470 ohm in practice.

Building and measuring it

The board was laid out in PCB123 and then soldered, and during testing the dice would sometimes switch off when it was moved, which turned out to be a bad solder joint rather than a design fault and was quickly corrected. We then measured the voltage traces at Qa, Qb and Qc on an oscilloscope and compared them against the PSpice simulation, where the simulated period times were 20, 35 and 35 microseconds and the measured ones came out at 9, 19 and 29, which is a consistent offset rather than a random one.

What I owned

I focused on the PCB design, which meant taking the gate expressions out of the Karnaugh map and turning them into a board that could actually be etched and soldered. It is important to note that the components on the layout which look like resistors larger than the smallest DIP footprint are not resistors at all and instead represent bridges, since a single layer board cannot cross traces, and this is the constraint that ends up shaping most of the layout decisions on a project like this one. As previously mentioned on the mine clearance vehicle, it was one of those bridges that caused a short circuit there, so it is a constraint I learned to plan around rather than discover afterwards.

The outcome

The dice worked and displayed every number from 1 to 6, and it is worth noting that this is the first project where I designed a circuit on paper, simulated it, laid it out, built it and then measured whether the real thing matched the prediction, which is a sequence I have used in most electronics work since.