http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Food Living
Outside Play Technology WorkshopRGB 8x8x8 LED Cubeby Onyx Ibex on
August 28, 2014Table of ContentsRGB 8x8x8 LED Cube. . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Intro:
RGB 8x8x8 LED Cube. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 2Step 1: Skills and Materials Needed. . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 8Step 2: How it Works. . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . 9Step 3:
Circuit Design. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 10File Downloads. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . 11Step 4: Software /
Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 11Step 5: Soldering the PCB. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 12File Downloads. . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . 16Step 6:
Casing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 17File Downloads. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . 18Step 7: Soldering the
LEDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18Step 8: Final Assembly. . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 20Step 9: Pictures and Videos. . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 21Related
Instructables. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . 24Advertisements. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . 24Comments. . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .
24http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Intro: RGB
8x8x8 LED CubeFor those unfamiliar with LED cubes, they are simply
a 3-dimensional array of LEDs that make for interesting displays.
My project here is not the first RGB LED cube, noris it the best,
but I am documenting my process because while designing this cube I
appreciated every resource on 8x8x8 RGB LED cubes I could find. My
goals for thisproject were to create an 8x8x8 multicolor (RGB) LED
cube cleanly. That is, with all the electronics contained neatly.
Additionally, I wanted to use Arduino code to makeit more
accessible to others and for ease in upgrading. More on this later
though.The hardest challenge was in making the LED frame straight
and square. As with most things, quality depends on how much time
you put into it. If I were to redo thisproject that would be the
step I spend the most time trying to get right. Overall the project
was rewarding in the end and I would say don't be intimidated by
the amount ofwork needed for design and assembly.I started this
design over a year ago but didn't have the time to work on it for
many months unfortunately so I hope I can provide a comprehensive
description of theprocess :) As always I will be happy to answer
questions in the comments!I would also like to point out that along
the design and assembly process I learned a lot from some of the
other well-documented RGB LED cubes out on the
internet.Particularly I recommend taking a look at Kevin Darrah and
Nick Schulze. A majority of my work here was based directly on the
work of Kevin Darrah on his
cube.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Step
1:Skills and Materials NeededThe project requires a lot of
soldering. However, none of it is difficult and a beginner solderer
would have no problems. I used all through-hole components
(althoughSMD would have been nicer).Comfort with the Arduino IDE is
a bonus but not needed unless you want to change the code.As for
materials, you will need the following:Soldering iron + solderHand
tools such as tweezers, needlenose pliers, and snipsArduino to use
as programmerAtmega328p512 RGB LEDs (common anode, diffused)Copper
wire (I used 24 gauge but thinner would be better)16MHz
oscillator25 74HC595 shift registers136 100 ohm resistors64 125 ohm
resistors212 1k ohm resistors2 10k ohm resistors2 22pF
capacitors0.1 uF capacitor (electrolytic)10 uF capacitor
(electrolytic)100 uF capacitor (electrolytic)1000 uF capacitor
(electrolytic)25 16-pin IC sockets1 28-pin IC socket2x5 AVR ISP
header200 2N3904 transistors8 IRF9540 P-channel MOSFETs (overkill
but I had them on-hand)Power plugPower button5V power supply (1A is
sufficient)Additionally, I had a PCB made for the base of the board
to save time and costs on wire management. This also meant I had to
make sure my designs were right in thefirst try. While everything
worked great, there are things I would upgrade (such as SMD
components or swapping individual parts) if I were to do this
again. I also had abase enclosure laser cut to hide the PCB and
give it a cleaner look. The files for both of these parts will be
included in later
steps.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Overall
cost for everything above was $80 for all electronics and LEDs, $28
for the PCB, and the base I was able to have laser cut with scrap
black acrylic I had sittingaround. I priced it out on ponoko as
costing $50 but I suggest visiting your local FABlab or makerspace
to save costs.Step 2:How it WorksMy LED cube, like nearly every
other one online, uses multiplexing to give instructions to each
LED. It is very similar to every other LED cube you see on
instructablesand elsewhere. I am going to leave the description out
for this instructable because there are so many other well-written
pages on this by now. If you want moreinformation I encourage you
to read more from the well documented pages below:Kevin DarrahHow
Not To EngineerCHR (Instructables)Google it! There are lots of
results :)If these don't satisfy your curiosity, post your
questions in the comments and I will do my best to
answer!http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Step
3:Circuit DesignKnowing how you want to board to work brings us to
actually designing the circuitry needed to operate the cube.
Knowing that we will be using a microcontroller at thebrain of the
cube, and somehow using connects, we first need to design the
circuitry for the anode and cathodes.The anodes will use the
P-channel MOSFETs to switch between layers for the multiplexing.
Meanwhile a transistor array will provide power to the cathodes for
each LEDcolumn. The shift registers (74HC595) will control the
transistor array by reading in the serial output of the
microcontroller and converting it into a parallel output on
theshift register.Lets break it down even further (skip over if
understood):Cathodes(going backwards from the LED itself) A series
resistor sets the approximate target voltage for the LED (125 ohm
for red, 100 ohm for blue and green). This is tied to thecollector
of a transistor which emits to ground when the base is triggered by
an output pin on the shift register with a 1k ohm resistor in
series (between pin andtransistor). An example with the one line
hooked up is shown below.Each shift register will have 8 outputs so
can control 8 pins. Since each LED requires 3 pins (red, green,
blue) and since there are 64 columns (8 x 8) we need to have 64x 3
= 192 pins. This works best if we divide the shift registers in
groups of 3 (one set for each color). So now we have 3 columns of 8
shift registers (for a total of 24 shiftregisters so far).AnodesThe
anodes control each layer by toggling a transistor (MOSFET below)
from another shift register. This time we only need one shift
register. The 8 output pins on theshift register control the 8
layers. The values for this shift register is shifted out in the
same serial line that gets delivered to each of the other shift
registers from themicrocontroller. For each of the other layers,
you will just copy the circuit below and attach it to the next pin
on the shift register.MicrocontrollerThe microcontroller is an
Atmega328P-PU running the arduino bootloader. There are 6 main pins
that you have to worry about (apart from the crystal and power
lines):pin 1 - Reset, pin 4 - latch, pin 4 - latch, pin 6 - blank,
pin 17 - data/MOSI, pin 18 - MISO, pin 19 - clock/SCK.Pins 1, 7, 8,
17, 18, and 19 can be used to provide an ISP programming header for
re-programming the board later if desired (not needed).The latch,
blank, data, and clock pins will be used to control the cube
through the shift registers. The LATCH pin on the microcontroller
connects to pin 12 of the shiftregister (74HC595). DATA connects to
shift register pin 14. CLOCK connects to shift register pin 11.
BLANK connects to shift register pin 13.PowerThe board requires a
5V power supply. To filter noise on the input supply, capacitors
are used at few ranges. This part is completely up to you for what
you feel isnecessary. I used a 0.1uF, 10uF, 100uF, and 1000uF
capacitors but this was pseudo-arbitrary.The full schematic and all
EAGLE board files are included in the zip folder on this step. In
it you have everything that you would need to have the boards
printed
off.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/File
DownloadsRGB_LED_Cube.zip (1 MB)[NOTE: When saving, if you see .tmp
as the file ext, rename it to 'RGB_LED_Cube.zip']Step 4:Software /
CodeOriginally I started writing code in the Arduino IDE to control
the cube but was having difficulties where occasionally the cube
would just stop working until you reset it.After a long period of
debugging I decided to switch to the fantastic Kevin Darrah's code.
His entire webpage was a huge resource along this entire process as
Imentioned earlier. I don't think it is appropriate to re-post his
code here so I suggest you follow the link to his website and
scroll down to the code section. I am using theArduino code rev
12.I will go into how I programmed the Atmega328p chip though.
First off open the Arduino IDE (assuming you have already
downloaded it). We will be following the Arduinoguide for burning a
bootloader and uploading to a breadboard. We will be using the
arduino board as an ISP programmer. First, in the Arduino IDE open
up the exampleArduinoISP and upload it to your Arduino.Then,
following the diagram below hook up:Arduino pin 11 to atmega pin
17Arduino pin 12 to atmega pin 18Arduino pin 13 to atmega pin
19Connect Power and GND linesConnect Reset and add a 10k ohm
resistor to VccAdd crystal oscillator and 22pF capacitors to atmega
side.Next you will go to tools and select Arduino Duemilanove from
the Tools > Board menu. Also, change the programmer to Tools
> Programmer > Arduino as ISP. Now youare set to burn the
bootloader. Go to Tools > Burn Bootloader. Once completed go
ahead and remove the cables from the breadboard.Next we will
program the new atmega328p with the cube code. The easiest way to
do this is to take a pair of tweezers and gently pull the
microcontroller out of theArduino you just used to burn the
bootloader (dont get these chips mixed up now) and swap in the new
microcontroller into the Arduino's IC socket. These twoatmega328p
chips should be identical now except for what is programmed onto
them (they both have the same bootloader though). Open up the cube
code and upload itto the Arduino as you would normally. Then gently
lift it out again (avoid bending pins as much as possible) and swap
the original back in. You now have a fullyprogrammed microcontrller
with the cube code on it. Once you place it in the circuitry that
we will build later it will be all set to run.There are many other
ways in which to program the microcontroller but this is the only
method I am showing here. Feel free to use whatever method you are
mostcomfortable
with.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Step
5:Soldering the PCBThis is a pretty straightforward process if you
are using a PCB like I did. If you are using other prototyping
techniques for the components you will need to deal with
thesoldering and wiring in your own ways. If you aren't using my
PCB (which you can always re-make yourself from a board
manufacturer using the files at the end of thisstep) you may want
to skim or skip this step.The images in this step along with
directions are also included as a pdf on this step. Following the
pictures in any order, solder the components for each step. Each
step'scomponents are highlighted in the corresponding picture. I
found it helpful to place components in from topside and then
solder from the back (side with less silkscreen).The opposite
direction will be used when soldering on the LED columns in a later
step.Step 1: Solder in the 28-pin IC socket for the atmega328
microcontrollerStep 2: Solder in the 16-pin IC socket for the
74HC595sStep 3: Solder in two 10k? resistorsStep 4: Solder in the
1k?
resistorshttp://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Step
5: Solder in the 125? resistorsStep 6: Solder in the 100?
resistorsStep 7: Solder in the 4 electrolytic capacitors (in any
positions)Step 8: Solder in the 16MHz crystal and the two 22pF
capacitorsStep 9: Optionally solder in the 10-pin ISP headerStep
10: Solder in the 8 IRF9640 transistors (flat backing towards
center of board)Step 11: Due to an error in board design you will
have to solder the first 2N3904 transistor in backwards. Simply
bend the pins mirrored to how you would the othertransistors. The
silkscreen on the bottom of the PCB identifies how to insert it on
the backside, but we want it inserted on the topside so that the
board fits in the casing.Step 12: Solder in the rest of the 2N3904
transistors. The image should do a better job explaining how to
insert the transistors than I can explain in
words.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/File
DownloadsSoldering Instructions.pdf (970 KB)[NOTE: When saving, if
you see .tmp as the file ext, rename it to 'Soldering
Instructions.pdf']http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Step
6:CasingBefore continuing on to solder the LEDs to the PCB, it was
necessary to insert the top layer of the laser cut case. The top
panel had holes laser cut exactly where thecolumns would slide into
the PCB holes for soldering so it was easy to align. The case is
simple to assemble and can be glued together using a small dab of
superglue.The bottom panel will be the very last thing we put onto
the cube at the end.Alongside the box as shown in the pictures
above, I cut out a jig to aid in the soldering of LEDs. This was
just a backbone acrylic with 8 slots for LEDs to fit into and
holdthe bracing wires in place while I soldered them in. This is
shown in the last 2 pictures above.Lastly, there are some extra
tabs in the laser cutting file that can be used to glue in place
the PCB to the top of the box. They aren't needed but can be
helpful duringsoldering.The svg for the laser cutting file is
included on this
step.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/File
Downloadsrgb_led_cueb_final.svg (449 KB)[NOTE: When saving, if you
see .tmp as the file ext, rename it to
'rgb_led_cueb_final.svg']Step 7:Soldering the LEDsThe video below
does a better job showing the procedure for soldering in the LEDs
than I will be able to type out. Basically, what you need to do is
solder individualcolumns into the PCB one at a time. To do
so:Thread 3 copper wires through the holes and solder them to the
PCB. I always threaded from the PCB side through the acrylic side.
1.Bend the leads as shown for 8 LEDs. 2.Pop the LEDs into the jig
(in the shown orientation with the common lead (longest) back)
3.Slide the jig into position against the copper wires 4.Solder
each LED in (3 point per LED, 8 LEDs per column) 5.Clip excess
leads off 6.Slide jig up and away from wires and LEDs 7.***Every
other sheet of columns (starting with the first sheet) must have
the common pins connected with rows of copper wire. see below***
8.I forgot to include in the video how to connect the common anodes
between columns. Hopefully the pictures below help clarify this. In
the first picture below you can seethe rows that must be added to
connect the anodes to each other. Highlighted in red are the rows.
Highlighted in yellow are the common anode pins. Note how the
pinsalternate which direction they point such that you only need
half the number of rows (each pair of sheets shares a set of rows
instead of each sheet having its own rowsto collect anodes). The
picture below illustrates this by showing the first two sheets of
LEDs sharing one row per layer (layers are horizontal, sheets are
vertical). I hopewhat I am trying to say makes sense. If not, let
me know and I will try to re-write this page or
video.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Image
Notes1. Notice how the grooves match up with the wiresImage Notes1.
Common pin point
backhttp://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Step
8:Final AssemblyAlmost done!Solder in the power jack and power
switch. They should screw into the holes that were laser cut into
the sides. The diagram shows the proper polarity of the dc
powerjack and how those wires meet up with the power switch before
connecting with the PCB.Finally, with much pride, pop the bottom
acrylic panel onto the back of the case! If you don't glue it, it
should be firm enough to stay on but is removable in case you
needto get back in to the microcontroller or to fix a soldering
mistake.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Image
Notes1. Short these two wires together2. From dc power jack3. Power
supply for entire PCBStep 9:Pictures and VideosFinally, here are
some pictures and videos of the finished project.For more
information and pictures on the assembly process and final product,
see my website for this
project.http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/http://www.instructables.com/id/RGB-8x8x8-LED-Cube-1/Related
Instructables4x4x4 RGB LEDCube by rojmLED CUBE8x8x8 (8051
VN)(Photos) byinc409Use 8x8x8 RGBLED Cube onpcDuino byYanny
GuoSelf-Contained7x7x7 LED Cubeby lopuz38x8x8 led cube(build)
byfallinsquirrel8X8X8 3D RGBLED Cube
bySuperTech-ITAdvertisementsComments1 comments Add
CommentMsSweetSatisfaction says: Sep 6, 2014. 8:37 AM REPLYAwesome,
I love all the color patterns! Thanks for sharing!