Partial Electronic Dice

Thread Starter

Wendy

Joined Mar 24, 2008
23,421
Someone brought up an assignment for electronic dice. I did something similar while I was in college just for the heck of it, it wasn't an assignment. I used TTL gates.

30 years later I was thinking about it after viewing that thread and another way occurred to me. My mind tends to work that way, solving problems where there aren't any.

Anyhow, here is my concept...



All the circuit needs is a VCO oscillator that runs when a button is pressed and slowly slows down to a stop. My original concept wasn't as random as I would have liked, I suspect a link between the power supply, oscillator, and number of LEDs lit.

Since the 4017 doesn't have any drive I kept the LEDs at 3ma. This means an output can have 9ma drive max. Not the best design, but the 4017 can handle up to 16ma.

I didn't post this on the other thread because it was a homework assignment. If the poster finds this thread I will call it research on his part and let him have it. However, this is my thread, just like the other thread is his.
 

Attachments

tom66

Joined May 9, 2009
2,595
It can also be done with logic gates. We were doing this today in Electronics.

You have a binary table from 000 to 101 for the 6 numbers. A binary counter is used to count the numbers. Call the bits A, B, and C, from left to right. I'll use your LED notation.

Rich (BB code):
 Roll No.      LEDs
A  B  C  #  1  2  3  4
0  0  0  1  1  0  0  0
0  0  1  2  0  1  0  0
0  1  0  3  1  1  0  0
0  1  1  4  0  1  1  0
1  0  0  5  1  1  1  0
1  0  1  6  0  1  1  1
It can be seen that LED 1 is simply the inverse of C: not C

LED 2 is the logical OR of all bits: A + B + C

LED 3 is the OR of B and C with A: A + (B . C)

LED 4 is the AND of A and C: A . C

The reset pulse for the counter can be generated using the AND of A and B. This all can be done with NAND logic.

So the final equations become

LED1 = C NAND C
LED2 = (((A NAND A) NAND (B NAND B)) NAND ((A NAND A) NAND (B NAND B))) NAND (C NAND C) which can probably be simplified.
LED3 = (((B NAND C) NAND (B NAND C)) NAND ((B NAND C) NAND (B NAND C))) NAND (A NAND A) - again, this can probably be simplifed
LED4 = (A NAND C) NAND (A NAND C)
reset = (A NAND B) NAND (A NAND B)

Although it's probably easier to use the two counters :).
 
Last edited:

Thread Starter

Wendy

Joined Mar 24, 2008
23,421
That is why I do it that way. The diodes are actually OR gates, but passive.

The other thing is you are starting from a different premise, that of ripple counter vs. Johnson counter. It is an apples and oranges type of problem.

I used a ripple counter with real gates on the first one though, so it isn't too far off base. Again, this wasn't an assignment, I was interested in a real finished project. Built it too.

CR1 can be eliminated, and I could use 6 common collector drivers per die to up the current to the LEDs to something more user friendly.
 

tom66

Joined May 9, 2009
2,595
That is why I do it that way. The diodes are actually OR gates, but passive.
Yep. If you were clever, for some of the diodes you could use the LED themselves.

The other thing is you are starting from a different premise, that of ripple counter vs. Johnson counter. It is an apples and oranges type of problem.
Doesn't really matter what the counter is, the die circuit might as well be a black box with an input, function and output.

I used a ripple counter with real gates on the first one though, so it isn't too far off base. Again, this wasn't an assignment, I was interested in a real finished project. Built it too.
This was a very popular Electronics project for GCSE. It was suggested to use a microcontroller.

CR1 can be eliminated, and I could use 6 common collector drivers per die to up the current to the LEDs to something more user friendly.
Red LEDs are only 2V, so you could exceed the limits of the 4017 - the current rating is only the point at which it can maintain an adequate logic output, and anything >3V should be fine. Most can source 15-20mA per output if you don't care about the levels dropping to far to be incompatible with other gates.
 

Thread Starter

Wendy

Joined Mar 24, 2008
23,421
Actually you never want to use LEDs as diodes. The old generation you could get by with more, but the new stuff has a PIV of 5V or less, maybe much less. Modern red LEDs are 2.5V Vf, at least that is the number I use. Yours may differ.

The absolute max rating of the 4017 is 16ma. You do more, the chip may decide to retaliate. Besides, if the voltage drops so does the current, in an unpredictable way. I've been doing this a while, and have certain limits well defined on what you may and may not get by with. While I may never build this circuit, I am very confident it will work first time.

Any thoughts on a stable VCO using an RC time constant?
 

tom66

Joined May 9, 2009
2,595
Actually you never want to use LEDs as diodes. The old generation you could get by with more, but the new stuff has a PIV of 5V or less, maybe much less. Modern red LEDs are 2.5V Vf, at least that is the number I use. Yours may differ.
Put a 1k in series (limiting reverse current so as not to damage the LED), and/or use a lower supply voltage.

The absolute max rating of the 4017 is 16ma. You do more, the chip may decide to retaliate. Besides, if the voltage drops so does the current, in an unpredictable way. I've been doing this a while, and have certain limits well defined on what you may and may not get by with. While I may never build this circuit, I am very confident it will work first time.
Agreed - But if it was just a toy to build for a quick project, and not for production or commercial sale, then you should be okay.

Any thoughts on a stable VCO using an RC time constant?
A Schmitt trigger 40106 as a relaxation oscillator will vary oscillation frequency with supply voltage from 2V to about 6V. I built one and I could get a frequency from as low as 100 Hz (at 1V supply, not recommended because the output was only 500mV) to 38 kHz. Problem is of course the output swing varies with input voltage, so you need a way to control that, perhaps a simple transistor buffer. Also, it's not predictable.

Another way to make a variable VCO is to use an LDR in place of a resistor in a relaxation oscillator of almost any kind. Tape an LED to the LDR, and use black tape, to completely cover up the LDR. This will allow the frequency to be varied over a very large range.
 
Last edited:

Thread Starter

Wendy

Joined Mar 24, 2008
23,421
Tom, if you exceed the PIV rating and the diode begins to conduct, current is not important. The component is destroyed, or damaged in such a way that is very reminiscent of ESD. This is the meaning of PIV (Peak Inverse Voltage), you have broken the PN junction down. The V is for voltage, not current. You are going to run into this with a lot of very sensitive RF diodes too.

I need a simple push button type circuit. LDR doesn't fit that description. If you have a schematic let me see it, I may not use it but I may remove chunks for my design. :D

Edit: You can put a conventional diode in series with a weak diode. I don't know exactly why, but the strong diode will take all the strain.
 

tom66

Joined May 9, 2009
2,595
Tom, if you exceed the PIV rating and the diode begins to conduct, current is not important. The component is destroyed, or damaged in such a way that is very reminiscent of ESD. This is the meaning of PIV (Peak Inverse Voltage), you have broken the PN junction down. The V is for voltage, not current. You are going to run into this with a lot of very sensitive RF diodes too.

I need a simple push button type circuit. LDR doesn't fit that description.
I have seen PIV and reverse current together, but I could be mistaken - probably best to use a diode then.

You want it to trigger on the push of a button? Something comes to mind with three fives. ;)

Or... you could use a push button to charge a cap, which then runs the oscillator or provides the control signal to a VCO, like the LDR one.
 
Top