Blinded by the brightness. Pixabay (CC)

Happy to say that as of today, I am finally moving forward on my LED project. I've done a decent amount of small, fun projects using LEDs in recent times and I've amassed thousands of LEDs through giveaways, but I've always lacked the proper funding for a big project until now (having a job helps with those sorts of things).

So this post will mostly be background knowledge for the project. Sort of explaining what I'm trying to do with this project, technical background information, etc. The motivation for putting this in post form, I guess, is that one of my biggest passions is getting people excited about STEM subjects so if I motivate people into trying out an electronics project, I want to be as much of a resource as I can! Additionally, people have asked me about this project a few times so I want to keep a log in case people want to try something similar in the future.

That being said, this post is very much a work in progress. I'll constantly be updating with new information over time. And just to make it easier to read, I wrote this initially at like 2 in the morning...

Create some sort of LED matrix that consists of at least one thousand RGB LEDs (so at 10*10*10, if using a cube). Leaning towards a cube because I haven't felt strongly enough about any other configuration that I've explored. Still have a little time to decide as I have to start testing with smaller of amounts of LEDs before I scale up. Also worth noting, while it's always fun to do projects that people have already done, I like to try out new things so I have some plans to bring this project to a new level!

Here's a cool demo of an LED Cube in action!

Pretty cool, huh? Well, onto the technical background information! Don't worry if this doesn't make a whole lot of sense at first, some of it is in upper division electrical engineering courses - but it's pretty straight forward once you get the hang of it! There's sort of a couple schools of thought on how to approach a LED cube. The first being a multiplexed approach that most people use and another less multiplexed route (that I'm currently leaning towards).

I'm sure LEDs are something that many people are familiar with today. In recent years, they've become pretty standard as an efficient, long lasting lighting source but can also be used to transmit infrared information in devices such as in your TV remotes. LED's are fairly recognizable from their distinct shape:

LEDs. Pixabay(CC)

LEDs emit at a certain wavelength and that wavelength determines what the LED does. For example, a modern LED might be designed to be a blue LED or a red LED or an infrared LED, each having their own use. This project utilizes RGB LEDs which are essentially LEDS that have a red LED, a green LED, and a blue LED that are diffused together with a lens, and can produce any color (this is how many displays work today).

For those wanting more technical info, LEDs are p-n junction diodes that have a positive anode terminal and a negative cathode terminal. When a proper voltage is applied to this terminal, the LED will emit. LEDs are non-linear devices and continuously applying a threshold voltage to a LED without a limiting resistance will short the LED in many cases (LEDs have an exponential I-V curves).

LED circuit symbol. Wikipedia Commons/Omegatron (CC)

If you want to know more info of how LEDs work from a physics perspective, the Wiki article is a good reference.

PWM is a method that allows you to make any color you want when using LEDs. PWM really just means turning a device on for certain amount of time and then turning it off for a certain amount of time, many times over and over again. For example, I might repeatedly turn a red LED on for 10 ms and off for 15 ms. The duty cycle of this (the percentage of time the LED is on --> 40%) will actually determine the shade of red the LED emits. Because an RGB LED diffuses the three LEDs together, any color can be created using PWM.

Resistors are probably the most basic electrical device imaginable yet, one of the most powerful. Resistors can bias voltages in a circuit, limit current flow, terminate loads, etc. so as such, they are used in practically every circuit. If you remember from the 'LEDs' section, LEDs generally need to have some sort of resistance attached or they 'short' out from too much current. Now, resistors just dissipate energy meaning it just ends up being lost energy so I'm looking into setups where I don't have to use resistors (at the very least, it would cut down on my soldering by quite a bit...)

Resistors. Wikipedia Commons/Afrank99 (CC)

Shift registers are neat little devices that allow you to control a whole lot of outputs in a circuit using one input. The basic premise is that you 'clock' data into the shift register (for however long you want) which the shift registers then stores (but doesn't do anything with) until you 'latch' the shift register. At which point, all the data shifted into the shift register up until then point, gets pushed to the output pins. It's sort hard to show/explain how they work exactly but I think the following video does a pretty good job explaining this.

In my opinion, probably the greatest invention of all time - transistors have enabled practically every electronic device of the past half century (the alternative to transistors, vacuum tubes, are a little big). Transistors are essentially used to amplify or switch electrical signals and can be used quite heavily in an LED cube (depending on the setup). I could write for days about transistors but I'll keep it to a minimum for a project like this.

Transistors. Wikipedia Commons/Inductiveload (CC)

The microcontroller is sort of the brains of an LED project and decides which pins get turned on and off, and at which times. Microcontollers are analogous to the CPUs in your computer, just a lot more accessible (and a whole lot worse performance-wise). Many people like to use Arduinos for hobby projects because of how easy they are to use but they do have their limitations in performance. Note: If you do use Arduinos for projects, buy them from China on Ebay rather than the official vendors. They are literally the same exact electronics for 1/5th of the price. I've used them multiple times with no problems (and I feel most people don't know about the Ebay route).

Arduino. Wikipedia Commons/Creative Tools (CC)

One thing that's easy to forget when you're using hundreds, if not thousands of LEDs, is how much power is being used. Some quick math: since each LED can use up to ~20 mA at a time, there are 3 LEDs per RGB LED, and there are hundred of LEDs in a cube = a whole lot of power. So you might need a pretty serious power supply (and some money for the electricity bill).

Now you might start to see how all of these components are starting to fit together. A LED cube potentially has thousands of terminals that need to be controlled so that LEDs can be turned on at exactly the right time(s) to get the exactly right colors to show, continuously. But most microcontrollers only have a handful of output pins. How do you control thousands of pins on LEDs using 4 pins on a microcontroller?

The answer is multiplexing which essentially is combining multiple signals into one signal, which is then distributed over multiple outputs. In the scope of a LED cube, the microcontroller first loads the shift registers with the necessary information to control the LEDs and then the the shift registers turn on the LEDs in the cube - but it's not quite that simple. Once you analyze the math, this strategy would require quite a bit of electronics to work (again - many, many outputs to control) so you actually have to share resources over different parts of the cube. So in actuality, the theoretical maximum amount of time a LED might be on might be 1/10th of the time and with PWM, it might only be on 1/30th of the time. One of the drawbacks of multiplexing.

While multiplexing is a pretty cool strategy and it definitely works, I've never exactly been thrilled by it. The idea of being forced into pretty bad duty cycles and not good color resolution because of the limits of write speeds on microcontrollers (as in, I hear 4-bit color is considered good), doesn't exactly thrill me so I'm currently exploring some alternatives.

One of the crazier ideas I've considered is essentially a one for one concept - ie. one output pin on a microcontroller = one pin of an LED. This would allow for a theoretical 100% duty cycle which would be pretty neat (and also blind people - but that's flexibility). But remember, microcontrollers that are able to write very quickly don't have very many pins and there are thousands of pins on the LEDs so this approach would require a ton of microcontrollers. I'll detail some findings about that subject in the 'PIC' section below.

Also worth noting, this method would save a TON of time on soldering because I would have to solder so many leads, transistors, shift registers, etc. together. And I might even get by with using a minimal amount of resistors by playing some tricks, which would be great. Also worth noting, I won't be using a Arduino for being the master controller (unlike most LED cubes). While Arduinos do have fantastic write speeds, they do lack the processing power that I desire for, um, later uses of my LEDs. I'll probably use a Raspberry Pi alternative for that (also, side note but one of the reasons people don't often use Pi's for cube is their digital write speeds sort of suck unless you're using C - and even then I've heard it's not great).

PICS are microcontrollers, just like Arduinos, and can be used for a wide assortment of tasks. The advantage being is that I think I remember reading about some models that could write quickly, have a ton of outputs, and still drive enough current. I think I have a DIP lying around so I'll give that a go soon. The PIC below is actually quite small (about the size of your pinky fingernail).

PIC Microcontroller. Wikipedia Commons/Acdx (CC)

Very similar to a shift register but has an input for every output rather than just one input. This was more for a fusion concept that had some multiplexing but some one to one input/output but I can't really think of any pros to this idea over a full one to one idea.

With quite a few projects on my docket, I want to start getting into elegant electronic design that just looks sexy. And saving space is always nice. So I will probably layout all my electronics on PCB rather than bread-boarding it like many people do (yuck).

PCB. Pixabay(CC)

I usually buy my parts from Newark, Digikey, or Ebay (with the supplier depending on the part I'm buying from).

So that's some background for now. Stay tuned for updates as I'll probably flesh it out over time!

Ukulele strummer, milk enthusiast, and sushi connoisseur. Was the leading scorer on my amateur soccer team last season. I'm also a true nerd at heart and an aspiring rocket scientist.


Developed by Sanjay Derbyshire 2015-2019.