u/BijectiveInjector

Image 1 —
Image 2 —
Image 3 —
Image 4 —
Image 5 —
Image 6 —
Image 7 —
Image 8 —
Image 9 —
Image 10 —
Image 11 —
Image 12 —
▲ 5 r/PrintedCircuitBoard+1 crossposts

Hello everyone,

In order to learn a bit about digital electronics I worked on a dice roller using discrete components.

The circuit consists of an astable multivibrator as a clock, the output is fed into an emitter follower to drive the digital circuit, the clock is currently set to be ~1kHz.

The clock signal is fed into a Johnson counter, 3 D-Flip-Flops(a clearer logic circuit of the D-Flip-Flop is in one of the attached images) connected in series, with the input being the output of the previous one, except for the first one, which gets the complement of the output of the last one as the input. This cycles through 6 states (000->100->110->111->011->001->000(repeat)). I've also added a failsafe which checks if the circuit falls into a loop of illegal states(101<->010) pulling the input of the first Flip-Flop high to force the transition 101->110 back to a legal state.

To display the output I am simply using 7 LEDs arranged like the eyes on a regular die.

Here some of the LEDs are coupled together, since they light up at the same time.

A = Center B = Top Left and Bottom Right C = Bottom Left and Top Right D = Middle Left and Middle Right

To map the states of the counter to a number I am using some additional logic:

A = Q0 B = ~(Q0 and Q1 and Q2) C = ~Q1 D = ~(Q0 or Q1 or Q2)

# A B C D Q0 Q1 Q2
6 0 1 1 1 0 0 0
5 1 1 1 0 1 0 0
3 1 1 0 0 1 1 0
1 1 0 0 0 1 1 1
2 0 1 0 0 0 1 1
4 0 1 1 0 0 0 1

To "roll" the die a button is pressed, which charges an RC-Circuit driving a transistor which pulls the gate of the clock output transistor low, this stops the clock signal from reaching the counter until the RC-Circuit is discharged at which point normal operation would continue.

For power im using a USB-C connector and I also added two exposed pads for GND and +5V which I can solder wires to, should I want to change the power source.

u/BijectiveInjector — 17 days ago