3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Random number generator

I am looking to purchase or looking to make or looking for someone to make or show me how to make a simplistic ramdom number generator with a simple 2 digit lcd readout. This will be used as an automatic dice roller for a board game. The random numbers can be fixed to read out from 1 - 12 or even up to 24. Or, if not too difficult, programble, to make it more versatile Perhaps a prototype could be made by using some existing components such as from a digital clock or watch. Can anyone tell me if; 1. There is anything like this on the market? 2. There is an easy, inexpensive way to built something like this? Or 3. If someone would be interested in building something like this for me?

AutoRoll.jpg
17 comments
sort by: active | newest | oldest
Feb 12, 2007. 12:15 AMLasVegas says:
There is no such thing as a true digital random number generator. This is why they're called pseudo-random. You could get a random number by incrementing the number looping from 1 to 12 as quickly as the circuit would allow and display the current count when the user presses the button. In this situation, the random action is the time it takes the user to press the button.
Sep 19, 2009. 5:36 PMskielek says:
do you know how to play the roullete bergmann slot machine...?
Jun 6, 2009. 4:44 AMMatt011 says:
LasVegas is correct. Check out this site: http://www.random.org/
Feb 12, 2007. 6:55 PMVIRON says:
I agree, just going to say the same thing, the only true random number generator must count very fast and be stopped by the "observer". No uC is needed... (a couple of TTL's and LED display is cheap+simple) Digital watch... hmmm... if you can overclock one (much faster crystal), and just use the set-hour mode ... there you go! Just like the picture.
Apr 12, 2009. 5:20 PMdietbrisk says:
i thought about this once. the solution i came up with: have a unit that counts from 0 to N-1, based on the board clock, and once the input is pressed, display that number + 1 and hold it on a register. it's not a real number generator, but the clock is going so fast (25 MHz on my board, anyway) that the probably of the system acting random is very high: trying to 'time' 25MHz/N in your favor is improbably small. and, for the needs of an extremely small program like a dice, it's suitable.
Feb 15, 2009. 6:24 PMjman11 says:
The easiest way i know is to make a variable and a loop that changes the value of the variable.... not totally random but its about the most random thing you can get. If you are coding in C or C++ tell me and i would be glad to share some of my code. :)
Oct 15, 2008. 11:36 AMkelseymh says:
Did you ever try "electronic dice" in Google? Lots of hits, both for projects you can build and products you can buy.
Jul 21, 2008. 7:33 PMLittleHairyApe says:
There is a solution using a programmable calculator. There are many programmables, but if you want to give it a try with a Hewlett Packard HP-33s, here's an example of how little effort it would take. As a bonus, you would have the option of any range of numbers. For a 1-12 dice scenario, the program would look like this in native calculator code: [grn, PRGM] (Goes into program mode) LBL A 12 RAND * IP 1 + RTN [grn, PRGM] (Exits program mode) To run, press R/S once for each roll of the dice. In the program change 12 to 24 to have a range from 1-24, or change the 12 to 6 to make it like a regular single die. Then press R/S twice for two six-sided dice, or four times for four dice. Just my nuisance two cents. :)
Feb 13, 2007. 4:43 PMfungus amungus says:
What kind of dice are you trying to simulate?
Feb 13, 2007. 7:12 PMVIRON says:
good point. A normal pair of dice won't roll a "1", and tends to roll lots of "7"s. A random 1-12 picker is like a DnD dodecahedron, or a clock face spinner.
Feb 12, 2007. 1:05 AMwestfw says:
From a logistics point of view, you're going to have trouble finding a 2-digit LCD display like that at a reasonable price. LCD "glass" tends to come in a few standard formats (clock display), and "custom designed." It would be a lot easier to do in LEDs, and THAT'S been done many a time (though I don't know offhand whether there's one with a XdY (X dice with Y sides each, ala DnD) programmable capability. It shouldn't be hard. Electronic Dice Kit might be a good starting place.

(or, you might be able to use a cellphone display, if you can find one that's well documented.)
Feb 12, 2007. 11:09 AMwestfw says:
Sorry about the price; a lot of these kits are manufactured off in China/etc and sold by many vendors, so I didn't bother looking specifically for a US source. Although now that I have, I can't find one anyway... Note that the 18pin PICs all have compatible pinouts, so you should be able to drop in a more-hobbyist friendly chip instead of the one that comes with the kit, if it has a socket...
Feb 12, 2007. 10:28 PMwestfw says:
Well, you can look at the How to Choose a Microcontroller instructable. For two 7-segment displays, you probably want to have 9 output pins, and a couple inputs to select max value or whatever. Unfortunately, that'll eliminate some of the lower cost "easy" solutions like the basic stamp 1 or PICAXE (which only have 8 outputs, as far as I can tell.) But you should be well within the capabilities of 14 to 18pin PICs or AVRs. (or, come to think of it, you could probably implement this on the $20 Atmel Butterfly Evaluation Board
Feb 12, 2007. 7:11 AMCorrugator Supercilii says:
0 to 15, four bit, maybe a linear feedback shift register (a few xor and shift register from 74 logic series), with 7-segment display instead of LCD?

http://en.wikipedia.org/wiki/Linear_feedback_shift_register

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!