Usually computers use numerical methods to generate random numbers. These are called pseudo-random number generators and, as the name implies, are not truly randomly generator.
True random number generators can use physical phenomena, virtually impossible to predict, to generate random numbers. Some of these use methods based on optical properties, radiation, raindrops, or even lava-lamps!
This project uses the detection of ionizing radiation coming from radioactive sources, such as cosmic rays as the source for randomness for dice rolls. The detection of radiation is made using a Geiger-Muller tube which generates an interrupt on the microcontroller that calculates the dice roll.
The PCB features two 3-digit 7 segment displays to show the dice number and the dice type that is being rolled. The roll can be initiated by the "Roll" button, and the dice type can be chosen with the "dice" button.
The PCB is powered by two AAA batteries that can be user replaceble by removing the top acrylic plate. This acrylic plate also features an opening from which the user, with the help of a screwdriver, can tune the sensitivity of the tube on the potentiometer. The sensitivity is controlled by changing the biasing voltage of the GM-tube which is around 400V.
The actual calculation of the dice value is made at the time of a detection event by doing the modulus (%) of the current system tick by the dice number.
A mathematical analysys of the dice rolls is being made to make sure the dice rolls are "fair" and to see if additional mathematical methods need to be applyed. This will be published on a future blog post.
The code and the design files can be found on the github repo here!
Comments