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.
Fans of D&D are surely aware of the significance of a good pair of dice. What if your dice were not only stylish, but smart? For anyone who’s ever had to deal with playing board games with less than reputable siblings or friends, the electric die just might be your savior.
The dice are configured via Bluetooth, tracking rolls and stats over the course of gameplay captured by an accelerometer.
The PCB had to have a flexible surface – specifically in the shape of an unfolded icosahedron – in order to form the shape of the die which constrains the design to two layers. Each face contains an LED facing outwards to light up the number on that side. The LEDs are directly powered by a rechargeable battery, which uses a small coil for wireless inductive charging. Rather than opting for a Qi charger chipset, which regulates the maximum amount of power transmitted if the efficiency falls below a threshold, [Jean Simonet] uses a simpler charger setup using a full bridge rectifier, capacitors, and a linear regulator to create a stable 5V supply for the receiving end.
While the initial design for the die required an injection molded plastic shell, an easier solution was to simply cast the designs in resin. The electronics are placed into a dice mold and cast just as a regular die would be.
This luckily also solved the issue of needing to fit the components inside a screw-on container with a removable lid, which presented a hassle in terms of finding a battery that would fit the dimensions. The LEDs – purchased for cheap on Alibaba – are daisy chained to reduce the complexity of the routing.
One issue with the LEDs, however, is that the internal PWMs modulating the intensity remain on even at an intensity of 0, constantly drawing 21 mA (for the 21 LEDs on the die). This causes the battery to die after 2-3 hours. The solution [Simonet] used was to add a transistor to cut off power to the LEDs and to have the MCU toggle the transistor when the LEDs are turned off. Even this solution didn’t solve the entire problem since the LEDs still drain current from the data and clock lines, so those lines had to be low before going to sleep.
There were some stability issues with using a small buck converter to bring the LiPo voltage down to 3.3V, so the power regulation was done directly by the MCU instead. Switching the die off is controlled by a magnetic switch connected to a power buck converter that turns off logic when a magnet is present. This initially caused the LED control lines to become floating when power was turned off, turning the LEDs to arbitrary colors. The solution was to wire the output of the magnetic sensor to the MCU and to allow the software to handle the LEDs as well.
Maybe it’s because creator [Simonet] happens to be a game developer as well, but the early development stages of the electronic die (CAD, circuit schematics, prototyping, hand soldering components) were streamed on Twitch, adding some interactivity to even the build phase. The end result may be small, but these dice certainly have large brains!
There are truisms about dice that you’ve probably already heard: if you have just one of them it’s called a “die”, opposite faces of each die always add up to seven, and those dots that you’re adding together are known as “pips”. But what about the infrared properties of those pips? It turns out they reflect less IR than the white body of the die and that trait can be used to build an automatic die reader.
Great projects have a way of bubbling to the surface. The proof of concept comes from way back in 2009, and while the source blog is now defunct, it’s thankfully been preserved by the Internet Archive. In recreating the project based on that barebones description, [Calvin] reached for a set of five IR transmitter/receiver pairs. Take a close look and you’ll see each transmitter is hidden under its partnered receiver. The light shines up through the receiver and the presence of the pip is detected by measuring how much of it bounces back.
This board is only the sensor portion of the design. A 595 shift register provides the ability to control which IR pair is powered, plus five more signals heading out to the analog pins of an Arduino Uno to monitor how much light is being detected by the receivers. Hey, that’s another interesting fact about dice, you only need to read five different pips to establish the value shown!
People take their tabletop games very, very seriously. [Andrew Lauritzen], though, has gone far above and beyond in pursuit of a fair game. The game in question is Star War: X-Wing, a strategy wargame where miniature pieces are moved according to rolls of the dice. [Andrew] suspected that commercially available dice were skewing the game, and the automated machine-vision dice tester shown in the video after the break was the result.
The rig is a very clever design that maximizes the data set with as little motion as possible. The test chamber is a box with clear ends that can be flipped end-for-end by a motor; walls separate the chamber into four channels to test multiple dice on each throw, and baffles within the channels assure randomization. A webcam is positioned below the chamber to take a snapshot of each “throw”, which is then analyzed in OpenCV. This scheme has the unfortunate effect of looking at the dice from the table’s perspective, but [Andrew] dealt with that in true hacker fashion: he ignored it since it didn’t impact the statistics he was interested in.
And speaking of statistics, he generated a LOT of them. The 62-page report of results from his study is an impressive piece of work, which basically concludes that the dice aren’t fair due to manufacturing variability, and that players could use this fact to cheat. He recommends pooled sets of dice to eliminate advantages during competitive play.
This isn’t the first automated dice roller we’ve seen around these parts. There was the tweeting dice-bot, the Dice-O-Matic, and all manner of electronic dice throwers. This one goes the extra mile to keep things fair, and we appreciate that.
In the electronic battlefield that is 2019, the realm of password security is fraught with dangers. Websites from companies big and small leak like sieves, storing user data in completely unsecure ways. Just about the worst thing you can do is use the same password across several services, meaning that an attack on one gives entry to multiple accounts. The challenge is to generate a unique and secure password for each and every application, and [Ilia]’s way of doing that is called HashDice.
No, it’s not a password manager, or an app – it’s a simple method that can be readily applied by anyone with the right tools. A simple dice is used to create random numbers, which are used to select words from a list to form the basic secret phrase. This is then combined with the name of the service or application to be accessed, the date, and a salt, before hashing using the SHA256 algorithm. The final hash is then truncated to create the password. You can do it all on a device that’s airgapped from the world, ensuring your core secret is never exposed, thus maintaining security.
There are some pitfalls to this method, of course. Many websites make things harder by requiring special characters or enforcing length limits on passwords. [Ilia] helpfully suggests several workarounds for this, but admits that no system is perfect in the face of these obstacles.
We salute hackers who make technology useful for people in emerging markets. Leigh Johnson joined that select group when she accepted the challenge to build portable machine vision units that work offline and can be deployed for under $100 each. For hardware, a Raspberry Pi with camera plus screen can fit under that cost ceiling, and the software to give it sight is the focus of her 2018 Hackaday Superconference presentation. (Video also embedded below.)
The talk is a very concise 13 minutes, so Leigh flies through definitions of basic terms, before quickly naming TensorFlow and Keras as the tools she used. The time she saved here was spent on explaining what convolutional neural networks are and how they work, just enough to prepare the audience. But all of that is really just background, the meat of the talk is self-contained examples that Leigh has put together and made available online. I love to see that since it means you go beyond just watching and try it out for yourself. Continue reading “Leigh Johnson’s Guide To Machine Vision On Raspberry Pi”→
There are applications you can download for your smartphone that can “roll” an arbitrary number of dice with whatever number of sides you could possibly want. It’s faster and easier than throwing physical dice around, and you don’t have to worry about any of them rolling under the couch. No matter how you look at it, it’s really a task better performed by software than hardware. All that being said, there’s something undeniably appealing about the physical aspect of die rolling when playing a game.
Luckily, [Paul Klinger] thinks he has the solution to the problem. His design combines the flexibility of software number generation with the small form factor of a physical die. The end result is a tiny gadget that can emulate anything from a 2 to 64 sided die with just 6 LEDs while remaining as easy to operate as possible. No need to tap on your smartphone screen with Cheetos-stained hands when you’ve got to make an intelligence check, just squeeze the Universal Electronic Die and off you go. Granted you’ll need to do some binary math in your head, but if you’re the kind of person playing D&D with DIY electronic dice, we think you’ll probably be able to manage.
The 3D printed case that [Paul] came up with for his digital die is very clever, though it did take him awhile to nail it down. As shown in the video after the break, it took seven iterations before he got the various features such as the integrated button “flaps” right. There’s also a printed knob to go on the central potentiometer, to make it easier to select how many sides your virtual die will have.
In terms of the electronics, the design is actually quite simple. All that lives on the custom PCB is a ATtiny1614 microcontroller, the aforementioned LEDs, and a couple of passive components. A CR2032 coin cell powers the whole operation, and it should provide enough juice for plenty of games as it’s only turned on when the user is actively “rolling”.