I'm a software / maths guy who would like to build a physical setup for generating quantum random numbers. I have no physics background, so bear with me.


  • The project is for a public exhibit, so it's important to me that the setup should look cool, or at least interesting, and should reveal something about how it works. API calls to a QRNG on the internet wouldn't serve that purpose. It also need to be safe to have around people, albeit perhaps in a glass case or whatever.
  • I don't have a big budget or any physics or engineering skills, so I need something that doesn't require much skill or specialist equipment to build. I don't mind learning on the job, though, and I might be able to enlist the help of a physicist further down the line.
  • I don't actually need the numbers generated to exhibit "true randomness", and I expect larger-scale effects (temperature, vibration etc) will interfere with the quantum ones; but I do want to be able to honestly say that photon emission times (or whatever) are influencing the results.

My very rough understanding is that this can be done by pointing a laser at a photocell; the resistance of the cell ought to vary slightly as the number of photons arriving varies. So if my software asks the photocell for its current value, and looks at the last few digits of that value, in theory the fluctuations ought to have a quantum origin.


  1. Is the setup I've described feasible and likely to work with low-cost components?
  2. If it's not, can you suggest another approach?
  3. If it is, how would I find out what strength of laser and sensitivity of photocell I need to get the effect? (That is, how "big" is the fluctuation in power?) What other technical things do I need to consider?


Inevitably this question is a mixture of physics and engineering -- I'm primarily looking for (in)validation of the general approach here, and will take specific engineering questions elsewhere if necessary. I'm hoping, perhaps in vain, that with a good definition of the physics, the engineering part can be accomplished by assembling a few stock components.

  • 1
    $\begingroup$ If you budget is on the order of 2k euro, you can check out those guys: idquantique.com. They make both photon counting integrated RNGs, as well as sell all the necessary components to build one from scratch. $\endgroup$
    – oakad
    Dec 5, 2014 at 6:49

6 Answers 6


An alternative way to generate random numbers, that truly is quantum, and also quite easy: put a small radioactive source near a Geiger counter. Radioactive decay is a truly random event in the quantum sense, and is basically not subject to thermal noise at all.

For maximum visual impact, replace the Geiger counter with a cloud chamber. That way you can literally see the consequences of quantumly-random events. You could make random numbers from it using a web cam and some basic image processing.

  • 1
    $\begingroup$ Wow, thanks, that's a really interesting alternative. I found what looks like some very do-able instructions for cloud chamber building here: lns.cornell.edu/~adf4/cloud.html. Definitely a possibility. $\endgroup$
    – helveticat
    Dec 4, 2014 at 13:12
  • $\begingroup$ @helveticat My advice with cloud chambers is to leave time to tinker with them -- they can be finicky when trying to maximize visual effect, and there are many variations. For instance, replacing isopropyl alcohol with methanol might help (the latter is lighter and therefore falls slower in air). $\endgroup$
    – user10851
    Dec 4, 2014 at 18:44
  • 1
    $\begingroup$ @ChrisWhite Yes, actually one of the things I find encouraging is how many variations there seem to be out there. I'm going to order up some materials and see if I can get something working. $\endgroup$
    – helveticat
    Dec 4, 2014 at 20:30
  • $\begingroup$ Don't mix up Giger and Geiger :-) $\endgroup$ Dec 5, 2014 at 8:57
  • 1
    $\begingroup$ I once made a random number generator using a webcam and a lavalamp. The code is very simply taking a picture every x seconds and hashing the file. Another solution I've been wanting to (but never did) is taking the input stream from the webcam directly to make a live rng. (I just took the hashed output, added epoch in ms and hashed that again). $\endgroup$
    – HTDutchy
    Dec 5, 2014 at 10:00

If I understood correctly, what you are trying to build is a hardware based random number generator, where you want to use some quantum mechanics-based mechanism to supply the randomness.

I'm no experimentalist, thus, take my comments with a grain of salt.

Your suggestion is to use Schottky noise from a illuminated photodiode. I believe that it's a pretty safe setup (detector + light source), but your problem is that you would probably need a very dim light, and consequently a properly sealed case, in order to not completely saturate the photodiode, even if it operates at high sampling frequencies.

Even with a high sampling frequency (~ 1GHz+), I think that you would need a dim light source because of the following:

Even if your photodiode just measure optical photons, an typical optical photon has energy between 1.5 eV and 4 eV ~= 2.4-6.4 x 10^{-19} J

If you have a $\mu W$ laser, supposing that the laser is completely covered by the detector, there would be still, on the best case scenario, about $0.15 \times 10^{19-6} = 1.5 \times 10^{12}$ photons per second, so, in order to see them individually, you would need something with a THz or more sampling rate, which probably is quite expensive.

So, either you get a very low power laser, i.e. $nW$ or less, or you get a way to lower the power of a more powerful laser. One way to do that is to lower the output power of the laser and also to get a divergent lens, so not all the laser's light is deposited on the detector. If you can get a factor of 1000 lower, you might have the chance to measure with a GHz sampler.

Also, you might have to cool down your whole system in order to get the shot noise to be bigger than the thermal noise. I'm not sure if it would be feasible in room temperature, you might have to purchase a bit of liquid nitrogen which require a bit of care (proper gloves, bottle and case for it).

I would suggest that if you don't have to create a Quantum RNG, just get a thermal noise measurement as your RNG. It's probably way easier than that.

In any case, I wish you luck.


The THz estimate was based suposing that the whole detector acts as a single detection block. If it acts as an array of detectors, as would be the case using a digital camera sensor, there would be an $O(10^6)$ pixels availables in today's cameras, and this should lower the sampling frequency requirement by an equal factor.

This estimate would give a $\approx $ 1 MHz for the sampling frequency necessary to get individual photons with a 1 $\mu W$ laser, which is feasible to find in a high speed camera.

Again, using a 1 nW laser with a 1 Mpx array, the required sampling frequency would be 1 $kHz$, which is, in turn, very easy to find. Combining nW laser with Mpixel camera probably should be the easiest way to get an quantum NRG

  • $\begingroup$ Thanks, this is extremely helpful information and sort of confirms my main worries about the idea. Regarding insulation, I'm wondering whether a heavily-smoked glass box might work; if the laser was sufficiently powerful, seeing it glowing inside could be quite nice visually. $\endgroup$
    – helveticat
    Dec 4, 2014 at 13:34
  • $\begingroup$ I've accepted Nathaniel's answer because he gave me an alternative suggestion I'd never have thought of that I'm probably going to use. I wanted to thank you for answering my original question so carefully, though; I wish I could accept both! $\endgroup$
    – helveticat
    Dec 4, 2014 at 20:32

To add to Nathaniel's Answer because (1) it is a good answer and (2) I get nervous recommending radioactive materials handling to anybody I don't know: I would really think about the cloud chamber idea, especially since you're a software guy with a math background. It would need to be inside a darkened container, but you could run a webcam to show what is going on. You can run your cloud chamber satisfactorily on either of the following sources:

  1. Uranium glass. This is a low level source, the uranium is in glass so you can't ingest any and it's readily available as uranium glass marbles. See my answer here for possible suppliers. There is a youtube clip of a homemade cloudchamber with uranium glass in it here

  2. Alternatively, you can make your cloud chamber big - you'll just need to have it running a bit longer before your demonstration - and you'll get quite a show from cosmic ray muon trails. You don't need any radioactive source at all. The big cloud chamber would work better with the uranium glass too. See Sheehy, S. L. "How to make a cloud chamber", produced by the Cockroft Institute at University of Oxford (google Suzy Sheehy) for some pretty good instructions about this.

Lastly, I refer you yet again to my answer here for discussion of safety measures for uranium glass handling

  • 2
    $\begingroup$ The more I look at YT videos about this, the more I like the idea of making a cloud chamber... a big one might be a possibility and I do like the idea of capturing muon trails. I may order up some dry ice & alcohol and try a few experiments. The image processing part needs a bit of thought but doesn't seem insurmountably difficult. $\endgroup$
    – helveticat
    Dec 4, 2014 at 15:10
  • $\begingroup$ Ignorant question: What about the americium in smoke detectors? $\endgroup$ Dec 4, 2014 at 16:14
  • $\begingroup$ @MackTuesday The reason alpha emitters like americium are relatively safe (as long as you don't swallow them) is that alpha particles are stopped by a few centimeters of air even without shielding. So americium won't give you really long trails if that's what you're looking for. $\endgroup$
    – user10851
    Dec 4, 2014 at 18:47
  • $\begingroup$ @helveticat I've done a big one (about a 5 litre tub) with my daughter. You may need to plan the dry ice bed a little so that either it lasts long enough for your demonstration or you can shovel in replacement ice every so often: a 5 litre one takes about half an hour to get running well from room temperature, so you may need to plan a lunch break from the demo if you need to do two shifts. Or, you could have three or four started at different times to cover one another. $\endgroup$ Dec 4, 2014 at 22:41

What effect are you looking for: Mr. Wizard, Rube Goldberg, or MacGyver?

For a clean "Mr. Wizard" effect, use the cloud chamber that others have suggested. This has the simplest hardware setup of the three: put your radiation source by your cloud chamber, point your camera at it, and you're done. But the software will be considerably more difficult than the other two, because you'd need to resort to image processing to get random numbers out of the pictures that the camera is taking.

For a complex "Rube Goldberg" effect, use the laser and photodiode. The software is much easier, because all you'd have to do is measure the current coming off of the photocell. A laser pointer and photodiode should do (plus an ADC to convert the signal into numbers), but you might want to use smoke and mirrors (literally) to improve the visuals: fire the beam through smoke to make it visible, and bounce it off of mirrors into interesting shapes. This makes for considerably more complex hardware than the cloud chamber, but it should give you some neat visuals.

For a do-it-yourself "MacGyver" effect, use two LEDs, one of which is hooked up backwards. The funny thing about LEDs is that a reverse-biased LED can act as a photodiode, so you can have the same sort of hardware on the sending and receiving end. The software is the same as you'd use for the laser/photocell. Depending on your level of expertise, you should be able to scrounge some (or even all) of the hardware from common electronics: two LEDs, a dark light filter of some kind to put them behind, and an ADC. This is the least impressive setup visually, and hardware-wise it falls between the cloud chamber and the laser/photodiode, but it has other cool factors to compensate: you're using the same kind of component to send and receive, and you can scrounge all the parts. It should also be dirt cheap, especially if you can scrounge, so you may even be able to post instructions for how people can build their own.


Your proposed setup is pretty close, except that it will also/mainly be sensitive to the classical (non-quantum) fluctuations in the power of the laser. The setup could be made more quantum-ey by adding a beamsplitter and an extra photodetector. Specifically, you have a laser, a 50:50 beamsplitter, and 2 detectors (one at each output port of the beamsplitter). Then you subtract the photocurrent from each detector (with maybe a tweak of the gains or beamsplitter angle to ensure the average is zero). The laser noise will subtract away as it is common to both detectors and what remains are the vacuum fluctuations, or perhaps more intuitively, the randomness associated with individual photons deciding which detector to be detected at.


As a supplement to some of the other answers, a lot of quantum phenomena involving optics or lasers is indistinguishable from classical phenomena unless you're dealing with a small number of photons. Such a setup is difficult, and fairly boriing to watch.

A simple quantum optics demonstration could be a laser through a polarizing filter. The interpretation is that an incoming photon has a probability of being aligned with the filter, or against it, and the probability changes depending on the photon's initial polarization. At 45 degreed, it's 50% either way. Set it up so that viewers can rotate the filter themselves. You can even skip the laser; use two polarizers, and ambient light.

You could also do something using phosphorescence (think glow-in-the-dark). Show how the pattern your laser moves glows after the fact. This reradiation of light is roughly related to how the probability of electrons transitioning down energy levels is small. I saw a neat science display the other day where the exhibit used a flashlamp, and had people pose against a phosphorescent wall. The "shadows" stayed after people finished posing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.