Featured on hackaday, gizmodo and hacked-gadgets

Acceleration-Sensitive Led Matrix

  • Fact: I am a new D&D player.
  • Problem: Having to roll many kinds of dice, which get lost and end up it other player's hands.
  • Solution: Build an n-sided dice.
  • Method: Take two 5×7 led displays, connect them to an ATmega168, toss in a Freescale's 3-axis MMA7260QT accelerometer and program some code.

Video

Design

The cube is driven by three 1.5V small button cells (which are sold here as batteries for EasyPark computerized parking ticket). The brain of this gadget is a ATmega168. The ATmega168 is programmed using avr-gcc and avr-libc. The MCU is connected to the matrices using a ULN2008 as a current sink and a 74LS164 as led driver. For extra fun I pulled a speaker from a Nokia mobile phone and connected it as well.

Construction

Wiring

The whole circuit is soldered on a perf-board. All of the connections were made by soldering wire-up wires. I hate wrapping wire-ups and when I built this thing I wasn't capable of producing double-sided PCBs, so that's what I chose. I covered the wire-side of the PCB with perspex in order to protect it from tearing apart (which happened quite a lot!). You can see the wire-up work here: Bottom view of the cube

Accelerometer soldering

The fun part was connecting the MMA7260QT to the rest of the circuit. The accelerometer is very small and comes packed as a QFN16. The method I chose to connect the chip is as follows:

  • First I glued the chip to a tiny piece of perf-board with some hot-glue1)
  • I plated the chip pads with a little bit of solder
  • Next I put small pieces of wire-up through the holes and while holding them aligned to the pads I reheated the solder with a fine solder pencil
  • Finally I fixed the whole thing with a blob of hot glue

Certainly not a job for the faint of heart. You can see the result in this picture: Top view of the cube

Software

I programmed the whole thing in C, using the avr-gcc toolchain in AVR-Studio. I needed to program a display-driver that go over all of the roles periodically and pushes the proper bitmask to the serial shift register that drives the LEDs.
I also put in a menu system. When powering up the device it lets the user to select an application. The few applications I programmed so far are the dice application, and a “display test” application which scrolls lines accross the screen. This is useful to find a faulty wiring in the display…

Dice Application

The dice is very simple. First you select the number of sides of the cube, and then you just tilt the cube. The tilting detection was done by taking samples of the absolute acceleration vector for the last 100ms time-window and then calculating the deviation of the series. If the deviation is bigger than a certain value for a certain amount of time the dice is considered as “rolled”. When that happens the device will use the avr-libc supplied PRNG to select a number.

Afterthoughts/TODOs

  • Instead of using the ULN2008 I could have lit a single led each iteration instead of lighting up an entire row
  • Need to implement power saving mode, battery runs out too damn fast
  • Apps to implement: pedometer, red flashlight, marble and holes game…
  • Construct next version on a double-sided PCB:
    • Make it thinner
    • Use SMT ICs, and try to consume less power
    • Use better batteries

More Photos

~~DISCUSSION~~

1) in my opinion, the person who invented hot-glue should receive the Nobel prize

Linkbacks

[...] Led Matrix Dice [...]
 
Digital Dice | News for Geek, 2009/05/21 08:09 (Pingback)
[...] built some digital dice [...]
 
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Led Matrix Dice [...]
 
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
[...] Led Matrix Dice [...]
 
[...] Itay's Showcase [...]
 
[...] Itay's Showcase [...]
 
 
projects/ledmatrix.txt · Last modified: 2014/05/07 16:42 by itay · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki Creative Commons License Get Firefox