RNG
RNG with avelanche breakdown
How it Works
The two transistors with their bases touching create "avalanche noise in a reverse-biased PN junction." This noise is amplified by the third transistor, and sent across a voltage divider to Arduino. On the oscilloscope, the signal looks very fuzzy. In software, that randomness is converted into a stream of 1s and 0s.
The code works like this: for the first 10 seconds, record the signal from the circuit on the analog input pin. Find the median. Then for each subsequent reading of the input pin, see if it is above or below the median. If it is above, output a 1, if it is below, output a 0. Filtering can be applied to the output stream of 1s and 0s to reduce bias.