Charlieplexing is a technique proposed in early 1995 by Charlie Allen at Maxim Integrated. It allows the driving a multiplexed display using relatively few I/O pins on a micro-controllers.
The technique uses the tri-state logic capabilities of micro-controllers and the unique characteristics of LEDs to gain efficiency over traditional multiplexing. The are practical limits to how big of an LED array can be used, principally because of issues including duty cycle, current requirements and the forward voltages of the LEDs.
In this project 14 LEDs are driven using only 5 Digital I/O signals of the Microchip PIC16LF1509. A simple Finite State Machine (FSM) is employed on an Interrupt Service Routine (ISR), each time the interrupt occurs the FSM updates one LED, then advances to the next LED. A timer (Timer0) is configured to produce an interrupt to ensure that each LED has a time slice and will be updated at 100 times a second so that there is no apparent flicker on the display.
The main loop of the Dice project polls a push button, while the button is down random numbers are calculated and updates values that the FSM ISR uses to update the LEDs. This creates the effect of dice being rolled. When the button is released a few more dice values will be calculated with time delays to simulate the dice coming to a rest. The final dice values will be displayed for a few seconds, then the micro-controller will turn off the LEDs and go into low power sleep mode. In sleep state, the battery will last for a very long time. The push button is connected to an interrupt so that pushing the button can wake the micro-controller from sleep mode and start the dice rolling again.
Physically the Dice is about 1 inch wide and 3 inches long. There us a mounting hole at the top, suitable for attaching to a chain or chord and worn like a necklace. There is a small coin cell battery on the back-side of the circuit board which provide enough power for many rolls of the dice.