Almost done with my 24x16 LED project

I'm almost done with the hardware for my latest project and needed to test out brightness, current load, and button routines and I thought hey, why not film it:

There's an ATMega328 driving a grid of 24x16 LEDs. The columns are controlled by 3 TLC5916s and the rows by 2 74ac138s and 16 p-channel MOSFETs. I'm still using a Duemilanove board for USB to my computer but am working on my own USB/serial connection.

Right now the LEDs are diffused by a piece of paper and are on one big circuit board; in the final version there will be 8 boards in an octagon inside a frosted glass cylinder.

I hope to be done by the end of the year.

Very nice programming. Looks great.


Wow, it's awesome I love it ^_^ Let us know if you make the code available.

Awesome! Best homemade LED screen + demo I've seen for a long time! Please share some more details if you will :)

Thanks! It’s still very much a work in progress so I don’t have any Eagle schematic files to share yet. But here’s some details and attached is a picture of the breadboard.

My test LED board is a grid of 24 x 16 1206 SMD LEDs. I hand soldered this one, I wanted to try toaster oven reflow soldering but wasn’t sure about temperature variation in a cheap toaster oven with a board that big (it’s 8" x 6"). The next one will be 8 boards of 3 x 16 LEDs, arranged in an octagon, and hopefully they’ll work in an oven because hand soldering 384 SMD LEDs is not as much fun as it sounds…

I got a blank ATMega328 (second left chip from bottom in the pic), added the crystals, caps, and resistor, then programmed it with OptiLoader through my Duemilanove.

I added a FT232RL (bottom left chip) and an old USB cable so I could program it without the Duemilanove. The USB side of the chip is wired like the “Self Powered Configuration” schematic in the data sheet and the serial side is just like Duemilanove schematic (1K resistor between FT232RL and ATMega328’s TX and RX pins, .1 uf cap between FT232RL DTR and ATMega328 Reset, and LEDs with 1K resistors on FT232RL CBUS0 and CBUS1 pins for the indicator LEDs).

At the bottom right is a DS1307 clock chip and its crystal and battery… I know the clock works by testing it with the serial port, but haven’t written anything to display the time on the LEDs yet.

The top left chip on the bottom board is an AD5204 quad digital pot connected to the ATMega328 via SPI. You use a resistor on a TLC5916 to control current to the LEDs so this lets me adjust their brightness. You can’t see it in the picture but I’ve got a photoresistor on an analog port on the front; my goal is to have overall system brightness depend on how bright the room is (so the display can be seen in the day, but doesn’t blind you in a dark room). I am still evaluating this chip…at full load (around 180 ohms) the TLC5916s draw 11mA through their resistors. The spec sheet for the AD504 says the max current per pot is 20mA but it also says you shouldn’t have a sustained load of more than 5.6mA per pot…so I don’t know if I should keep it or not. I’m considering swapping it with a AD5206 (six digital pots) and running two digital pots in parallel to each TLC5916.

On the bottom left of the top breadboard is 3 TLC5916s, also connected to the ATMega328 via SPI, with one additional pin for Output Enable. The 3 chips are daisy chained with SDO from the first to SDI on the second etc. The 24 outputs from the 3 chips go to the cathodes of the LED grid.

To the right of them are 2 74AC138s wired to be a 4:16 decoder. Each of the 16 outputs goes to the gate of a logic level P channel MOSFET. So 4 pins from the ATMega328 select which of the 16 MOSFETs is on.

The 16 MOSFETs are SOT-23 SMD parts and the top rows of little green boards are their breakouts. As you have probably guessed, my eventual goal is to use all SMD parts on the final circuit board.

Also at the top right is a 220 uf capacitor. I have .1 uf caps across the power lines of all the chips but the circuit still locked up or wouldn’t boot once in a while until I added it. My guess is I have a cheap power supply, but it’s the only one I had that could provide more than 2 amps.

I’m currently switching rows at 25 KHz, which is enough to give 8 levels of PWM. I haven’t had good success getting 16 levels of PWM yet but haven’t spent much time on it either.

With a switching rate of 25 Khz each row is only on for 0.04ms, short enough to overdrive the LEDs. 180 ohms to the TLC5916s R-EXT pins should provide 100mA to each LED and the MOSFETs can handle the 2.4A all 24 LEDs would take. In practice, however, my meter says the total circuit draw never exceeds 2 amps so my guess is the short pulses limit maximum current…either that or I’m missing something, but don’t have anything like an oscilloscope to test.

As far as code I’ve got the basic setpixel etc. routines going, but it’s mostly hacked together and needs a clean rewrite. That is what I will be doing for evenings for the next few weeks…or months…


I haven't made any hardware changes but I've rewritten or cleaned up all the code and added routines for primitives like circles and lines. Here's some (mostly) new animations.