Spinning Magnets Do Your Dice Rolling For You

Dice are about the simplest machines possible, and they’ve been used since before recorded history to generate random numbers. But no machine is so simple that a little needless complexity can’t make it better, as is the case with this mechanical spinning dice. Or die. Whatever.

Inspiration for the project came from [Attoparsec]’s long history with RPG and tabletop games, which depend on different kinds of dice to generate the randomness that keeps them going — that and the fortuitous find of a seven-segment flip-dot display, plus the need for something cool to show off at OpenSauce. The flip-dot is controlled by an array of neodymium magnets with the proper polarity to flip the segments to the desired number. The magnets are attached to an aluminum disk, with each array spread out far enough to prevent interference. [Attoparsec] also added a ring of magnets to act as detents that lock the disk into a specific digit after a spin.

The finished product ended up being satisfyingly clicky and suitably random, and made a good impression at OpenSauce. The video below documents the whole design and build process, and includes some design dead-ends that [Attoparsec] went down in pursuit of a multiple-digit display. We’d love to see him revisit some of these ideas, mechanically difficult though they may be. And while he’s at it, maybe he could spice up the rolls with a little radioactivity.

Continue reading “Spinning Magnets Do Your Dice Rolling For You”

Generating A Lost Password By Traveling Back In Time

It’s probable that some of you reading this will have been approached in the past by people who’ve lost the password to their crypto wallets. They hear that you’re involved in some kind of “hacking”, and they cling to the forlorn hope that you might just be able to recover their lost wealth. For most of us there’s little chance we can help, but in [Joe Grand]’s case he has made it something of a specialism. He’s given an account of how he and a friend recovered a particularly difficult password.

The password in question had been generated by RoboForm, a long random string that was impossible for its owner to remember. The only chance of finding it lay in discovering a flaw in RoboForm, and that seemed hopeless until the discovery of a changelog reference to improving the random number generation of the software.

The video below details some of the detective work required to find the password, first reverse engineering an old version of RoboForm to find the flaw, and then the discovery that the random seed was derived from the system time. A range of passwords could be created for a given time frame, reducing the odds of finding the password considerably. The story is not without its twists, but it ends with the wallet’s owner rather theatrically being presented with a giant fake Bitcoin check.

Continue reading “Generating A Lost Password By Traveling Back In Time”

Linear Feedback Shift Registers For FPGAs

If you want to start an argument at a Hackaday meeting, you have only to ask something like “How much does this weigh?” or “What time is it?” But if you really want to start a street brawl, you can always say, “Are these numbers random?” Making random numbers that are actually random is actually a tough nut to crack. Most of what we do is, technically, pseudo-random (but we’ll say random number and assume you know what we mean). One way to generate seemingly random sequences is to use a linear feedback shift register or LFSR. You can use LFSRs in software, but they are also very useful in hardware design and [Adam Taylor] takes us through his use of them on FPGAs in a recent post. Continue reading “Linear Feedback Shift Registers For FPGAs”

Yes We Have Random Bananas

If you ask a normal person to pick a random number, they’ll usually just blurt out a number. But if you ask a math-savvy person for a random number, you’ll probably get a lecture about how hard it is to pick a truly random number. But if you ask [Valerio Nappi], you might just get a banana.

His post, which is in two parts, details how what computers generate are actually pseudo-random numbers. You can easily make sure that every number has the same probability of selection as any other number. The problem is that you have to start with something — usually called a seed. For the purposes of playing games, for example, you can grab some source of entropy like how many microseconds since a hardware timer last rolled over, the number of input pulses you’ve received from a mouse lately, or how long you had to wait for the enter key to depress after asking the user to press it. But if you know that seed and the algorithm you can perfectly predict what number the computer will generate next so it isn’t truly random.

Continue reading “Yes We Have Random Bananas”

Electronic Dice Is Introduction To Microcontroller Programming

By now most of us are familiar with the Arduino platform. It’s an inexpensive and fairly easy way into the world of microcontrollers. For plenty of projects, there’s no need to go beyond that unless you have a desire to learn more of the inner workings of microcontrollers in general. [Cristiano] was interested in expanding some of his knowledge, so he decided to build this electronic dice using a PIC microcontroller instead of the Arduino platform he was more familiar with.

As a result, this project is set up as a how-to for others looking to dive further into the world of microcontrollers that don’t have the same hand-holding setup as the Arduino. To take care of the need for a random number for the dice, the PIC’s random number generator is used but with the added randomness of a seed from an internal timer. The timer is started when a mercury tilt switch signals the device that it has been rolled over, and after some computation a single digit number is displayed on a seven-segment display.

While it might seem simple on the surface, the project comes with an in-depth guide on programming the PIC family of microcontrollers, and has a polish not normally seen on beginner projects, including the use of the mercury tilt switch which gives it a retro vibe. For some other tips on how to build projects like this, take a look at this guide on how to build power supplies for your projects as well.

Continue reading “Electronic Dice Is Introduction To Microcontroller Programming”

555 Timer On Its Own In Electronic Dice

One of the most common clich├ęs around here is that a piece of equipment chosen for a project is always too advanced. If a Raspberry Pi was used, someone will say they should have used an Arduino. If they use an Arduino, it should have been an ATtiny. And of course, if an ATtiny was used, there should have simply been a 555 timer. This time, however, [Tim] decided to actually show how this can be done by removing some of the integrated circuits from an electronic dice and relying entirely on the 555 timer for his build.

The electronic dice that [Tim] has on hand makes use of two main ICs: a NE555 and a CD4017 which is a decade counter/divider used for cycling through states. In order to bring the 555 to the forefront of this build, he scraps the CD4017 and adds an array of 555 timers. These are used to generate the clock signals necessary for this build but can also be arranged to form logic circuits. This comes at a great cost, however. The 555 chips take up an unnecessarily large area on the PCB (even though these are small surface-mount chips), consume an incredible amount of power, and are very slow. That’s fine for an electronic dice-rolling machine like this one, but that’s probably where [Tim] will leave this idea.

The 555 timer is a surprisingly versatile chip, and this project shows that there is some element of truth to the folks claiming that projects need naught but a few 555s. We’ve seen entire CPUs built using nothing but 555s, and even a classic project that uses a 555 timer to balance a robot.

Linux Fu: The Linux Shuffle

Computers are known to be precise and — usually — repeatable. That’s why it is so hard to get something that seems random out of them. Yet random things are great for games, encryption, and multimedia. Who wants the same order of a playlist or slide show every time?

It is very hard to get truly random numbers, but for a lot of cases, it isn’t that important. Even better, if you programming or using a scripting language, there are lots of things that you can use to get some degree of randomness that is sufficient for many purposes. Continue reading “Linux Fu: The Linux Shuffle”