The Circuit

Circuit Description
Powered by a 9V battery, this is an electronic version of the simple “Heads or Tails” coin toss. When you press the Spin Button, the Heads and Tails LEDs begin to alternately flash very quickly. The flashing slows and finally stops with only one of the LEDs illuminated. Which LED is lit is determined by chance (or at least as close to chance as a simple circuit can provide.)
How it works
Pressing the Spin Button (S1) causes: capacitor C3 to charge very quickly through the R3-R4 voltage divider; and, transistor Q1 to turn on connecting the 555’s timing network (R1, R2, and C2) to power. The 555 now begins astable operation providing clock pulses to the 4013’s two D-Latches.
Releasing the Spin Button (S1) disconnects capacitor C3 from power allowing it to begin discharging through transistor Q1 and the 555’s timing network. As C3’s charge and Q1’s base voltage decreases, transistor Q1’s collector-emitter resistance increases and it slowly turns off causing the 555’s output to decrease in frequency. Eventually the charge on C3 is sufficiently low that Q1 turns fully off causing the 555’s astable operation to cease providing clock pulses to the 4013.
D-Latch A of the 4013 is wired in toggle mode (Q’ tied to its D input) so that its output will turn on and off with each successive clock pulse. The D input of D-Latch B is tied to the Q output of D-Latch A so that it will follow Latch A’s output one clock pulse later.
The output of each D-Latch drives the base of an output transistor (Q2 and Q3) through biasing resistors (R6 and R7). These transistors allow the LEDs to be sourced from the full 9V battery voltage rather than from the CMOS IC output directly. This provides maximum LED illumination.
The PCB
Our final board size is 2.2” x 1.7”.
Silk

Top

Bottom (mirrored)

Parts List

The ZIP File
The available heads or tails ZIP file contains the following documents:
* Heads or tails.pdf – this document
* Heads or tails.part sch.jpg – circuit schematic
* Heads or tails.brd.silk.jpg – PCB silk layer
* Heads or tails.brd.top.jpg – PCB top copper
* Heads or tails.brd.bot.jpg – PCB bottom copper
Also included in the ZIP file are original EAGLE files:
* Heads or tails.sch – schematic
* Heads or tails.brd – PCB layout
* Heads or tails parts.txt.pdf – parts list





