A CharliePlexed RGB LED Dice
3 Steps
This Instructable will show how to make a colourful dice using the technique of charlieplexing with RGB LEDs.

The project uses 7 RGB LEDs arranged in the form of dice.Each RGB LED has three separate LEDs inside so that makes a total of 21 LEDs and they have been controlled by 4 I/O pins of ATTiny13V Microcontroller.But according to the theory of CharliePlexing,we can only control 12 {n(n-1)} LEDs from 4 I/O Pins.

Actually the arrangement of the LEDs in the form of dice is such that they can be divided into four groups.Three having two LEDs each and one having single LED . The LEDs of each group are ON and OFF simultaneously and can be connected to same I/O pins with same enables.In short , they are treated as single LEDs.So that makes total of 4 RGB LEDs to be handled by the code ( 4 x 3 = 12 so charlieplexing holds)'

The 5 I/O pin of the Controller is used for Switch which when pressed generates random numbers from 1 to 6 and when released generates random colours( 6 in all)

Remove these ads by Signing Up

## Step 1: Circuit Description

The circuit consists of tiny 13 , 7 RGB LEDs ,few resistors and a microswitch apart from power supply connections.The schematic in PDF and SCH format is available here

The resistors used in the circuit are in the form of arrays as shown in the image below.

CHARLIEPLEXING

Charlieplexing technique uses all the three possible states : 0,1 or Z ( High Impedance state) of the digital I/O pin of a microcontroller .It manages to control N*(N-1) LEDs using N digital pins. In this technique only one LED can be controlled at a time and hence all the LEDs to be controlled should be refreshed at a suitable frequency so that they appear stationary.

The LED to be controlled at a particular time has its I/O pins (to which it is connected ) declared as output and all other pins are declared as input ( High Impedance or 'Z' state)
btaskiran says: Apr 19, 2012. 12:50 AM
Nothing new nothing fancy here. They made it picbasic forum at 2006. Try that link; http://www.picbasic.co.uk/forum/showthread.php?t=3510 maybe minor differences but same idea, same technic, different micro.
robot1398 says: Jun 16, 2011. 9:58 PM
granjef3 says: Jun 25, 2009. 9:29 PM
Cool, I am the 5,999 viewer!
Robot Lover says: Aug 2, 2010. 8:09 PM
i am the 9038
RMahnA2 says: Dec 25, 2008. 7:11 AM
You say "In this technique only one LED can be controlled at a time". It's my understanding that with charlieplexing you are able to have n-1LED's on at a time. Is your statement saying you are controlling the three LEDs (x2 for each color in the paralleled chip) in the chip at the same time ?
sotsirh194 says: Dec 8, 2008. 4:40 PM
What programmer and software did you use?
cedtlab (author) says: Dec 8, 2008. 10:21 PM
STK500 and AVR Studio to program the chip. Source code is given in step 3 of this instructable.
brianpxbd says: Nov 17, 2008. 10:04 AM
I think your idea deserves 5 Stars, I was going to submit a design of mine, but looking at your design, My design was simple PIC driven, I give up! Your idea is great and does more than expected at a low cost. Congratulations and have a good day
brianpxbd says: Nov 17, 2008. 10:09 AM
For My curiosity, your spot board (or whatever you call your PCB, looks home made, the drillings I mean (the hole edges are a bit rough like they were drilled and not punched). Did you make that as well, if so I commend you for your patience.
cedtlab (author) says: Nov 17, 2008. 12:23 PM
Thanks. Just uploaded pictures of a new version of the PCB. The new PCB was done with a Modela milling machine. The newer version of the dice also uses larger size RGB LEDs. The earlier version used commercially available, general purpose PCB with 0.1 inch pitch holes. Yes, the holes seem to be drilled and not punched.
Stormed says: Jul 18, 2008. 3:47 PM
That's quite cool. I could imagine using that in some nighttime game of D&D or something. All you need is a d8, d10, d12, and d20 to be electronically simulated with pretty colors :D