Electronic counter
Electronic Dice
555-Timer
Specification
Dice are used in a variety of ways. Mainly for board games. For this reason the dice needs to replicate a standard 6-sided dice and it needs to count up to 6.
The system I am aiming to create has to be able to be run off a small voltage battery. (I.e. a 9v battery.) It must be easy to use and be cheap to build. It has to be, made up of sub-systems that include a clock input, random number generator and some kind of illumination or illustration of the number by possibly 6 LED’s or a seven segment display. It has to be a fairly simple circuit to understand and I have to build separate subsystems that work independently then link them together to create this electronic dice.
Generation of possible solutions
I have realised that there at least 2 ways I could build this circuit. I could use logic gates and produce an output using LED’s or I could display the result using a 7-segment display.
There are other options for inputs including the binary counters and a BCD to 7-segment display decoder to give the outcome in a 7-segment display. If I start by build the circuit on the breadboards then put it on the ‘weggie box’ using a clock input from the box then put the 555-timer circuit in.
I am going to chose the option of building the circuit with the 7-segment display in it because it is harder to build. Here is a rough outline of the circuit.
I have included a D-type flip-flop circuit (that we used in our lesson) in it to act as the binary counter. (The D-type flip-flops on this program are missing the reset port but this will be used on the final design.)
I am then going to advance this using the 555 timer input and logic gate reset (explained in next section.)
Sub-system development
I am going to start with the input. I found this circuit in my GCSE coursework so I am going to use this to create a clock input. It uses the resistors and capacitors to create the timing of the chip. If you change the value of the resistors then you can change the time output. TC = R x C
In this case R= 1500 ohms and C = 10 micro farads so
TC = (1.5 x 10^3) x (10 x 10^-6)
TC = 1.5 x 10^-2 secs.
I can see this is very fast (faster than the naked eye could see so if I increase that values until I get a value of around 0.1secs (flashing 10 times a second.)
So if TC = 0.1
And we keep the capacitance the same then 0.1 = R x (10 x 10^-6)
So R = 10 x 10^-6
0.1
Now R=10 x 10^-4
This is far too small so the capacitance needs to be changed not the resistance. So 0.1= (1.5 x 10^3) x C
C = 15000 micro farads
This is too high. I can now see both need to be changed. I think that if I change capacitance to 100 microfarads then I get the resistance it may be better.
Now TC still = 0.1
C= 100
R=?
R= TC
C
R= 100
0.1
R= 1K ohm
This is better. I am now going to change the values in the circuit and it now looks like this
The output will be taken off pin 3 and taken to the circuit rather than through an LED to 0v.
Next is the D-type flip-flop circuit. It is made up of 3 D-types creating a binary output. The binary out put works like this. The output from D-type output 1 is ‘1’. The output from D-type 2 is ‘2’ and the output from D-type 3 is ‘4’. These can make any numbers up to ‘7’. It works in binary like this. For example ‘6’ is made from pin 2 and pin 4 being on. (I.e. 2+4 = 6) This is shown in the table on the next page
Here is the D-type flip-flop part of the circuit
The LED’s are used here to show the outputs these outputs will be put into pins A, B and C of the BCD to 7 segment decoder.
Key
Op = output
On = gives a signal out
Number = number displayed on 7 segment display
Now we have a signal I need to put it into something. I have 2 possible options. I could use LED’s or I could use a BCD to 7 segment decoder and use a 7 segment display. This is what I have chosen to do. Here is the 7 segment part of the circuit being copied from the illumination part of the 0-9 counter.
Now if I connect this to the D-type flip-flop circuit I get this. I tested it on crocodile clips and it works. It counts from 0-7 which is better than counting from 0-9. I stooped it counting from 0-9 by not connecting an input to pin D.
The resistor in the top of the circuit is not connected to anything because I don’t want the dot in the corner to show. As you can see in the circuit below it is the same as the circuit with some logic gates in it. These are AND gates with this truth table
Here is an AND gate
So ‘Q’ is only ‘high’ when A and B are ‘high’. So if I connect 2 of these in the circuit, 1 connected to pin outs 1 and 2 the other to 1 and 3 then when 1 and 2, and 1 and 3 are ‘high’ then they both produce outputs. If I put these outputs into a third AND gate then when both are ‘high’ (which they will be to make seven) then the 3rd AND gate is ‘high’. I will then connect this to the relay pins of the D-types and this will reset them. This is done to produce numbers 0-6 because 7 then automatically resets to 0.
This is the circuit diagram for the AND gate reset circuit and the truth table for it.
Truth Table
Circuit
As you can see the circuit behaves like a 4 input AND gate would.
So I connect this up and connect the ‘Q’ output into the resets of the D-type. I then put on the 555 timer circuit to create the clock impulse and here is my final circuit. With a battery to power it, an on off switch and a PTM (push-to-make) switch to stop the pulse and display a number.
System Details
I am now going to explain how the circuit works and why each sub-system is there.
The battery is there to add power to all of the circuit. And the switch is to turn it on with the LED there to act as a power light to show its on with a protective resistor to reduce the voltage flowing over it. The 555 timer circuit is the to act as the pulse input with the output pin connected to the clock input pin of the D-type flip-flop.
The D-types are there to act as a binary counter. They connect to the binary inputs A, B and C on the BCD 7 segment decoder chip (but not pin D, to stop getting numbers 8 or above.) There is no resets shown on the diagram but these will be connected together then joined to 0v and the AND gate circuit output pin ‘Q’.
The AND gates are in the circuit to act as resets. They are connected to pins 1 and 2, and 1 and 3. So when pins 1, 2 and 3 are all high it creates an output signal to the resets of the D-types stopping a seven being displayed.
The BCD decoder is there because I need to decode the binary to be able to use a seven segment display. The outputs are connected to the seven segment display through protective resistors to stop the voltage onto the display being to high.