Generate Random Numbers The Hard Way

Your job is to create a random number generator.

Your device starts with a speaker and a membrane. On this membrane will sit a handful of small, marble-size copper balls. An audio source feeds the speaker and causes the balls to bounce to and fro. If a ball bounces high enough, it will gain the opportunity to travel down one of seven copper tubes. Optical sensors in each of the tubes detect the ball and feed data to an Ardunio Mega. When the ball reaches the end of the tube, a robotic hand will take the ball and put it back on the speaker membrane. The magic happens when we write an algorithm such that the audio output for the speaker is a function of how many balls fall down the pipes.

The above is a rough description of [::vtol::]’s art piece: kinetic random number generator. We’re pretty sure that there are easier ways to get some non-determinstic bits, but there may be none more fun to watch.

[::vtol::] is a frequent flyer here on Hackaday Airlines. Where else would you showcase your 8-bit Game Boy Photo Gun or your brainwave-activated ferrofluid monster bath? Would it shock you to find out that we’ve even covered another kinetic random number generator of his?  Fun stuff!

Follow The Bouncing Ball Of Entropy

When [::vtol::] wants to generate random numbers he doesn’t simply type rand() into his Arduino IDE, no, he builds a piece of art. It all starts with a knob, presumably connected to a potentiometer, which sets a frequency. An Arduino UNO takes the reading and generates a tone for an upward-facing speaker. A tiny ball bounces on that speaker where it occasionally collides with a piezoelectric element. The intervals between collisions become our sufficiently random number.

The generated number travels up the Rube Goldberg-esque machine to an LCD mounted at the top where a word, corresponding to our generated number, is displayed. As long as the button is held, a tone will continue to sound and words will be generated so poetry pours forth.

If this take on beat poetry doesn’t suit you, the construction of the Ball-O-Bol has an aesthetic quality that’s eye-catching, whereas projects like his Tape-Head Robot That Listens to the Floor and 8-Bit Digital Photo Gun showed the electronic guts front and center with their own appeal.

Continue reading “Follow The Bouncing Ball Of Entropy”

Retrotechtacular: ERNIE

Wherever you may live in the world, who do you wish to smile upon you and deliver good fortune? You may be surprised to discover that for a significant number of Brits this role is taken by someone called [Ernie].

What, [Jim Henson]’s Ernie from Sesame Street‘s famous duo Bert and Ernie? Sadly not, because the owner of a [Rubber Duckie] can’t offer you the chance of a million quid every month. Instead, [Ernie] is a computer that has been anthropomorphised in the national imagination. More properly referred to as E.R.N.I.E, for Electronic Random Number Indicator Equipment, he is the machine that picks the winning bond numbers for the Premium Bonds, a lottery investment scheme  run by the British Government.

Brits have been able to buy £1 bonds, up to 50,000 of them today, since the 1950s, and every month they are entered into a drawing from which ERNIE picks the winners. The top two prizes are a million pounds, but for most bond holders the best they can hope for is the occasional £25 cheque. Premium Bonds are often bought for young children so a lot of Brits will have a few, often completely forgotten. Prizes never expire, so if you are the holder of old bonds you should consider asking National Savings and Investments whether anything is owed to you.

The Great Grandfather of Premium Bond Drawings

The original 1957 ERNIE, now in the collection of the Science Museum, London. Geni [CC BY-SA 4.0-3.0-2.5-2.0-1.0, via Wikimedia Commons.
The original 1957 ERNIE, now in the collection of the Science Museum, London. Geni [CC BY-SA 4.0-3.0-2.5-2.0-1.0, via Wikimedia Commons.
The current ERNIE is the fourth-generation model, but our attention today is on its 1950s ancestor. In a way it’s the most interesting of the machines because it has an unusual pedigree, being a creation of the Post Office Research Station, at Dollis Hill, London. As such it came from the lab of the Colossus engineer [Tommy Flowers], and is described as being a descendant of the now-famous but then still top-secret first digital computer used by the World War Two codebreakers. It’s thus a fascinating study for the student of computer history as well as for its role in British postwar social history, because it represents the only glimpse (had they known it at the time) that the British public had of the technology that had helped them so much a decade earlier.

A significant effort was made to ensure that the draw was truly random, and the solution employed by [Flowers] and his team was thoroughly tested before each draw. The thermionic noise generated across a neon tube was sampled, and this random voltage delivered the truly random numbers used to generate the winning bond numbers. The machine’s construction is extremely reminiscent of its wartime predecessor, however it is as well to bear in mind that it owes this to the standard racking and paint used in British telephone exchanges of the day. Gone though are the octal tubes, and in their place are their more familiar miniature successors.

We have two films for you showing this incarnation of ERNIE in action. The first is a National Savings promotional film which explains ERNIE’s purpose, while the second shows us the Minister of the time starting the first draw. Believe it or not, this was a cause of major national excitement at the time.

Continue reading “Retrotechtacular: ERNIE”

Hackaday Prize Entry: Nuclear Powered Random Number Generator

Random number generators come in all shapes and sizes. Some are software based while others, known as true random number generators, are hardware based. These can be created from thermal noise, the photoelectric effect and other methods. But none of these were good enough for [M.daSilva]. He would base his off of the radioactive decay of Uranium 238, and construct a working nuclear powered random number generator.

diagram

Because radioactive decay is unpredictable by nature, it makes for an excellent source for truly random data. The process is fairly simple. A piece of old fiestaware plate is used for the radioactive source. Put it in a lead enclosure along with a Geiger tube. Then wire in some pulse shaping circuitry and a microcontroller to count the alpha particles. And that’s about it. [M.daSilva] still has to do some statistical analysis to ensure the numbers are truly random, along with making a nice case for his project. But all in all, it seems to be working quite well.

Be sure to check out the video for quick rundown of [M.daSilva’s] project. If randomness is your thing, make sure you check out entropy harvested from uninitialized RAM, and the story behind the NIST randomness beacon.

Continue reading “Hackaday Prize Entry: Nuclear Powered Random Number Generator”

Clocked 8-Bit Random Pattern Generator For A CMOS Synth

A random noise generator is pretty handy when working with music, and building one using a micro-controller can be pretty trivial. So it’s nice when someone comes along and builds it from a few analog and digital parts. [acidbourbon] built his Clocked 8-BIT Random Pattern Generator for  CMOS Synth  inspired and motivated by the recent article Logic Noise: Sweet, Sweet Oscillator Sounds by [Elliot Williams]. It’s 8-bit output can be used as a random sequencer for DIY CMOS synths.
This pattern generator is suited to to be used in combination with a 4051 8-channel analog multiplexer. But it sounds quite interesting on it’s own (best enjoyed in stereo, check out the video after the break). After building some CMOS synth circuits, [acidbourbon] moved on to make some sequencers and multiplexers which then let him to devise this random pattern generator which could be gated using a clock signal.

The basic principle is straight forward – generate noise, amplify it, apply a clock to get the gated noise output. His design choices for the various sections are well explained, based on constraints that he had to work with. Everything needs to work at 5V, but his noise generator circuit requires 12V to work. He choose to use a charge pump to generate -5V, resulting in a 10V supply, which was barely enough, but worked. A boost regulator might probably have served better to generate 12V, but maybe he already had the ICL7660 charge pump IC lying around in his parts bin. The rest of the circuit uses standard CMOS/TTL devices, and [acidbourbon] provides all of the design files for what looks like a neat, single sided PCB that can easily be made using the toner-transfer method.

Video below.

Continue reading “Clocked 8-Bit Random Pattern Generator For A CMOS Synth”

Towards The Perfect Coin Flip: The NIST Randomness Beacon

Since early evening on September 5th, 2013 the US National Institute of Standards and Technology (NIST) has been publishing a 512-bit, full-entropy random number every minute of every day. What’s more, each number is cryptographically signed so that you can easily verify that it was generated by the NIST. A date stamp is included in the process, so that you can tell when the random values were created. And finally, all of the values are linked to the previous value in a chain so that you can detect if any of the past numbers in the series have been altered after the next number is published. This is quite an extensive list of features for a list of random values, and we’ll get into the rationale, methods, and uses behind this scheme in the next section, so stick around.

Continue reading “Towards The Perfect Coin Flip: The NIST Randomness Beacon”

Chaos Theory In Practice: Chua’s Circuit

Chua’s circuit is the simplest electronic circuit that produces chaos—the output of this circuit never repeats the same sequence, and is a truly random signal. If you need a good source of randomness, Chua’s circuit is easy to make and is built around standard components that you might have lying around. [Valentine] wrote a comprehensive guide which walks you through the process of building your own source of chaos.

The chaos of Chua’s circuit is derived from several elements, most importantly a nonlinear negative resistor. Unfortunately for us, this type of resistor doesn’t exist in a discrete form, so we have to model it with several other components. This resistor, also known as Chua’s diode, can be created with an op-amp configured as a negative impedance converter and a couple pairs of diodes and resistors. Other variations such, as the schematic above,22`01 model Chua’s diode using only op-amps and resistors.

The rest of the circuit is quite simple: only two capacitors, an inductor, and a resistor are needed. [Valentine] does note that the circuit is quite sensitive, so you might encounter issues when building it on a breadboard. The circuit is very sensitive to vibration (especially on a breadboard), and good solder connections are essential to a reliable circuit. Be sure to check out the Wikipedia article on Chua’s circuit for a brief overview of the circuit’s functionality and a rabbit trail of information on chaos theory.