Bet You Didn’t Know Arduinos Are Psychic

Are you running out of ways to entertain yourself and your family? If you’ve read all the books and watched all the movies, it might be time to explore the psychic abilities of silicon. [Hari Wiguna] has just the trick to keep them guessing for a good long time.

This trick doesn’t take much, just a couple of Arduinos, some momentary buttons, a number pad, and a large helping of math. As you can see in the demo after the break, there is nothing connecting the two, not even 802.11(n). On the randomizer Arduino, [Hari] generates random numbers with the push of a button until the audience sees one they like. Then [Hari] locks in the number with the other button.

What happens next is key: the randomizer generates another random number, but uses it as a hint to set a sentinel digit. The randomizer Arduino subtracts the larger of the two digits in the number from nine and stores the result as the flag. When the next number comes up that has the flag digit in the correct place, the number after that will be the random number chosen at the beginning.

The psychic Arduino’s secret is that it knows the first guess it receives is special. It does the same sentinel digit math as the randomizer, so when the guesser enters the guess with the sentinel digit, it knows the next number entered is the winner. Clear as mud? Check out the second video below where [Hari] explains the trick, a new take on a magic classic.

Looking for a more exciting way to generate random numbers? Try using fish tanks, lava lamps, or muons from outer space.

Continue reading “Bet You Didn’t Know Arduinos Are Psychic”

Flipping A Coin 10,000 Times With A Dedicated Machine

Flipping a coin is often the initial example used to help teach probability and statistics to maths students. Often, there is talk of how, given a fair coin, the probability of landing heads or tails should approach 0.5. Of course, if you want to test this, it pays to have a machine do the hard work for you. [Andrew Consroe] has the rig to do just that.

The build consists largely of 3D printed parts. A large cylindrical shroud is used to keep the coin within the flipping area. A spring-loaded dowel is actuated by a stepper motor spinning a cam, which flips the coin. Once the coin has landed, it is photographed with a webcam. An image processing pipeline then determines whether the coin landed heads or tails. A black spot is used on one side of the coin to aid analysis, as the poor-quality webcam images weren’t good enough to recognise the coin in its standard form. Once the flip has been analysed, a sliding aperture is used to push the coin back towards the flipper for the next cycle.

The machine completes a flip approximately every two seconds, meaning 10,000 flips would take approximately 2.5 days. Unfortunately, due to noise and occasional coin escapes, [Andrew] hasn’t yet been able to achieve his goal. He aims to increase speed significantly before making an all-out attempt.

Coin flips can make for decent random numbers, but if you need better ones, perhaps NIST can help you out. Video after the break.

Continue reading “Flipping A Coin 10,000 Times With A Dedicated Machine”

Finding The Random Seed Of Minecraft’s Title Screen

Minecraft is a game about exploring procedure-generated worlds. Each world is generated from a particular “seed” value, and sharing this seed value allows others to generate the same world in their own game. Recently, the distributed computing project Minecraft@Home set about trying to find the seed value of the world shown in the Minecraft title screen, and have succeeded in their goal.

The amount of work required to complete this task should not be underestimated. 137 users contributed 181 hosts with 231 GPUs to the effort, finding a solution in under 24 hours. The list of contributors to the project is a long one. It appears the method to find the seed involved comparing screenshots from various seed worlds to the original image. This took a lot of reverse engineering in order to calculate the camera FOV and other settings of the original capture, such that the results could be compared accurately. Interestingly, the group found two seeds that can generate the requisite world, suggesting the world generator code has some collisions between seed values.

We’re not sure what’s more astounding, the amount of work that went into the project, or that there’s a distributed computing project tackling advanced Minecraft research. Either way, we’re no strangers to Minecraft hacks around these parts. Video after the break. Continue reading “Finding The Random Seed Of Minecraft’s Title Screen”

A 4-bit Random Number Generator

Randomness is a pursuit in a similar vein to metrology or time and frequency, in that inordinate quantities of effort can be expended in pursuit of its purest form. The Holy Grail is a source of completely unpredictable randomness, and the search for entropy so pure has taken experimenters into the sampling of lava lamps, noise sources, unpredictable timings of user actions in computer systems, and even into sampling radioactive decay. It’s a field that need not be expensive or difficult to work in, as [Henk Mulder] shows us with his 4-bit analogue random number generator.

One of the simplest circuits for generating random analogue noise involves a reverse biased diode in either Zener or avalanche breakdown, and it is a variation on this that he’s using. A reverse biased emitter junction of a transistor produces noise which is amplified by another transistor and then converted to a digital on-off stream of ones and zeroes by a third. Instead of a shift register to create his four bits he’s using four identical circuits, with no clock their outputs randomly change state at will.

A large part of his post is an examination of randomness and what makes a random source. He finds this source to be flawed because it has a bias towards logic one in its output, but we wonder whether the culprit might be the two-transistor circuit and its biasing rather than the noise itself. It also produces a sampling frequency of about 100 kbps, which is a little slow when sampling with he Teensy he’s using.

An understanding of random number generation is both a fascinating and important skill to have. We’ve featured so many RNGs over the years, here’s one powered by memes, and another by a fish tank.

Random Numbers From Outer Space

Need a random number? Sure, you could just roll a die, but if you do, you might invite laughter from nearby quantum enthusiasts. If it’s truly, unpredictably random numbers you need, look no farther than the background radiation constantly bombarding us from the safety of its celestial hideout.

In a rare but much appreciated break from the Nixie tube norm of clock making, [Alpha-Phoenix] has designed a muon-powered random number generator around that warm, vintage glow. Muons are subatomic particles that are like electrons, but much heavier, and are created when pions enter the atmosphere and undergo radioactive decay. The Geiger-Müller tube, mainstay of Geiger counters the world over, detects these incoming muons and uses them to generate the number.

Inside the box, a 555 in astable mode drives a decade counter, which outputs the numbers 0-9 sequentially on the Nixie via beefy transistors. While the G-M tube waits for muons, the numbers just cycle through repeatedly, looking pretty. When a muon hits the tube, a second 555 tells the decade counter to stop immediately. Bingo, you have your random number! The only trouble we can see with this method is that if you need a number right away, you might have to go get a banana and wave it near the G-M tube.

Whether this all makes sense or not, you should check out [Alpha-Phoenix]’s project video, which is as entertaining as it is informative. He’s planning a follow-up video focused on the randomness of the G-M tube, so look out for that.

Looking for a cheaper way to catch your random numbers? You can do it with a fish tank, some air pumps, and a sprinkle of OpenCV.

Continue reading “Random Numbers From Outer Space”

’75 Nixie Multimeter As Digital Dice

For the casual Monopoly or Risk player, using plain six-sided dice is probably fine. For other games you may need dice with much more than six sides, and if you really want to go overboard you can do what [John] did and build electronic dice with a random number generator if you really need to remove the pesky practice of rolling physical dice during your games of chance.

The “digital dice” he built are based on a multimeter from 1975 which has some hardware in it that was worth preserving, including a high quality set of nixie tubes. Nixies can be a little hard to come by these days, but are interesting pieces of hardware in their own right. [John] added some modern hardware to it as well, including an AVR microcontroller that handles the (pseudo) random number generation. A hardware switch tells the microcontroller how many sides the “die” to be emulated will need, and then a button generates the result of the roll.

This is a pretty great use for an old piece of hardware which would otherwise be obsolete by now. [John] considers this a “Resto-Mod” and the finish and quality of the build almost makes it look all original. It’s certainly a conversation piece at the D&D sessions he frequents.

Hackaday Podcast 046: Bring Us Your Nonsense, Hacking NES Clones, Grasping FPGAs, Many A Music Hack, And Fish Tanks Full Of Random

Difference of two Vikram moon images, contrast tweaked.

Hackaday editors Elliot Williams and Mike Szczys highlight the most delightful hacks of the past week. Need a random-number showpiece for your office? Look no further than that fish tank. Maybe the showpiece you actually need is to complete your band’s stage act? You want one of Tristan Shone’s many industrial-chic audio controllers or maybe just a hacked turntable sitting between your guitar and amp.

Plus citizen science is alive and well in the astronomy realm, and piezo elements are just never going to charge your electric vehicle.

Take a look at the links below if you want to follow along, and as always tell us what you think about this episode in the comments!

Direct download (63 MB)

Places to follow Hackaday podcasts:

Continue reading “Hackaday Podcast 046: Bring Us Your Nonsense, Hacking NES Clones, Grasping FPGAs, Many A Music Hack, And Fish Tanks Full Of Random”