DIY LED Canton Tower

Charlee Li
Nerd For Tech
Published in
6 min readSep 29, 2021

A couple of months ago I accidentally bought 400 auto-flashing LEDs thinking they were white LEDs. The auto-flashing feature is amazing but pretty annoying too, because there’s no way to control the animation. But the bright side is that this LED has only two terminals that can be easily used in any LED projects while still producing fancy effects, unlike a regular RGB LED that has four terminals which would make the hardware connections more complicated.

The auto-flashing LED

So I tried very hard to find some project ideas to use these LEDs until I saw this video:

The DIY kit can be easily found at eBay or Aliexpress. The DIY kit has single-color version and colorful version. Not surprisingly, the tower is made of two-terminal LEDs instead of regular RGB LEDs because of simplicity, but auto-flashing LEDs are used in the colorful version! Oh I’ve found a perfect way to use these LEDs!

Design

I watched the videos several times and tried to reverse engineer its design. Obviously, the Tower itself is a LED matrix. The animations can be done simply by turning some rows or columns on. If we don’t need to show text, no scanning is required, so the control is much easier than my previous LED Matrix project.

The controller board of the DIY kit uses a 8051 MCU (probably STC89C52RC). The ICs for controlling the LED matrix should be 74HC573 (latch IC).

I have some STC89C52RC, but I don’t have any 74HC573. But that’s not a problem: I can use 74HC595 instead, which would make the hardware much simpler.

So the ideas are simple:

  • Build a 16x16 LED matrix (16 layers x 16 columns). Layers are common anode and columns are common cathode.
  • Use transistors to provide current to the LED matrix. Use PNPs to provide current, and NPNs to sink current. I happened to have some ULN2803A that can be used instead of discrete NPN transistors. It also has 2.5k base resistors so that it can be connected directly to the output of 74HC595 (compared to the discrete PNP transistors on the other side, 1k resistors are required between the transistors and the 74HC595). This would simplify the hardware a lot.
  • Four 74HC595s to control the rows and the columns.
  • An STC89C52RC to control the animation.

Here is the schematic of the control board (LED matrix not included):

Schematic of the controller board

Since I’m going to use a perfboard for this project, the PCB design is manually routed:

PCB of the controller board.

Building the Tower

The DIY kit includes a stencil for layouting the LEDs. I don’t have the stencil but it can be made easily. I copied the image of the stencil from the video and adjusted its size so that the diameter of the holes are exactly 3mm (for 3mm LEDs). Then I transferred the position of the holes to a piece of thin MDF sheet with a needle.

Transfer the holes to a MDF sheet

Then I drilled the holes with a 3mm bit to create the stencil.

With the stencil, the soldering should be pretty straightforward:

  • There are nine different-sized circles, each circle has 16 holes. These are used to build the layers of the tower.
  • The inner-most pentagon is for the tip of the tower.
  • Bend the anode of the LED (the longer terminal) and connect them togetoer to make a ring. The cathode (the shorter terminal)is left untouched.

Now its time to connect all the layers. Simply solder the cathodes of each layer:

Here is the completed LED tower. The tip of the tower consists of 5 layers, and each layer has 5, 5, 5, 1, 1 LEDs respectively. These LEDs simply share the same anode with the 16th layer of the tower body, and the cathodes are connected to random columns.

Now it’s time for wiring. I used two 16-pin headers on both side of the board. One header connects to the 16 columns of the tower, and the other header connects to the 16 layers of the tower.

The back side of the board.

Building the Controller

The controller board is relatively simple with the PCB design given above. Something to note are:

  • A micro-USB connector board is used to provide 5V power.
  • The 3-pin header on the bottom-right is connected to a button on the LED Tower board, which is used for switching animations.
  • The reset circuit (C1 and R33 in the schematic) is hidden under the 8051 MCU.

Here is the wiring on the back of the board.

Programming

You can find the complete source code on my GitHub.

8051 programming is pretty self-explaining so there are not too much things I need to explain. The core function is to send data to the 74HC595 ICs:

sbit DATA = P2 ^ 0;
sbit LATCH = P2 ^ 2;
sbit SHIFT = P2 ^ 4;
#define set_data(x) DATA=x
#define set_latch(x) LATCH=x
#define set_shift(x) SHIFT=x
/**
* Send row and column data through 74HC595.
* Row order: top layer => bottom layer
* Column order: clockwise
*/
void send_data(unsigned int row, unsigned int column) {
int i;

set_latch(0);

// row first, then column
// row is active low, column is active high

row = ~row;

for (i = 0; i < 16; i++) {
set_shift(0);
set_data(row & 0x0001);
row = row >> 1;
set_shift(1);
}
for (i = 0; i < 16; i++) {
set_shift(0);
set_data(column & 0x0001);
column = column >> 1;
set_shift(1);
}
set_latch(1);
set_shift(0);
set_latch(0);
}

Demonstration

Finally here is the working LED Tower!

Conclusion

  • This project used 273 auto-flashing LEDs and successfully reduced the stock level.
  • Since 8051 has 4 sets of outputs (P0 ~ P3), I considered of connecting P0 and P2 directly to the LEDs to reduce two 74HC595s. But later I realized that pull-up resistors are required for P0 port, and additionally the rows and columns have to be controlled in different ways, which could make both hardware and software more complicated.

And finally, thanks for reading!

--

--