Running LED dice


Raj over at Embedded Lab has published a new build, a running LED dice using PIC12LF1822 microcontroller:

This project is about a similar LED dice but with a slightly different output form. It uses 6 LEDs which are arranged in a circular pattern and are labeled 1 through 6. They create a chasing effect when the dice is rolled. The chasing effect slows down gradually, and eventually stops at one of the six LEDs. The rolling is done by a gentle shaking of the dice horizontally. The LED dice is powered with a 3V coin cell battery and uses PIC12LF1822 microcontroller to generate a random number and drive the output LEDs.

Check out the video after the break.

Join the Conversation

1 Comment

  1. There is another kind of vibration sensor that uses a spring and a metal post, but maybe that one is too sensitive.

    Enable the pull-up (WPUA2), and we can save 2 resistors. I have used ball-in-can tilt sensors, never needed to use a single resistor when using internal pull-ups.

    An on/off switch should not really be needed, since the PIC12LF1822 uses tens of nanoamps in sleep mode. If the author experienced excessive sleep current, then may I suggest the following:
    (a) tie MCLR to VCC to minimize GP2 power draw (internal pull-up for MCLR didn’t work on at least one PIC I used, whatever I did, so I dunno about this one)
    (b) set PORTA pins to output LOW on sleep, TRIS high will just let the pins pick up stray voltages or charges and nudge the input FETs out of saturation, leading to sleep power wastage
    (c) make sure WDT and BOR are disabled

Leave a comment

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.