Pages: [1]   Go Down
Author Topic: Electronic Dice / Portable Random number generator  (Read 1496 times)
0 Members and 1 Guest are viewing this topic.
Dallas, Texas
Offline Offline
God Member
*****
Karma: 30
Posts: 887
Old, decrepit curmugeon
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When I put together the Entropy library, I started prototyping a simple electronic dice project to demonstrate the library.  I originally started with a simple array of seven led's arranged as the dots on a six sided die; however, I realized how little of the resources that used from the Arduino, and came across the 8x8 LED matrices from Adafruit and realized that these would be perfect for graphically representing a die.  As I developed the program, I decided to add other types of dice (the old D&D 4,8,10,12, and 20 sided dice).  I have been tinkering with this prototype on and off for over a year and I have added a total of ten modes to the device.
  • DICE - Simulate two six sided dice
  • DICE 4 - This mode simulates two dungeons and dragons style four sided dice
  • DICE 8 - This mode simulates two dungeons and dragons style eight sided dice
  • DICE 10 - This mode simulates two dungeons and dragons style ten sided dice.  The tenth side is displayed as a 0.  This means that this mode can be used to directly generate a random number in the range 00 - 99.
  • DIE 12 - This mode simulates a single dungeons and dragons style twelve sided die.
  • DIE 20 - This mode simulates a single dungeons and dragons style twenty sided die.
  • CARD - In this mode the device will simulates a randomly shuffled deck of 52 standard playing cards (no joker). allowing the drawing one card from the deck with no repeats.  After all 52 cards have been draws, the deck will be reshuffled and you can start over.
  • HEX - This mode randomly produces a single hexadecimal number in the range of 0x00 - 0xFF
  • BIN - This mode produces sixteen random 8-bit binary random numbers displayed on the two 8x8 matrices.  Since the entropy generator used only generates 8 bytes per second, and has a queue of up to 64 bytes, this mode can empty the queue and take a second or two to display after 'rolling' the dice.
  • PASSWORD - This mode slowly scrolls a eight character (0-9, a-z, A-Z. -, and +) password across the two displays.

The Arduino sketch, a circuit diagram, parts list, and a video demonstrating all ten modes are available from; https://sites.google.com/site/astudyofentropy/project-definition/timer-jitter-entropy-sources/entropy-library/led-matrix-dice


* Dice mode from LEDMatrixDice.png (1379.55 KB, 1920x1080 - viewed 40 times.)

* IMG_0472.JPG (2453.89 KB, 4000x3000 - viewed 34 times.)
Logged

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12741
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Excellent project!

I have a complaint: The images on your site are blocked.  You need to loosen the security.

And two suggestions...
1. (Optionally) Output the result to Serial.  I can imagine the device being connected to a computer to generate passwords (or maybe even dice rolls).
2. Add a coin flip option.
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 30
Posts: 887
Old, decrepit curmugeon
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Excellent project!

Thanks!

I have a complaint: The images on your site are blocked.  You need to loosen the security.

Sorry, I didn't notice the problem.  It is fixed now.  Thank you!

And two suggestions...
1. (Optionally) Output the result to Serial.  I can imagine the device being connected to a computer to generate passwords (or maybe even dice rolls).

I will take care of this.  It is funny, I actually removed the code that did this since I was only using it for testing purposes!

2. Add a coin flip option.

Duh, I can't believe that this one didn't even occur to me!
Logged

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Dallas, Texas
Offline Offline
God Member
*****
Karma: 30
Posts: 887
Old, decrepit curmugeon
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks to Coding Badly's suggestions I have updated the project's page as well as the video.  The sketch will now send the same information that is displayed on the Matrices to the Serial port console.  It also now has a coin flip mode.


* CoinFlipMode.png (375.52 KB, 1920x1080 - viewed 15 times.)
Logged

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

nice
Logged

Pages: [1]   Go Up
Jump to: