DIY LED cube Arduino circuit. LED Cube

January 14, 2016 at 01:42 pm

LED cube 8x8x8, interesting and beautiful

  • Circuit design

Introduction

This idea came to my mind spontaneously; until the fall of this year, I could not even guess that people were doing something similar in life. In fact, a circuit design teacher told me that such “cubes” exist and suggested taking this topic as a coursework.

Looking ahead, I would like to say that you don’t need to think about the amount of work as something colossal. On the contrary, I had to do very little, but those who think: “Ha, I’ll do it in a couple of days,” get ready for the opposite. And the process itself involves you in work no worse than writing some program code...

Watching the small works, measuring 3x3x3, and 4x4x4, and 5x5x5, I slowly realized that the bigger the better.

Milestone #1:

If you have not worked with a soldering iron before, first realize that you will need to solder all the legs of the LEDs, this is 2 * 512, not so little. So practice on some cats.


The Internet is full of instructions on this topic. But from start to finish, I think I saw it only on instructables.com, and I’ll say right away that it’s somehow too detailed in terms of everything. I personally used two times less components. Naturally, the equipment turned out to be simpler. As a result, for our small toy we need:

512 LEDs ($6 - aliexp)
- 5 special chips for LEDs STP16CPS05MTR ($9 - aliexp)
Naturally, it is more profitable to take such parts in batches
- 8 BD136 pnp transistors (domestic analogues are also suitable)
- 5 1kOhm resistors (operating power 2 W)
- 5 10uF capacitors (operating voltage 35-50 V)
- connecting wires (about 10 m, taking into account the failures), solder and everything that’s fun

Time to start making the layout

We take a drill, a ruler, make an 8x8 mesh (the main thing is not to make an 8x9 like me) on anything, be it foam plastic, a wooden board or something else. And carefully drill holes for the LEDs.

Milestone #2:

The key word is “carefully”, a couple of millimeters to the left or right, and you will have a crooked cube in the end.


After this step is completed, insert the LEDs into the cells and follow the following rule:

A) All anodes should be on the left and cathodes on the right. Or vice versa. As you prefer.
b) The very first row from the top should contain LEDs at an angle:

Using this principle, we connect the cathodes (-). Where marked with a dotted line, attach some kind of wire so that the layer is held tightly on both sides.

Holding this delicate layer, it may seem to you that it is about to fall apart, but in fact, when you begin to fasten the layers, then this structure can be safely thrown onto the floor, and most likely nothing will fall apart.

Summary of the first layer


Before you start soldering the second layer, you need to take and bend all the anodes as follows:

Connecting several layers


Milestone #3:

Beginners, please use a special solder paste (flux) if you are dealing with wires, this way you will save yourself a lot of nerves (not like my first time).

When you're a little tired


So, having soldered 64 wires to the anodes that we got “at the bottom”, we can proceed to the electronic circuit itself.

We see that the outputs of our microcircuits on both sides go into the common anodes of the cube columns, and in the 5th we multiplex the control layers through transistors. It seems that everything is not complicated: a signal is sent to certain columns and layers, and we get a pair of glowing LEDs.

In reality it works like this:

There are 3 inputs: clock, data and latch. When 8 bits have been processed, the latch occurs and the data is placed in the register. Because our microcircuits are made on shift registers, then in order to render our cube once with different bits of information, we need to write 1 byte (8 bits with the numbers of layers to which voltage is applied), then there will be empty data, because For the fifth chip, the left pins are not connected to anything. Next, we write 1 byte for each of the group of eight columns. The corresponding bit will determine which column should be lit, and where it intersects with the activated layer, the LED at their intersection should receive voltage.

Below is a diagram from the developer’s datasheet for general reference:

How we will write 1 byte of data:

Void CUBE::send_data(char byte_to_send)( for(int i = 0; i< 8; i++){ if(byte_to_send & 0x01<I used Arduino UNO (I borrowed it), but any model will do here. Both nano and mini, since only 3 digital inputs and vcc + gnd are used.

Take special care of the additional power supply (I used a 12V 2A adapter); to display all layers, it seems that the current is exactly the same strength that is needed.

All source code in the form of a sketch for Arduino will be

Good day, friends and guests of the Radioschemes website! Finished my second LED cube. I found the diagram and seal on the Internet, I don’t remember where exactly. Afterwards, I wanted something bigger, more impressive or something. This scheme just turned up. It took about a month to implement and purchase parts. The first launch was carried out, as always, in a mounted form, assembled somehow. The part didn’t work, there was no talk about the housing, there weren’t enough LEDs for one floor at all and I left it like that for now, I just wanted to look at it before the New Year, and it was December 30, 00:01 on the clock. Two rows of 8 floors of LEDs did not light up and 4 LEDs were on constantly. Recently repaired, the problem turned out to be that there was a break in the tracks on one microcircuit (apparently when etching, the toner was scratched or a hair got under it), and the problem with the LEDs constantly burning was corrected by checking the control keys with their binding (I didn’t want buy transistors in DIPe, bought them in a sot-23 package, with compact wiring it was necessary to use a jumper, an SMD resistor of 0 resistance, 0805 of the standard size of my favorite, and shorted it with this jumper to the track between the two transistors). When soldering the cube itself, a defect was discovered - the legs of the LEDs were a bit short, but I wanted a large cube, so I had to extend each leg and build it up - how much patience was required... The Led cube has only 512 LEDs, 2 legs = 1024. There were boxes of scraps from resistors and capacitors, it's all used up. Then the tinned wire went, several meters went away, now not a single leg is cut off. But these were still minor things. Then it was necessary to connect the floors to each other, and it took about 2 days just to do this. In this case, all the curved moments that were insignificant during the assembly of the floors are revealed. Well, it’s okay, we’ve leveled it out. Two days were spent on making a plastic case from a refrigerator, well, there are all the fasteners for the board, the cover fasteners, the display, the control panel... The wiring on the board was neatly sealed with silicone sealant, in case “you never know.” To solder the floors, I drilled small holes in the chipboard to install LEDs, and then solder. It’s more convenient, but then I realized that it was necessary to solder separately with lines, and not with floors - it’s much simpler.

LED CUBE circuit

General form:

I painted the cube box matte color.

Front and back panel:

Internals with a beard of 72 wires:

Wires of rows of LEDs glued with silicone sealant:

Mounting platform for the board on the opposite side relative to the power input and the display panel with buttons:

A panel with cube control buttons and the entire assembly view:

I discovered another drawback: it was necessary to buy matte LEDs, not super-bright ones, otherwise it hurts the eyes a little. Fuses for PonyProg further, like Khazama, I’m focusing on Spienb so I don’t even remember what the fuses are from.

Firmware and Eeprom file, printed circuit board and everything else for the cube in the archive. First I sewed the memory, then the firmware, and don’t forget about fuses. I shot the video at night. In one view, the led cube is standing on a box, and in the second it is turned upside down .

Video LED CUBE

This cube also has a COM port for connecting to a computer, so that through the program you can independently create figures layer by layer, and then play them all together. You can create them without a cube, then connect them and see them, or you can light certain LEDs in real time and see them. True, I haven’t tried this yet, I need to look for a wire and a computer with such a connector, or a USB adapter. Later I looked at multi-color LEDs, I thought about ordering them, but they’re probably not the best option for a cube, because they blink in a certain sequence, but I don’t know how it would have turned out... In general, I ordered 100 RGB pieces, I’ll play around with it later... Author of the project DGR.

Discuss the article LED CUBE

You often come across interesting projects on YouTube. One of these is the LED cube. The beauty of this device is that it displays a real 3D image. You can draw any three-dimensional animated shapes. But within the selected cube resolution.

An article from Radiocat was taken as a basis (anyone who wants can google it). The cube size 5x5x5 was not chosen by chance. To assemble this cube you will need 5*5*5=125 LEDs. If we compare it with another popular option 8*8*8=512, i.e. the number of LEDs will increase 4 times. Therefore, 5x5x5 seems optimal to me.

I didn't have time to order LEDs, so I bought them at retail. Unfortunately, only green transparent 5mm were available, so the final result suffered greatly. Blue matte ones look more impressive, but alas. It is recommended to take frosted LEDs because transparent ones illuminate neighboring LEDs and create the effect that an unlit LED is glowing.

I started directly with the cube itself. I drew a matrix measuring 100x100. The distance between the circles is 20mm. Diameter 5mm. I printed it on paper and glued it to a piece of wood.

Drilled holes. We cleverly bend the cathode (-) of the LED. We bend the anode at 90 degrees.

We leave the cathode sticking out to the top, and solder the anode to the adjacent LED. It turns out to be a “floor” of LEDs with a common “+”.

To strengthen the structure on the left, I soldered another conductor. The first floor is ready. We do 4 more floors in the same way.

We collect all the floors together. To do this, we solder the previous floors to the next ones.

For the base I used foil fiberglass laminate measuring 100x100. I etched out the places for soldering the LEDs. The result was the following design:

Not quite straight, but everything bends easily. Now directly to the diagram. For assembly you need:

  1. 25 resistors 150-220 Ohm,
  2. 125 LEDs,
  3. 5 capacitors 0.1 µF (installed to power the triggers),
  4. 2 capacitors 22pF,
  5. Atmega16,
  6. quartz 12-16 MHz,
  7. 5 resistors 2.2 kM,
  8. 5 triggers 74hc574,
  9. 5 BC558 transistors.
  10. 1 capacitor 100uF ( nutrition is a must!!! otherwise the circuit will not work)

On the one hand, everything is simple here, but you must not get confused. Unlike previous projects, Atmega16 (Atmega16A-16PU) is used here. I used an operating frequency of 12 MHz; at 16 MHz the LEDs will switch a little faster. In addition, triggers are used here. To understand why, you need to understand the logic of the scheme.

All trigger inputs are connected in parallel. Let's say we need to turn on the first LED on the 2nd floor (D2.1) and not turn on the LEDs on the 1,3,4,5 floors (D1.1, D3.1, D4.1, D5.1). We output to PORTC.0=0, since it is 0 in this case that turns on the LED. 0 appears at the input of the trigger, but its state does not change at the output. To change the state, you need to apply a pulse to the CLK input, i.e. output alternately a logical zero and a logical one to pin PA1. Now all cathodes DA1.1-DA5.1 are connected to ground, to ignite D2.1, you just need to turn on the 2nd floor, i.e. open transistor Q2, output logical zero to PD6.

I tried to write my own effects, it worked, but somehow nothing came to mind that was not in the ready-made firmware. Therefore, the final one took the finished firmware; for a 5x5x5 cube there were several options on the Internet. It took mere 3 days to assemble. A good gift, assembled with your own hands.

Finally, a video of the resulting cube looks especially impressive in the dark.

How does LED decorative sculpture work? Is it possible to assemble it yourself? How many LEDs do you need and what do you need besides them? You will find the answer to all these questions in this article.

Led cube - what you need for self-assembly

If you are into DIY projects or like to tinker with electronic circuits, try assembling an LED cube with your own hands. First you need to decide on the sizes. Once you understand how the device works, you can upgrade the circuit with either more LEDs or fewer LEDs.

LED cube with faces for 8 diodes

Let's look at how this works using the example of a cube with a side of 8 LEDs. This cube can be intimidating for beginners, but if you are careful when studying the materials, you will easily master it.

To assemble the led cube 8x8x8 you will need:

  • 512 LEDs (for example 5mm);
  • shift registers STP16CPS05MTR – 5 pcs.;
  • microcontroller for control, see Arduino Uno or any other board;
  • computer for system programming;

Operating principle of the circuit

Small 5mm type LEDs draw a negligible current of 20mA, but you are going to be lighting quite a lot of them. A 12V and 2A power supply is perfect for this.

You will not be able to connect all 512 LEDs individually because you are unlikely to find a microcontroller (MK) with so many pins. Most often, there are models in cases with a number of legs from 8 to 64. Naturally, you can find options with a large number of legs.

How to connect so many LEDs? Elementary! A shift register is a chip that can convert information from parallel to serial and vice versa - from serial to parallel. By converting serial to parallel, you will get 8 or more signal pins from one signal pin, depending on the register capacity.

Below is a diagram illustrating the working principle of a shift register.

When you supply a bit value, namely zero or one, to the serial Data input, it is transmitted along the edge of the Clock clock signal to parallel output number 0 (do not forget that in digital electronics the numbering starts from zero).

If at the first moment of time there was one, and then within three clock pulses you set the input to zero potential, as a result of this you will get the input state “0001”. You can see this in the diagram on lines Q0-Q3 - these are four bits of parallel output.

How to apply this knowledge in building an LED cube? The fact is that you can use a not quite ordinary shift register, but a specialized driver for LED screens - STP16CPS05MTR. It works on the same principle.

How to connect LEDs?

Of course, using a driver will not completely solve the problems associated with connecting a large number of LEDs. To connect 512 LEDs, you will need 32 such drivers, and even more control legs from the microcontroller.

So we'll go the other way and combine the LEDs into rows and columns, so we get a two-dimensional matrix. The ice cube occupies all three axes. Having finalized the idea of ​​​​combining an 8x8x8 LED cube in which the LEDs are combined into groups, we can come to the following conclusion:

Combine layers of LEDs (floors) into circuits with a common anode (cathode), and columns into circuits with a common cathode (or anode, if cathodes were combined on floors).

To control such a design you need 8 x 8 = 16 control pins per columns, and one for each floor, there are also 8 floors in total. In total, you need 24 control channels.

The input block receives a signal from three pins of the microcontroller.

To light the required LED, for example, located on the first floor, the third in the first row, you need to apply a minus to column number 3, and a plus to floor number 1. This is true if you have assembled floors with a common anode, and the columns - a cathode. If it is the other way around, the control voltages must be inverted accordingly.

In order to make it convenient for you to solder a cube of LEDs, you need:

For the cube of LEDs to work correctly, you need to assemble it in layers with a common cathode, and the columns with an anode. Connect to the Arduino pins what is indicated in the diagram as input in the following sequence:

Arduino pin no. Chain name
2 L.E.
3 SDI
5 CLK

What if I don’t have such skills?

If you are not confident in your abilities and knowledge of electronics, but want such a decoration for your desktop, you can buy a ready-made cube. For those who like to make simple electronic crafts, there are excellent simpler options with 4x4x4 edges.


Cube with face size 4 diodes

Ready-made kits for assembly can be purchased in stores with radio components, as well as a huge selection on Aliexpress.

Assembling such a cube will develop the novice radio amateur's soldering skills, accuracy, correctness and quality of connections. Skills in working with microcontrollers will be useful for further projects, and with the help of Arduino you can learn to program simple toys, as well as automation tools for everyday life and production.

Unfortunately, due to the peculiarities of the Arduino programming language - sketch, there are some limitations in terms of performance, but believe me, when you hit the ceiling of the capabilities of this platform, most likely mastering the work with “pure” MKs will not cause you any significant difficulties.

Cube? This is a cube with LEDs located throughout its volume. And each LED (can be colored) is controlled separately. Using an LED cube, you can create various light shows and animations. The LED cube can display various light animations that are already programmed into it. Complex circuits of 3D LED cubes can even display various three-dimensional words and inscriptions. Simply put, an LED cube is essentially a volumetric monitor, only with a low resolution, which allows you to display spatial structures and graphics. Of course, this solution is not suitable for watching videos, but can be well used for designing shows and presentations, for entertainment and exhibitions, advertising and design. I think many people wanted to build such an LED cube, but not everyone had the opportunity to purchase a microcontroller, and of course not everyone knows how to program. Therefore, here is a very simple circuit design alternative:

The proposed version of the LED cube does not require programming, the circuit is simple and all parts are accessible. And the CD4020 chip provides a variety of compositions that are almost as good as programmable cubes. Here is a list of parts used in the cube with a description:

1)KR1006VI1 (NE555)


The microcircuit includes about 20 transistors, 15 resistors, 2 diodes. Output current is 200 mA, current consumption is approximately 3 mA more. Supply voltage from 4.5 to 18 volts. The accuracy of the timer does not depend on changes in supply voltage and is no more than 1% of the calculated value.

2) K561IE16 (CD4020, MC14020)


This is a 14-bit binary divider counter.


3) LEDs - to your taste, 27 pcs;
4) Resistor 33K;
5) Capacitor 10uF;
6) Micro switch with latching (optional);
7) Krona 9V;
8) Panels for microcircuits (optional).

So, we draw a printed circuit board of the LED cube on fiberglass and immerse it in ferric chloride.

In the meantime, our board is being etched, let’s deal with the most difficult part - the LED cube itself. Let's drill holes in plywood or thick cardboard for the LEDs and insert them there. Now we bend all the cathodes (negatives) clockwise and solder them. We solder the wires to the middle LED ourselves.


We make the remaining floors of the LED cube in the same way.


Now we need to solder them together. Only this time we solder the LED anodes (pluses).


We solder the last third floor. Ready!!)))


We take our already etched board and drill holes. First we solder the jumpers to the printed circuit board, and then the parts.


And finally, the final touch - solder the cube.


Now we connect 9V and wait for the result. Hurray - it works:


But if you increase the power supply to the circuit to 12V, the CD4020 microcircuit may burn out. That is why I installed the 9V crown. This has its advantages: you can carry the cube with you, it doesn’t need an outlet, and the microcircuit won’t burn out. But there are also disadvantages - you will have to change the battery periodically. I made a cardboard box for my LED cube. And this is what I ended up with:

Material and photos provided by [)eNiS.

Discuss the article LED CUBE