~ / random
Random bits from background radiation

live

All numbers on this page are generated randomly using radioactive decay.

A computer can’t make up random numbers. It only follows instructions, so what programs call random numbers are really pseudo-random, the output of a formula that gives the same sequence again from the same starting value. Anyone who knows that starting value can predict every number that follows. Radioactive decay can’t be predicted. An unstable atom decays at a moment that nothing, even in principle, can foresee.

The goal of the project was to build a true random number generator. The setup uses a small Geiger counter module (DFRobot Gravity, M4011 tube) wired to a Raspberry Pi. Each time a particle of background radiation crosses the tube, the gas inside sparks for an instant and the module clicks. The particles come from cosmic rays, radon in the air and the rocks underfoot.

The Geiger counter module with its glass tube, wired with jumper cables to a Raspberry Pi in a pink case
The Geiger counter module (top), wired to the Raspberry Pi (bottom)

The bits are generated by looking at the gap between clicks. These are random but not evenly spread (short gaps are more common than long ones). Two gaps in a row, though, are equally likely to be the longer one, so comparing them gives a fair bit.

t₁ > t₂ → 0
t₁ < t₂ → 1

This page shows the bits as they are generated in real life and are grouped every 256 to become a pulse.

The random number generator was fun to build but it is also wildly inefficient. A pulse takes about 30 minutes of clicks, while any laptop makes millions of good-enough random numbers a second.

The pulses are public, so never use them as passwords or keys.


history