Wednesday, 12 August 2015

4x4x4 LED Cube

One funny thing to do which uses all 20 pins of an Arduino UNO and a bunch of LEDs is an LED cube. I found it on Instructables and thought it would be a good value addition to my new workplace. I had just quit IISc and was about to join MathWorks in about a week's time then. So, went and bought 70 blue LEDs and spent 2 days wiring them up in layers of 16 LEDs each. Each layer has a common ground.

And there are 4 layers. So, 16 pins are used to index amongst the LEDs in one layer and 4 pins to index the layers themselves. The result is a cube, which needed persistence of vision to index LEDs which have both different layers and different columns within the layers. This requires a bit lesser amount of coding as compared to the 12 pin solution, which requires PoV to make anything glow.


I assembled the layers one on top of the other and soldered them all to a perf board. Hooked it all up to 20 berg connectors (male) and mounted it atop a clear plastic box. Inside the box is a cheap Arduino clone which handles the LED addressing. A cheap L293D motor driver breakout board handles the layer addressing as each layer would output much more current than what an Arduino can safely sink (as it sources from 16 pins of the Arduino). Below are a few images of the build along with a video. The code used in the video is from the Instructable http://www.instructables.com/id/LED-Cube-4x4x4/.









Incidentally, when I visited MathWorks head office at Natick, MA, in march, I found a much bigger version of the LED cube displaying the MATLAB logo at the entrance of the AH1 block.

The Hunt for a Power Supply

One of the most fundamental resources for an electronics hobbyist is a good robust power supply. Short circuit and overload protection and precise linear control of  voltage and possibly load is essential. The only caveat is, it comes at a cost. A DC power supply from Agilent or Tektronix could easily run up to INR 30k. I decided to build my own, last year.

There's this store called 'Universal Transformers' in SP road, who specialize on manufacturing transformers. I got myself a decent 2A transformer. I assumed it would work up to around 1A  or possibly a bit more without any issue. Then got in a bunch of 1N4007 diodes from my stocks and built two bridge rectifiers. The transformer was a center-tap and would give me 15-0-15V. S
o I can output both negative and positive voltages. Smoothened the output with two 1F capacitors and it gave a smooth and steady voltage on the scope.

The actual voltage control is through a LM317 and its complement, LM337. These are controlled via two precision potentiometers stuck on the main panel. A cheap 7 segment display voltmeter from eBay finished the display part. A switch controlled whether the voltmeter was showing the positive voltage or the negative. The only problem: LM317 and LM337 operate from 1.25V and -1.25V respectively. This leaves a comfortable 2.5V blind spot. Useless for playing with diodes or anything which requires sub-1V.

When I finally decided to upgrade from this, I chose the VarTech 2A 0-30V supply. Pretty decent and comes with short circuit and overload protection.