Here is a comparison in an image between a TRNG and the PHP rand() function.
(Image from https://www.random.org/analysis/)
We can see a pattern… that is not true randomness.
Let’s see an example:
A temperature sensor gets this data:
Now we need only the noise in order to use the nature’s randomness:
Then we can, for example, generate a random bit by taking the last noise digit, n:
If (n <= 5), bit = 0;
Else if (n > 5), bit = 1
Also, we can generate, for example, SHA-1 hashes:
Please follow this project and learn how to generate your own True Random Numbers with this open source development board, TRNG Zero.
ELF-VLF noise source:
The electromagnetic spectrum includes both natural and human generated waves at different frequencies. Fortunately, many of the human RF transmissions at very low frequencies has been stopped. We can hear natural noise between 0 to 2400Hz, which includes: Schumann resonances, Sferics, Tweeks and Whistlers (More info). Thereby, we can spect to get a good randomness quality, but there is a problem, our electrical grid produces a very high unnatural noise at 60Hz/50Hz. So, we have to filter out that noise and keep the remaining 0 to 2400Hz signals. This can be done with high quality filters: 1 low-pass and 1 notch. I have successfully calculated and simulated (LTspice) a good filter circuit:
* For 50Hz, change R1=R4=318.309kohm and R2=R3=6.366Megohm.
Now I have to add an antenna (loop) and amplify the clean noise... Coming up.
Accelerometer / magnetometer
I realized that accelerometers and magnetometers are good noise sources, even those with digital interfaces like TWI. My choice was the Bosch BMC150 sensor, which includes accelerometer and magnetometer in one chip.
I made an experiment like the image above, in order to check the randomness quality. This technique is not sophisticated, but it's a good start: I took the LSB of every sensor reading during 10,000 readings, then I made a 100 x 100 px bitmap representing whether a '0' with a white dot or whether a '1' with a black dot. I made sure to read the sensors not so fast, avoiding to read unchanged values. Here are the results: