This is the first in a two-part series. This first article made me realize there’s a lot of ground to cover and we’re already in the tl;dr territory.
How many times has this happened to you? You have a little LED project with an AVR ATmega328 microcontroller (or Arduino) at its core and you need to light up a boatload…. A dingyload of LEDs. Maybe it doesn’t happen a lot to you. It’s happened on three recent projects for me. My latest two LED projects are a timekeeping piece that illuminates 21 characters from behind and a simple LED chaser thing.
As usual I wanted to keep the component count down on these projects. I also tend to prefer not to use a ton of ICs with busses between them and whatnot, if I can help it. So much darn soldering and stuff. Meh. Luckily, back in 1995, so the Wikipedia story goes, a super-smart dood named Charlie Allen at Maxim Integrated devised a super-ingenius way to control a large number of LEDs using a not-so-large number of microcontroller pins. The method is called, “Charlieplexing” and it seems a but daunting, at first, but it’s not that bad once you figger it out.
The core of this concept is based on the fact that diodes only allow current to flow in one direction. The “D” in “LED” stands for “diode.” Ergo, LEDs are diodes. LEDs only light up when connected a particular direction. Put two diodes in parallel BUT in the opposite-facing direction and you can turn on one or the other simply by switching the polarity of the ends of the circuit. Fun! Diagram:
Two LEDs in Parallel
Let’s assume I have a 3V little coin cell running this thing and limiting resistors and CCRs are not our thing, today. Why not? Anyhoo… Looking at the diagram, you see I’m using GPIO pins from an Atmel ATmega168 AVR microcontroller (it was readily available in the library in Fritzing, the program I used to throw together the drawring diagram schematic thing above). If I configger A0 and A1 as outputs and then set A1 HIGH and A0 LOW, I can turn on LED1. If I flip the states of the two pins and make A1 LOW and A0 HIGH, LED2 will light. Here’s a animated GIF of how it works with direct connections from the LEDs to 3V lithium coin cell on a breadboard:
Parallel opposite polarity LEDs flipping state
Watch carefully and you’ll see that I switched the positive and negative to make one or the other LED light. Easy as pie. Imagine each wire from the battery is a GPIO pin from a microctonroller. All I’m doing up there is making one HIGH and one LOW and then flipping them back and forth.
EDITOR’S NOTE: I’ve attached PDF files of the pentagon PCB and the motherboard PCB. If I had time to label them and make them pretty, I would, but this was never designed for mass production or consumption. Use at your own risk and frustration.
For those with a short attention span, I give you a photo of the completed project (my biggest to date):
Completed LED Mood Lamp
If you’re interested in the story of this things, continue reading…
This idea came about randomly as a gift idea for my wife. I’ve built useless machines, clocks, etc. for other people (and myself), but hadn’t built anything for my wife. I’m not sure what she’s going to do with this thing, but it’s the thought that counts.
For those of you with short attention spans, like me, here is a quick and lame video I threw together in iMovie:
I am building this for the new awesome bed I will be building this winter for our bedroom. There will be two of these lamps, one for me and one for my wife on either side of the headboard. The LED head will have a metal (or whatever I end up finding) shroud on it to keep light pollution down to a dull roar for the other person who might be sleeping.
I have been dying to post photos of my latest colossal time-sucker-of-a-project: My Halloween 2010 costume is Tony Stark. Iron Man would have been a pain in the mechanical arse, but Tony Stark’s only challenge is that crazy super-glowy round life-saving thingy thing in his chest which is visible under a shirt. This is the most ridiculous and complicated build I’ve done to date.
This post is about building the arc reactor Tony Stark needed to survive in the Iron Man movies. The particular version I wanted to build was the RT Mark II, which Tony built in his home lab once he got home from his captivity in the desert. It’s more refined than the first version he built in the cave and every bit as swanky. Mostly, I liked the look of the second one better, myself. The one I’m talking about can be seen in the movie fairly up-close when Pepper Potts has to remove the old one and replace it with this new one.
It’s been a little while since I updated the site. I’ve had a lot going on. There are a number of new builds I will be posting in the coming weeks. This is about the latest.
Problem: At night, when I read in bed and my wife is trying to sleep, the lamp on the night stand is kinda bright and obnoxious and, even though she says it doesn’t, the light disturbs her. I had been using a little USB-powered LED lamp that I bought for my laptop on long night time airplane rides. However, I can’t charge my iPhone while I’m using that light. Only one USB cable available at the night stand. Also, that light isn’t quite bright enough for my liking. What to do?
Build a reading lamp out of stupidly bright and nearly stupidly tiny LEDs.
Here is the proof print for the light’s PCB which will be mounted on the end of a flexible “gooseneck” that will extend from the night stand or from the headboard of our as yet unbuilt bed: