Leigh Johnson’s Guide To Machine Vision On Raspberry Pi

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”

Be Ready To Roll With Universal Electronic Dice

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”.

We’ve seen a number of very impressive electronic dice projects over the years, and it doesn’t look like the trend is slowing down anytime soon. Of course, if you absolutely must hear those physical dice rolling, we can help you with that too.

Making Fancy Dice PCBs At Home

These days, it’s easy to get high-quality custom PCBs made and shipped to your door for under $50. It’s something that was unfathomable only a decade ago, but now it’s commonplace. However, it doesn’t mean that the techniques of home PCB production are now completely obsolete. Maybe you live somewhere a little off the beaten track (Australia, even!) and need to iterate quickly on a project, or perhaps you’d like to tinker with the chemical processes involved. For your learning pleasure, [Emiliano] decided to share some tips on making SMD-ready PCBs with the TinyDice project.

The actual project is to create a small electronic dice, and [Emiliano] touches on the various necessary considerations such as how to decrease power consumption, and how to source good quality, organic random numbers from your local microcontroller. Though its far from an exhaustive discussion on either topic, it shows an understanding of the deeper factors at play here.

However, the real meat of the write-up is the PCB production process. The guide goes through several stages of etching to not only prepare the PCB but also to add solder mask and produce a solder paste stencil as well using an aluminum can. This gives the boards that colored finish we’re all used to and lets the boards be reflowed for easy SMD assembly.

It’s a tidy guide as to how to approach producing your own boards to be used with SMD components, and it’s complete with clear photos and instructions throughout. If you want to take your designs up another notch, why not consider putting your components inside the circuit board?

Spice Up Your Dice With Bluetooth

There’s no shortage of projects that replace your regular board game dice with an electronic version of them, bringing digital features into the real world. [Jean] however goes the other way around and brings the real world into the digital one with his Bluetooth equipped electronic dice.

These dice are built around a Simblee module that houses the Bluetooth LE stack and antenna along with an ARM Cortex-M0 on a single chip. Adding an accelerometer for side detection and a bunch of LEDs to indicate the detected side, [Jean] put it all on a flex PCB wrapped around the battery, and into a 3D printed case that is just slightly bigger than your standard die.

While they’ll work as simple LED lighted replacement for your regular dice as-is, their biggest value is obviously the added Bluetooth functionality. In his project introduction video placed after the break, [Jean] shows a proof-of-concept game of Yahtzee displaying the thrown dice values on his mobile phone. Taking it further, he also demonstrates scenarios to map special purposes and custom behavior to selected dice and talks about his additional ideas for the future.

After seeing the inside of the die, it seems evident that getting a Bluetooth powered D20 will unfortunately remain a dream for another while — unless, of course, you take this giant one as inspiration for the dimensions.

Continue reading “Spice Up Your Dice With Bluetooth”

Lathe Turns The Corner, Makes A Cube

[Tim] was tired of using his lathe to turn round things. He decided to make a gaming die—something that’s iconically square—out of cylindrical scrap. As it turns out, this is possible to do on a lathe with a three jaw chuck. [Tim] discovered that the bevel on the jaws will hold a cylindrical puck of scrap sideways while he squares off the round sides into faces.

Turning a cube on a lathe looks pretty fiddly, so we applaud [Tim]’s lovely handiwork even more. As you’ll see in the video down below, things were going gangbusters until he went to make the last facing cut. Maybe the tool wasn’t lined up just so, or something was off in the chucking, but the first pass made a bit of a gouge in the stock. Looks like it was easy enough to fix, though. After four 90° turns and facing cuts, he had a nice looking rough cube to work with.

This is a regulation-sized die, so the next step was to trim it down to 16mm³. Then it was time to sand, polish, and add the dots. To lay them out, [Tim] sprayed the cube with layout fluid and scribed unique line patterns on each face. Then he drilled the indentations and filled them in with aluminium black.

Most of the dice we see are electronic, like this extremely random pair and these PIC-driven LED dice. We’d like to see [Tim] make a second D6 so he has a pair. And then make a D20. Please?

Continue reading “Lathe Turns The Corner, Makes A Cube”

Giant D20 Is A Critical Hit In More Ways Than One

[Mikael Vejdemo-Johansson] is a member of the NYC Resistor hackerspace and an avid fan of a D&D themed improv theatre called The Campaign. To show his appreciation, he decided to gift them a Christmas present: a giant D20. The original plan called for integrated LEDs to burst alight on a critical hit or miss, or let out pulses if it landed on another face. Cool, right? Well, easier said than done.

[Vejdemo-Johansson] figured a circle of 4 tilt sensors mounted on the one and twenty face would be enough to detect critical rolls. If any of the switches were tilted beyond 30 degrees, the switch would close. He mounted eight ball-tilt switches and glued in the LEDs. A hackerspace friend also helped him put together an astable multivibrator to generate the pulses for non-critical rolls.

This… did not work out so well. His tilt sensor array proved to be a veritable electronic cacophony and terribly sensitive to any movement. That and some other electronic troubles forced a shelving of any light shows on a critical hit or miss. [Vejdemo-Johansson] kept the pulsing LEDs which made for a cool effect when shining through the mirrored, red acrylic panes he used for the die faces. Foam caulk backer rods protect as the die’s structure to stop it from being shattered on its first use.

Before The Campaign’s next show, [Vejdemo-Johansson] managed to stealthily swap-out of the troupe’s original die with his gift, only for it to be immediately thrown in a way that would definitely void any electronic warranty. Check out the reveal after the break (warning, some NSFW language)!

Continue reading “Giant D20 Is A Critical Hit In More Ways Than One”

7 LED’s, 2 Pins – Beat That, Charlieplexing

[Tim]’s Dice10 is an exercise in minimalism. Building an electronic dice using an ATtiny10 with code that fits within 1kB is not too difficult. Charlieplexing the LED’s would have used three of the four available GPIO pins. [Tim] upped the game by using just two GPIO pins to drive the seven LED’s for the dice. A third GPIO is used as a touch button input. Besides the ATtiny and the LED’s, the only other component used is a capacitor across the supply inputs.

2 GPIO for 7 LED's
2 GPIO for 7 LED’s

The LED’s are grouped in three pairs of two LED’s and a single centre LED. Usually, Charlieplexed LED’s are connected across pairs of GPIO pins. But his scheme includes connections to the 5V and GND terminals, besides the two GPIO pins. Building a truth table makes it easy to figure out what’s going on.

STATE PB2 PB0 LED's
1     Z   Z   --
2     L   Z   LED 1/2
3     H   Z   LED 3/4
4     Z   L   LED 5/6
5     Z   H   --
6     H   L   LED9
7     L   H   --
8     H   H   --
9     L   L   --

Only the logic states used are listed in the table. It’s possible to add two more LED’s between PB0 and GND and one more anti-parallel with LED9, making a total of 10 LED’s driven by two pins. That’s quite a hack. The important thing here is to have two LED’s in series in the arms that connect to either 5V or GND.

[Tim] has posted  the code and hardware source files on his Github repo, and his blog post has some additional details on how he solved the problem.

If you’re looking for more inspirations on minimal dice designs, check this “PIC powered pair of electronic dice” which uses a PIC 12F629 with five outputs driving a pair of 7 pips to make a dual dice.

1kb-thumb

If you have a cool project in mind, there is still plenty of time to enter the 1 kB Challenge! Deadline is January 5, so check it out and fire up your assemblers!