We are trying to make a rollable dice with an Attiny85. It is supposed to be six-sided and responding on rolling. Just like a normal dice but with LED indicators instead of the normal dots.
So far, we have only been able to find examples of one-sided dice and we are starting to wonder whether this is even possible to do.
Any suggestions?
I cannot envisage what you are trying to do. A die has a different pattern on each side so do you only want the pattern on the top after rolling to illuminate, or something else ?
Ideal it would only light up on the topside, yes.
We are able to use either a LED Matrix or a LED Strip divided on a PCB board for each of the numbers a side.
Hopefully, this makes more sense.
OK, I was trying to think of how mercury switches would work and indeed, they would!
Now I figure that one of the four must be redundant, so three should suffice and a 74HC138 should do the job with no other logic components if you limit the LED current to 3 mA each.
And you could make a stand to sit it on the corner without the mercury switch to turn it off!
Nice. I’ll convince myself that you are correct later.
However, the “extra” switch is good for knowing that the cube is more or less upright. There is a smaller solid angle where A and D are closed (and B and C open) than just A closed…
This would leave the three real switches in a plane parallel to the floor where they might be either on or off and prone to changing as the angle of the plane changed, even very slightly.
Decoding that would show various sides up, all 6 possible, so there’ll have to be some kind of debouncing or other qualification it seems.
Yes yes, it took longer than I wish it had, and I can’t figure out how to share the drawing I made on this stupid tablet. At least I figured it out without firing up the 3D tools…
So I see:
With the D vertex down, tetrahedron vertices A, B and C will all be above the center of the cube, so A + B + C would reliably indicate that orientation and be a nice way to say something to the process watching the switches.
Very nice. Appy polly loggies, my friend. Step by step.
BTW I am surprised you can still get mercury tilts, are they NOS you found somewhere?
Don’t know, the picture I gave is a link to just one (the cheapest of course) of the many listing for packs of ten on Aliexpress and - though I already have some - just for fun I ordered another three packs while researching the topic. Who knows, it is remotely possible I may even build the cube!
I don’t show links for eBay as they have decided to obscure their image links from hyperlinking, so they clearly do not want to encourage purchases. Very strange concept of “marketing”.
Dare I say it, whatever the EU may think about mercury is entirely irrelevant in China!
Infrared short range proximity sensors may also work to determine which surface of the dice is face down. You’d need 6. Probably also a tilt switch or two to detect the initial movement, after which wait until one of the proximity sensors shows a stable close reading, display a result for X seconds, then the MCU sleeps until again woken by the tilt switches.
NOS = new old stock. Old things that have been waiting around to be sold at retail for the first time. Somewhere. Like tubes and Nixie displays and, um, mercury switches. We may one day have to buy NOS real solder.
Oh and incandescent light bulbs.
And I may try to use an accelerometer. I’ve wanted to do a dodecahedral object that knows what’s up. TBH the maths is more like something I never knew than have long since forgotten.
Not sure there’s a trick as neat as the tetrahedron/cube thing for tilts.