Home > GCSE Projects > Double Die

Modified: 17:44, 15 December 2018

Circuit and PCB designed by Phil Townshend, c 2002

A 2 digit electronic dice with sound!

Shake to roll some numbers from 1 to 6. Sound is provided using a PCB mounted buzzer.

The displays used were Kingbright 1inch (25.4mm) common cathode 7-segment hi-brightness types. The switch was a vibration switch that reacted to movement.

The case is made from two types of material. The cover was vacuum formed using 2mm yellow polystyrene and small detail added with enamel paints - the ones used for model planes etc.

The circuit board shown below is an updated version of the original.

The original version used a PIC microcontroller 16F84 which required a crystal or 4MHz resonator. This can be seen in the photo below. Fortunately with the developement of PIC's they are available with internal clock generators. A new version of the PCB has been made which uses a PIC16F627 set to run at 4Mhz

HEX code download at bottom of the page.

This circuit should run on 4.5 to 6 volts, AAA's are adequate.

It has functioned on a 9volt PP3 battery but I strongly recommend AGAINST this! Chip destruction is likely.


The entire function of the circuit is controlled by IC1, the PIC IC, which has a program inside. When SW1 is pressed, the program produces rapidly changing numbers whcih gradually slow down to a final 2 numbers on display 1 and 2. These random numbers are generated by having a counter running very fast, at about 1MHz. Since it is impossible to predict, or accurately repeat a certain number due to the speed of the counter, it is effectively random. When SW1 is released, an 8-bit value generates two values from 1 to 6.

The circuit uses a method called "multiplexing", to drive both displays. Only one display is on at any one time, with each cathode being driven alternately by pins 1 and 2 of IC1. The current is amplified by the NPN transistors T1 and T2.

Sound is produced by pulsing the PCB-mounted buzzer, BZ1, on and off rapidly. The speed of pulsing will determine the pitch of the sound.


For better resolution and image quality, download pdf of circuit at bottom of page
Rapid part no:
R1 4K7
R2 omitted
R3-10 100ohms
R11 1K
R12 1K
C1 220uF Elec.
C2 220uF
IC1 PIC16F627/818
T1,2 2N3704
D1 1N4001
Buzzer PCB 6 volt
35 - 0030
SW1 Vibration switch
SW2 SPST toggle switch
Display 1,2 Common Cathode 25mm
57 - 0207
18 pin IC holder
PP3 battery clip

Requires a PIC programmer and software to program IC

PCB and circuit details version 2 - (pdf format)

HEX File for PIC16F627

A view inside the case - note the 9 volt battery-


The battery was fairly flat.

Best option is to use 6 x AAA batteries in a 4-cell squarebattery holder.

The base was shaped from 3mm yellow acrylic and bent in a "U" shape using a strip heated and a wooden former to ensure an accurate size.

The red lenses over the displays were just 3mm acrylic sheet glued to the inside of the case. They hide the segments that are not lit.

You can use a different display as long as the pins line up the same, otherwise you will need to use connecting wires. The pin connections can be found on our Reference page.

Back to GCSE Projects page...

www.edutek.ltd.uk - Working Electronics For Students & Teachers