• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

OK guys, just a little help for a rusty tech

Status
Not open for further replies.

CoHPhasor

New Member
Admittedly, it's been a long while since I hit anything with a solder bubble, but it's never far from my heart.

Lately I've been playing alotta D&D, and soon I'm gonna be DMming.
What I'd really like to have is an electronic die, but not just some 6-sider.

I don't want players knowing I'm rolling for circumstances and what not.
For that I need a 20 sided die, or "d20" for those who know.

Of course the ideal die would be a multi-sided electronic die. flip the selector to d4, d10, d%, d20. I know I'm askin' alot, but even to get me started down the path, or get me to fig out the d20, then let me figure out how to do the rest.

I'd much appreciate it, thanx!
 

Roff

Well-Known Member
You can use a variable modulus counter, the modulus corresponding to the number of sides on your die. You could use a rotary switch or other techniques to set the modulus. Clock the counter with an oscillator that runs when the "roll" switch is pushed. The oscillator must run at a high enough frequency to cause the counter to overflow (start over) several times during the minimum "roll" switch duration.
Don't try to commercialize this technique. While doing a Google search for "variable modulus counter", I ran across US patent 4151404, which does exactly this.
 

CoHPhasor

New Member
Oh yea, no commercialization here. I just want to be able to do this for my own games. :D

I really appreciate the help, and as soon as I roll out an electronics dictionary I think I might be able to build a circuit like that. :shock:

Lol,....I'll see if I can find an example circuit.

btw, you're the man.
 

Roff

Well-Known Member
Here's another hint. One way to do this is to use 4017's as the counters (CD4017, 74HC4017) and use several 8-input multiplexers to select a counter output to feed back to the counter resets, thereby short-cycling the counter to the modulus you choose. There are several choices in multiplexers, such as 74HC151, 74HC251, CD4512, HEF4512, etc. Don't mix logic families. You might also need a few logic gates to complete the design.
 

seeker

New Member
I'm sorry Ron H.........could not resist :lol:
 

Roff

Well-Known Member
Hey, thanks, seeker - you saved me the trouble of drawing the schematic!
Reminds me of a Honda advertising video I recently received via email. Did anyone else see that? It was a real live Rube Goldberg contraption, made entirely of Honda parts.
 

CoHPhasor

New Member
Look at this, I leave the forum unattended for a lousy day an the mice start runnin rampant! :wink:

I think I just got run over by a mack. :?
Never when I've dabbled have I ever had someone run me through an idea with such laser accuracy.

It's kind of unnerving since I thought this would be an easy "lash together a few logs to make a raft" type project.
Now I think I'm gonna have to go trough a few logic lessons just to know what you said, then a few more to make a circuit.

(Add a few side studies to understand that schematic! 8) )

Thanks for all the help!

ps, maybe in the thread title I shoulda put "rusty noob", insteada "rusty tech" lmao! Or maybe "current art student"
 

Jimbo

New Member
this page should help you on your way with regards to the counter, and how to do the 'modulo X' reset (only for modulo 6, but it's easy to figure out other scenarios). It even has a 'display' driver which you can use when the die "stops rolling".

[edit]Arrrgh, I keep on editing because I keep on forgetting stuff. The design in the link uses BCD counters which will avoid the problem you'd have when trying to convert a true binary value (from a 4024 or 4040 counter for example) into something which you can display (on 7-segment display(s) as in the link). I'm sure there's convertors for that too, but they 'look' more expensive after a quick google search. Of course, this only becomes a problem if you want dies with more than 9 sides, which you apparently do.

The components used also do not require a seperate clock, which is a plus.
 

bogdanfirst

New Member
hey Ron, i saw the commercial. very interesting and neat.

ok, back to the circuit.....could a simple solution like 2 4029 binary counters and 2 decoders like 4511 and 2 7 segment display to?
as source for clock, i think that 2 clock sources are better than one.

what do you think?
 

Roff

Well-Known Member
Jimbo, Bogdan, do your suggestions address the problem of implementing the variable number of sides he wants for his die? Seems to me that a 4017 Johnson counter, which already has all 10 states decoded, and a multiplexer to select which output is fed back, is pretty minimal. If he wants to have a 7 segment display, then maybe another approach should be investigated. I'll let you guys work that out. :lol:
 

CoHPhasor

New Member
Well I would LOVE to have to 7 segment displays, after all if I was representing a d20 I'd need 20 LED's, and if I was doing the d% I'd need the same, OR 100 lmao!


Keeping in mind I'd like to have the box not be huge ;)

Hell, I'd even consider making a different cicuit for each,

1 d20,
1 d12
1 d%,
1d8,
and 1 d4.
 

Jimbo

New Member
Ron H said:
Jimbo, Bogdan, do your suggestions address the problem of implementing the variable number of sides he wants for his die? Seems to me that a 4017 Johnson counter, which already has all 10 states decoded, and a multiplexer to select which output is fed back, is pretty minimal. If he wants to have a 7 segment display, then maybe another approach should be investigated. I'll let you guys work that out. :lol:
Ah, now I understand your suggestion: you'd cascade 2 4017s, effectively 'driving' 20 outputs in a row, i.e.: counter state '01': first output/led lights up, counter state '02': second output/led lights up (first goes out), etc...

Then, all 20 outputs are connected to 20 inputs from a bunch of multiplexers (although, wouldn't that be DEmultiplexers?). The address lines of the demux'ers are then connected to a rotary switch with some sort of Diode matrix to set the addresses. The output of this demux bank is then connected to the reset lines of the 4017 counters. Works for me :).

Don't know any demux components, so I'd use bidirectional adressable CMOS switches such as the 4051 ( = "Analog mux/demux").

So it boils down to what sort of output he likes best. In this scenario, he'd get a single led lighting up, indicating the side on which the die stopped rolling (eg 16th led is burning -> he threw 16, as easy as that).

If he wants/likes 7segment displays, I'd go back to 'my' suggestion with double decade counters. Originally I was thinking about thinking up different "discrete" gatings for each number of sides he wants (selected or rather 'gated' through the rotary), with in the web-link an example being shown for a six-sided die ("AND" A1 & A2 address lines).

That might turn out a bit complex (and use heaps of components), but your (de)mux-idea can be recycled: the output address created by the 4010 BCD counters drives three 4051 switches (i.e. on the adress input lines), while the outputs of the rotary switch are connected to each channel of a 4051 in a row. The common connection point of the rotary is simply attached to ground. Therefore, if the counter address matches the rotary position, a 'low' (logic high) is connected through the corresponding 4051 to the reset input(s).

Done! :).
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top