Hardware

Overview

Want to see videos of the construction?  Check out the Construction page!

The All Spark Cube is a 3 dimensional, RGB LED Matrix, organized as a Cube structure.  The LED leads are interconnected by 16 gauge buss wires, which both provide the physical support structure for the LEDs and electrical connections to the controller hardware.  The entire matrix is constructed in 16 panels of 16 x 16 LEDs each.  Each panel is installed onto a laminated strip which, when installed in the custom cabinet, becomes the counter top surface to give the illusion of a free-standing LED cube on a countertop.   The entire structure is covered by a 3/8” thick clear acrylic box.

Each LED panel is controlled by its own identical custom controller located in the cabinet below the LED matrix.  Each controller is configured with a unique address by on-board DIP switches.  An Arduino Mega 2560 microcontroller development board was chosen as the power plant for the controller to simplify the overall design while providing the high number of Pulse Width Modulation (PWM) ports required to operate the Cube.






Hardware Design

The controller design uses three separate hardware multiplexers – one for each of the three colors in the LEDs – plus a row selection multiplexer.  The quad multiplexer arrangement minimizes the number of Microcontroller pins required to just 16 pins — over 1000 pins would be required for non-multiplexed, independent access to each LED!  By using a custom multiplexer design, 12 pins control three colors in each of four LEDs at a time.  Only 4 LEDs are turned on (on each panel) at any moment.  The design takes advantage of Persistence-of-Vision – by switching the LEDs on sequentially at a very fast rate, all LEDs in the entire display appear to be on at the same time.

Kevin designed a custom printed circuit board (PCB) with headers on the back-side to attached an Arduino Mega 2560 Microcontroller Development Board, which gives the Controller Board an Atmel ATMega 2560 Microcontroller, power supplies and other generic features.  The Arduino minimized the amount of PCB design work that he had to do and allows the Microcontroller to be changed out if necessary for future upgrades.  The Arduino is connected as a daughterboard on the back of the Controller PCB.

Each LED panel is controlled by one of these custom printed circuit boards.  Each board uses socket mounted circuit chips and other components.  Each is approximately 6” square and contains power protection circuits, current limiting circuits to protect the LEDs, separate power supplies for the LED voltage (24 volts dc) and for the control circuits (5 volts dc), and the 4 multiplexers.  Various indicator LEDs provide means for troubleshooting and for indicating the operating status of the controller.  The Arduino Mega 2560 installs onto the back of the controller board. 

Light Emitting Diodes

Each LED in the Cube matrix is called an RGB LED.  The term LED is acronym for Light Emitting Diode.  It’s a special kind of semi-conductor device that create light of a specific frequency when a current is applied across it in one direction only.  Current will not flow “backward” through the LED, therefore the LED can be switched on and off by changing the polarity of the voltage cross it.  The cube uses this feature to blink the LEDs very rapidly to provide the effects it displays.  Light emitting diodes also consume very little energy, which is a plus in the Cube design.

The “RGB” part of RGB LED refers to the LED Colors — Red, Green and Blue.  The LED device actually contains three separate LED, each of which generates a different color light – one of the three primary light colors.  The Cube controller hardware “mixes” different intensities of these three primary colors to create over 16 million different colors.

Pulse Width Modulation

Color mixing is accomplished through a process called Pulse Width Modulation.  The idea is to turn each colored LED on and off at a very high rate.  The ratio of on-time to off-time (also called duty cycle) controls the perceived intensity of the LED color.  A high duty cycle – meaning the LED is on for a longer time than it is off – generates a brighter LED.  By controlling the Duty Cycle on the LED, its intensity can be controlled.  Furthermore, by turning on each of the three RGB LED colors with different duty cycles at the same time, the Microcontroller can “create” virtually any color.  For example, if we turn on the Red and Green LEDs, while leaving the Blue LED off, we get a Yellow colored light.

The ATMEGA 2560 microcontroller has built-in PWM capability on 12 pins (actually 14, but we don’t use 2 of them), which allows the Cube control software to generate the Cube colors.  We call these pins Color Select Pins and they will be described in more detail in the next sections.  The microcontroller software turns on these PWM pins to generate the desired color and the hardware multiplexers pass the color signals to the LEDs using a multiplexing technique.

Column Select Multiplexers

Each of three identical “Column Multiplexers” operates one of the three LED colors in a vertical LED column.  The microcontroller has 12 available PWM pins and each LED requires three color controls, therefore the Microcontroller has sufficient pins to control up to 4 columns simultaneously.  Four additional microcontroller pins are used as Color Group Select lines.   Therefore 16 total Microcontroller pins are required to operate the Columns in the Cube.

Each LED Column (vertically oriented groups of LEDs in the Matrix) is controlled through a driver circuit by the Column Multiplexer.  The multiplexer circuits are wired such that the microcontroller can set the 4 color outputs to the value of 4 columns and then set one of the Color Group Select lines in order to apply a ground to the Cathodes of 4 columns.  When not selected, the cathode drivers are turned off (open) and the cathode connections cannot conduct.

One cathode driver is connected for each column.  We chose an octal NPN Darlington Pair chip for the low-side cathode drivers.  These devices act like switches with a positive voltage (logic 1) on the input acting as the “on” signal.  When one of these Drivers is turned on by a signal from the Column Multiplexer, a ground (the low-side) is applied to the Cathodes of all LEDs in one column.  Each Column in the LED matrix uses one dedicated driver in this section.

Row Select Multiplexer

A complete circuit through an LED is required to turn on an LED, therefore the LED needs a positive voltage applied to its anode, in combination with the ground applied to its cathode by the Column Select Multiplexers.  The Cube uses a 4th dedicated multiplexer as Row Selection circuitry.  The Row Select circuit consists of a 4-to-16 Binary Coded Decimal decoder, which uses just 4 microcontroller pins as inputs to uniquely select one of 16 Rows in the LED matrix.  This design reduces the number of Microcontroller Row Select pins from 16 to 4.

The 4 Row Select microcontroller pins can be set to 1 of 16 different combinations and those values are applied to the inputs on the Decoder.  The decoder translates the unique input combination to the single matching output pin.  For example, when all 4 inputs are turned off (code 0000), the decoder asserts output 1 and turns off all of the other 15 outputs.   If one of the inputs is turned on (ie. code 0001) then the decoder asserts its output 2.  This setup allows only 4 microcontroller pins to uniquely select exactly 1 of 16 rows in the LED Matrix.

The 4-to-16 decoder chip that we chose provides an active low output, which means that all outputs are HIGH (OFF) except for the one selected line, which is LOW (ON).  This design was intentional as the original design called for PNP MOSFETs as high side drivers.  Although it would have been an elegant design, I had trouble sourcing PNP MOSFETs (except for extremely tiny surface mount devices), therefore I changed the design to use an Octal PNP high-side Darlington Pairs chip as drivers.  Unfortunately, these drivers require an active HIGH input.  So we added Hex logic inverter chips between the decoder and drivers.  The net result is that any one of 16 Rows can be selected by encoding the 4 Microcontroller Row Select pins to the correct BCD Code.

Multiplexer Operation

To complete a circuit through the LEDs, a Row Selection logic circuit turns on the Anode side of one entire row at a time by applying the positive LED voltage to a buss wire common to all LEDs in the Row.  Simultaneously, the Column Select Multiplexers select and turn on the Cathodes on all LEDs in 4 columns.  The circuit will only be complete in the LEDs that have BOTH their cathodes and anodes active – the 4 LEDs in the Selected Row and Selected Columns.

This is the process used by the embedded microcontroller software to create a display.  Remember that this process occurs very fast (50-80 times per second) to give the view an illusion that all LEDs are on at the same time.

The microcontroller first turns off the Row Select decoder, which turns off all Row Drivers and effectively blanks the LED panel.  It then determines the color of the first 4 LEDs in the first (lowest) row of the matrix and sets the 3 color drivers for each column into the Color Select PWM pins and then turns on the first Color Group Select Line.  These values are instantly applied to the three color Multiplexers and the cathodes of the first 4 columns get turned on to the selected values.  Next, the microcontroller sets the 4 BCD Row Select pins to all LOW and the Row Select Decoder is turned back on.  This turns on the first Row Select Driver and applies the positive LED voltage to the Row 1 anodes.  At this point, there is a complete circuit from the LED power supply through the Row Select driver to the LED anodes and back to the negative Cathode drivers to ground for only 4 LEDs and those 4 LEDs turn on.

The Microcontroller Software then waits a few microseconds to allow the LEDs to come up to full brightness (and to give the viewers’ eyes time to recognize the LED color) and then the Row Select Decoder is turned off, which opens the high-side anode connection and the LEDs turn off.  The Microcontroller then looks up the next 4 LED color values and sets those values into the color pins and turns on the second Color Group Select line.  Now the next 4 LED Cathodes are enabled.  When the Row Select Decoder is again turned on, the circuit is complete through the next 4 LEDs and they turn on for a few microseconds.  This repeats for the two remaining Color Groups and one complete Row will have been displayed.   This entire procedure repeats for each row to display one Frame in the panel.  The entire process repeats as fast as the Microcontroller can work.

Note that the Display Multiplexer code in the Microcontroller displays whatever is stored in its local display buffer memory, which is updated by a central controller computer over a communication Buss (described later).  Therefore this cube architecture has no need for display synchronization between panels.  Each panel controller displays the contents of its local display buffer as fast as possible and the controller PC updates the local display memory via a communications channel.

Cube Communications

The Cube uses a flexible communications architecture consisting of add-on daughter boards.  A common buss is required for interconnection between the panels – RS485 and I2C are designed as options, but RS485 is the preferred method for our Cube.  The interface is selected and installed and then wired together to form a local network between the 16 controllers and a control PC.  The communications adapters are themselves stackable, so multiple interfaces can be added to a controller.  Kevin designed wireless interfaces and RS232 interface modules to provide flexible interconnection with the control PC.  In fact, it is literally possible to control the Cube over the internet through the use of a WiFi interface module.

 

Comments are closed.