Leaving Tumblr - Back to self hosting

I was annoyed by wordpress and quit my personal blog a while ago. Now that I wanted to blog about electronics I chose tumblr because it was easy to set up and had a nice interface. After a few postings though I felt tumblr just wasn’t right for me and that wordpress really offered the kind of flexabilty I needed. Besides that, tumblrs permanent outages started to annoy and frustrate me. On one day I lost two hours of written text because of that in some kind of database rollback.

Now after the 48 hour tumblr outage I decided to move back to self hosted blogging. I set up a fresh copy of wordpress on my server and migrated my old wordpress posts into it. Then I found a website that would export my tumblr posts to wordpress compatible XML file which I could import as well. The migration took longer than I wanted, especially because I wanted to blog about my new 4x4x4 cube but for now I should be good to go. The blog will be about my electronic experiments as well as other things of interest. I will provide a special electronics tag in case you are just interested in that.

So please come over to: http://smyck.net/
 

The code can be found here

3x3x3 LED Cube - Part #2

In the second post about the tiny 3x3x3 cube I want to present the second board which I made (actually my girlfriend made the first one). This board features a more advanced design than all the previous ones.

 

The main difference to the other boards is that this one uses shift registers to switch the LEDs on and off. This reduces the wires that are necessary to connect the board to the Arduino. There are only 6 wires needed, two for Vcc and GND and the other four for programming the shift registers. The board from part one needed 13 wires.

The design is based almost entirely on this tutorial from the Arduino website: http://www.arduino.cc/en/Tutorial/ShiftOut This is well explained that it doesn’t need any more words from my side. The big advantage of using shift registers is that no more wires are necessary even if more registers are added to address more LEDs. While this approach seems to be alright it has one drawback on my board. The shift registers I used can only source 70mA of current. I mentioned in the previous post that if all LEDs on one layer are on at the same time, they use up to 180mA. That is more than twice of what the shift register can deliver. That means that when an entire horizontal layer is on, the LEDs are a lot darker as each of them only gets 7,77mA.

Even though this board is more sophisticated it is still trivial to make, if you follow my posts about building the cube and the Arduino tutorial about using the shift registers. Still this is only one more step and these boards and cubes are almost one year old. I knew a lot less back then and you can see that. I wanted to write about them anyway, since they work in some way and help to explain certain concepts.

The next posts will be about my current efforts. New LEDs, new cubes, new chips etc. I even bought an FPGA board for building a large cube so there is a lot more in the pipeline here. I hope the next post will be on my new blog though. I had so many troubles with tumblr recently that I’m frustrated enough to move away from it. Temporarily I will host a wordpress blog myself. Later on I will write my own basic blog software as wordpress is just to bloated. Compared to tumblr, a self hosted wordpress is at least accessible and offers features which tumblr and other sites just don’t offer.

I’ll let you know when the new blog is ready. In the meantime I will post a video and the code for the cube … as tumblr is really annoying when you want embed videos in text posts *sigh*

3x3x3 LED Cube - Part #1

Until now I haven’t posted any schematics. This is because the cubes I’ve shown so far were too trivial. This also the case with this 3x3x3 LED cube and its board. As you can see it uses a lot of wires. 9 Wires for addressing the LEDs on a layer, 3 more wires for multiplexing / switching the layers and one more wire for GND. The Arduino Board provides enough pins and so no fancy techniques are necessary yet. While the board looks clean and simple on the top, the actual wiring on the bottom is a little more complicated.

Even a 3x3x3 cube involves some work. The only new concept here is the use of transistors for switching the layers.

Power

This cube has common cathode layers and common anode columns. This is because each column is directly connected to one of the Arduino IO pins. These pins can provide a current up to 40mA. A typical LED needs around 20mA for full brightness and since there is only one layer connected to GND (-) at the same time each column only draws 20mA at any given time.

The layers are connected to transistors which allows switching the layers to GND with three IO pins. The transistors are all connected to a common GND which has the advantage of requiring only one GND wire instead of having individual wires to  for each transistor.

Also notice that all the LEDs are connected via the cathode which means that if an entire layer is lid up at once, a 180mA (9 * 20mA) are flowing through the transistor.

I don’t have the code for running the cube on that board anymore but I build a second board with shift registers which I will show in the next post.

Arduino Quicky

There are many good websites about getting started with Arduino. Here are two of them:

First of all the Arduino website itself which contains a lot of tutorials, reference documentation, schematics of the Arduino boards and more. http://www.arduino.cc/

The second resources is a tutorial PDF which is available for free and covering all the basics. http://www.earthshineelectronics.com/files/ASKManualRev4.pdf

Next Stop: 27 LED Cube Street

Building the 2x2x2 cube was really easy. We literally bought the Arduino, a couple of LEDs and cables (as described here), put it together and it worked. Of course we wanted to go to the next level immediately, just like in a video game. With the same principles we built a 3x3x3 cube but this time it featured resistors in series with the LEDs, transistors for switching the levels and a socket which allowed us to switch the board or the cube easily. I will explain each step starting with the soldering.

Soldering the LEDs together

Basically there a different ways to do it but all variants share the same principle of having layers and columns. Also its best to have some kind of grid to make sure the connections are as straight as possible.

One way of building a cube is to solder horizontal layers and stack them on top of each other by connecting the cathodes, only using the LED pins. 

Instructions for horizontal layer soldering:

1. Get cheap wood like MDF and draw the desired grid onto it. For regular LEDs the grid width should be 2,5cm.

2. Drill holes where the lines of the grid cross and make the holes 5mm wide (if you’re using regular 5mm LEDs). Start with a 4mm wood drill which could be sufficient.

3. Bend the anode (longer LEG) 90° like you can see on the picture below and put the LEDs inside of the holes

4. Solder the anodes together

5. Cut of two anodes (longer leg) of other LEDs and use them to stabilize the layer

6. Cut of the overlapping wire and the first layer is complete

7. Bend the cathodes to the side like you can see it in the picture so that you can stack the layers on top of each other. You can skip bending the cathodes for the last layer. In the following picture I did only bend the front LEDs. 

8. Build two more layers and solder them together.

Instructions for vertical layer soldering:

The other way of soldering together a cube is to build vertical layers. This has the advantage of being able to switch single vertical layers. In the horizontal version it is close to impossible to fix a broken LED in the middle of the cube. Also allows to build larger cubes that a more solid and straight. This is how you do it:

1. Get some cheap wood like MDF and draw your desired grid onto it. Then use a saw, a screwdriver or a cutter knife to cut out the grid like in the following picture.

2. Get some copper wire and cut it to pieces. Then use two pliers to straighten the wire. Grab the ends of the piece of wire and pull it straight. You can feel when the wire is extending. Release it carefully and you should have a straight piece of wire. I used copper wire which is mixed with silver. I couldn’t find any good translation for “Versilberter Kupferdraht”.

3. Get 9 LEDs and bend them like you can see on the picture. Then shorten the cathode

4. Hold the soldering iron onto the junctions and apply solder. Then grab an LED, head up the solder on the wire, hold the LED like on the picture. Distribute the solder and remove the soldering iron while still holding the LED for a second or two.

5. Attach all the LEDs that way. You can shorten the anode as well by the way.

6. Lay out the columns onto the grid. Cut and straighten three more wires and connect the LEDs horizontally.

7. Cut of the overlapping wires and you have your first vertical layer

8. Now build two more layers. Put them next to each other, then connect these LED walls horizontally with some more wire but just on the outer sides. Does that make sense? This cube, even if its built from vertical layers will have horizontal common anode layers just like the other cube had. Its just built in a more modular way. Therefor the vertical LED modules need to be connected horizontally in each row. 

Now while this seems more work in the beginning, it saves a lot of hassle later on. Imagine building a cube in the horizontal layer way. When the LED layers are stacked on top of each other, 9 cathode connections need to be made every time. As you cube grows it is getting harder and harder to solder it straight. A mentioned before it is also getting harder to extract an LED from the middle. Imagine building a 10x10x10 cube where 100 cathodes need be be soldered together for each layer! 

With the vertical LED module approach the stacking is already done. They can be be easily plugged one after another into their sockets and only need a few connections horizontally so connect them and to stabilize the cube. Since the horizontal connections are mostly on the outside of the cube, they can be easily removed to take out / replace individual modules.

Finally the cube will be more stable if straightened wires are used instead of the LED pins. I build a 5x5x5 test module which I could stick into my breadboard. I even attached a bunch of cables and its still stable.

 

This 5x5 matrix is again completely powered by the Arduino which is connected to my MacBook Pro. There are only a few Arduino pins used. Two of them supply the power and five control the LED driver chip which is called TLC5940.

If something about the soldering part is still unclear, contact me please.

Today I decided to use the small 2x2x2 cube to demonstrate multiplexing and so I got out my breadboard and connected it in most simple way possible. All six cube pins go directly into the Arduino IO pins. I uploaded the program which I mentioned in one of the previous posts and it worked right away. It is actually bad to connect the LEDs directly to the Arduino without any resistor in between but the Arduino is very forgiving and works with like that with smaller loads. This should not be a permanent design pattern however.

The video shows that the LEDs can not be addressed individually when powering both layers because they share cathodes horizontally and their anodes vertically. Therefor its not possible to switch on the upper left and the lower right LED individually at the same time as all the other LEDs in the same column would light up as well. This is shown in the beginning of the video. To solve this problem the layers are switched on one after another in such a fast way that the human eye does not recognize it. This is the basic principle for most kinds of LED matrices.

Again the corresponding program is trivial.

Next up: Bigger cubes and more advanced techniques. 

Vive la résistance!

A short word on resistors. There are two common kinds available. The brown (carbon film) and the blue (metal film) ones.

The metal film resistors are generally preferred for the following reasons:

  • They have a smaller tolerance (1%) compared to the carbon film resistors (5-6%). That means that the actual resistance is very close to what it says on the box. In contrast the carbon film resistors vary a lot more. A 100 Ohm carbon film resistor can have an actual resistance of only 88 Ohm which is quite a difference.
  • They can handle more load than carbon film resistors while getting not as hot. (0.6W compared to 0.25W)
  • They produce less noise. This is not that important but still its a benefit

I mention this because initially I bought two boxes of the brown ones and I didn’t know about the difference. The advantages are not big enough to throw away all my carbon film resistors as they still work but I prefer metal film resistors from now on.