LEDBox running a random pattern

LEDBox was my first project which was kindly featured in Makezine and on the Sparkfun Electronics website.

The box is programmed to show the time, outdoor temperature, and animated weather icons. These are interspersed with various 8 bit inspired animations, Tetris bricks, Pacman ghosts, random shapes and a cool math simluation called ‘Game Of Life’ which evolves some nice organic looking patterns (See the clip below).

The screen is built using 4 RGB panels from Sparkfun Electronics which give a 16 x 16 pixel resolution, that’s 768 LED’s in total! The matrix modules have ‘backpacks’, which take care of the complicated control circuitry and act as framebuffers, essentially showing whatever image is sent to them until it is refreshed with new data.

An Arduino takes care of controlling the matrix modules via the SPI protocol. The ATmega 328 I used had 32K RAM, which gives quite a bit of space to store various routines and low res graphics.

Finally an Ethernet shield from Adafruit Industries connects the box to the internet so it can grab weather data from an internet page. (I also had it grabbing my twitter feed but Twitter have since changed their authentication method which makes that harder to do.) A few pics of the build are below.

This slideshow requires JavaScript.

As this is an older project of mine I’m not going to post a detailed ‘how to’ for it, mainly as the LED panels have been updated by Sparkfun and now work slightly differently (plus my code is a real mess!) If you want to get started with something similar there is loads of demo code on the ArduinoSparkfun and Adafruit sites to get you going.


35 thoughts on “LEDBox

  1. Hi Nick, great project. I myself am mesmerized by LED matrices and I’m literally sitting on a box of those earlier red/green modules I bought a few years back on eBay for a similar, yet less spectacular due to less colors, project. In any case, I’m planning to put a soldering iron to them at some point and, although I’ve done some prototyping already and pretty much have the hardware/software part of the project figured out, there is one aspect I’m still not too sure about. Maybe you can point me in the right direction:

    How do people come up with the actual animations?

    I mean, the dynamic changing picture is what makes them so attractive (to me, anyway) and it’s got to be something that makes sense as well as fits into the tight pixel frame (say, 16×16) . Is there a good source of those animations or a software to help make them?

    I guess for such a visual project it’s not enough to be able to solder, ha? Artistic talents may also come handy…

    • Hey, I know what you mean, I had a hard time finding animations that might fit. I grew up with an 8 and 16 bit computer, so the graphics from those games inspired me – tetris blocks, pacman, pong, space invaders and so on. They are quite simple to animate as they move in straight lines.

      For more fluid stuff I tried Conway’s game of life as that’s easy maths and makes some great patters. You could change the colour depending on the age of the cell. You could also look at the plasma demo I have running on my colorduino. I’m the first to say I don’t fully understand the maths there, but maybe you could reduce the color change to 3 colours for your displays.

      Be cool to see what you come up with!


  2. I’ve looked at the game animations and I think they should do at least for starters. But some move variety would be really nice.

    I also looked at stick animations. There is a software called Stykz (I think that’s the spelling) which I was happy to find out can run on Wine ’cause I don’t use its native Windows OS. Basically, it helps create animated frames by moving parts of a body (parts of anything, really, depends on how you describe it) only in its joints. Anyways, even though it helps to make movements that sort of make sense (legs aren’t rotating around shoulders, that kind of thing), it’s not much help in making it fit into the tight square.

    So, anyway, I’ll try to post here when I have something finished. As always, I’m doing several projects at a time and not finishing any …


  3. If my calculations are correct this cost around $240 for the LED matrices only, right? I would love to do something like this but that seems really expensive for such a small device. Are there any cheaper solutions?

    • Yeah, I’ve looked at those before. They’re a bit cheaper, but they still need a driver board like a rainbowduino or colorduino ($25 – $30) which brings the price to $40 to $45 per piece. And unfortunately the lenses aren’t diffused like the ones shown here. I would probably place the display somewhere where it would be viewed often (like right next to my PC), so I prefer diffused lenses so I don’t get blinded by the direct light from the LEDs, and so it has a wider viewing angle. This is the best deal I’ve seen yet for the diffused matrix, like the one Sparkfun sells:


      $96 + $27*8 for 8 colorduinos = $312 / 8 = $39 per matrix and driver board, which I suppose isn’t that bad (an 8-section display would be freaking awesome). And the Colorduinos are based on the ATMega 328P, so in theory they could be reprogrammed and re-purposed if not needed. They could be used as essentially 8 more Arduinos.

      It’s appealing, but $312 is still a lot of money.

    • Also do you guys recommend going with the Colorduinos or Rainbowduinos? It’s really hard for me to tell the difference between the two in terms of advantages/disadvantages. I have basic electronics, digital electronics & logic, and programming knowledge but not enough to determine which one is better. :)

      • Colorduino can produce more colours, but I don’t think there is too much in it. Sadly neither Colorduino or Rainbowduino work with the nice diffused displays Sparkfun sell.

        Also I have just found this on ebay: http://bit.ly/ltIE3q equivalent to 16 8×8 displays for $95. Shame the controller is another $185.

      • Are you sure they aren’t compatible? The link above looks like the exact same panels as Sparkfun and the auction page claims they are compatible with Rainbowduino. I know that the Sparkfun ones already come with a controller backpack (so obviously that wouldn’t be compatible if you wanted to mix the systems), but aren’t the panels themselves still compatible if you took the bare panel and plugged it into a Colorduino or Rainbowduino?

  4. If you’re concerned about brightness, that can always be controlled via software. And mine look great from any viewing angle. You can also just lay a piece of drafting film on top as a diffuser. As for the driver boards, madworm has a design that you can build super cheap, bit it will take a lot of wiring if you want to do it by hand. 328P’s can be had for about $5.50 each, and the 595’s are 10 for $3 on ebay. Here’s his instructable:

    • Yeah, I do lighting design as a hobby so I have plenty of diffuse gel that would probably work if put on top. As far as the DIY driver board – that looks cool, but I don’t have any SMD soldering experience, and I’m not sure if I have the time or patience to build 4-8 of those. It would be a nice learning experience, but I’m just worried I wouldn’t be able to pull it off or get them to work correctly (not to mention I’m not exactly swimming in that kind of free time).

      There is also something really appealing about the nice diffused look of the diffused matrices. :)


      • I think you got the idea perfectly right – it would be a great learning experience. These days you just cannot avoid bumping into SMD designs and knowing how to populate/bake (ahem… solder) them is a great advantage. I’ve looked at the particular board at Instructables and it appears that you only need to place 4 larger SOIC chips and 1 TQFP for the SMD part and the rest is through hole. The chips are rather easy to place (although damaging them by over-baking is more expensive) than SMD discrete components and so it might just be a perfect training board for SMD soldering.


  5. Oh I wasn’t thinking of using the PCB … wire wrap with through-hole components would be easier to DIY. But yes it’s a lot of work. I hope Nick doesn’t mind that I’m taking over his blog! Maybe he has some other thoughts on how to build it on the cheap!

  6. Colorduino vs Rainbowduino.. I forgot to weigh in on this. As Nick said, the extra colors that the Colorduino can produce are hard to see. On the other hand, when I was trying to produce different gray levels, the difference was significant. The other advantages of Colorduino are partial hardware PWM and software control of white balance. The Rainbowduino has a more mature ecosystem, so if you want to reuse someone else’s code, there’s more available. Seeed is a more established company, too.

  7. Sorry, let me clarify… “partial hardware PWM” wasn’t really the right terminology. The Colorduino has hardware PWM, but it only buffers 1 line, so you still need an ISR to scan the lines. Still, this is much lower CPU bandwidth than the software PWM used in Rainbowduino.

  8. Erik,
    Strange, I can’t reply directly to certain messages…
    Rainbowduino & Colorduino need common anode matrices. Sparkfun matrices are common cathode, and therefore, incompatible.

  9. Hey guys, I am just starting with arduino and I’ve found this project very interesting.
    I am planning to connect Arduino UNO 30$ + Ethernet Shield 45$ + 32×16 Bicolor Matrix LED 20$ (product number DE-DP14211).
    The Matrix is programmed through the serial connection with only 4 wires and using an SPI-like protocol.
    I don´t see the need for using colorduino or rainbowduino.
    Can anyone tell me why colorduino or rainbowduino might be a better choice?
    Thanks a million!

    • The main reason for colourduino / rainbowduino would be if you wanted true RGB colour rather than bi-colour.


  10. Thanks for your response, I see now what are they good for, then I will stick to my first idea since RGB is not required in my project.

    Good Luck with your Arduino’s projects!

  11. Hi Nick,

    this is really a great project. I love the animated weather icons!
    Because I want to build one by my own, i already bought four colorduinos and rgb-led-matrix.
    Can you please tell me where to find some wiring and code informations?
    This would be awesome.

    • I would try the colorduino forums. Also on my site there is a page with basic I2C code – meaning you can run a colorduino from an arduino.

      It needs some work, but it might be a start! Also look for a guy called lincomatic – he has some code I think.


    • I haven’t written this one up as the parts in it aren’t available anymore – Sparkfun changed their LED matrix design.


  12. Hey,

    I been having an issue with my Arduino Uno communicating to the Rainbowduino via I2C. I mean shouldnt it be simple? Hook up SDA and SCL wires and upload firmware to Rainbowduino and master code to the Arduino. Sadly my LED matrix won’t light up at all. Although I can program the Rainbowduino in standalone mode without the Arduino. Any help would be great.

    • Yeah I think that should be all you need, but remember the Rainbowduino is different to the Colorduino I provide i2c code for, so if you are using that it won’t work.

  13. Love the tetris thing! I have no time unfortunately to dig into it, but if you could make that with big LED tiles such as

    that would be great and I would buy yours ;)
    Why almost nobody is using these large led tiles is a mistery to me; especially if combined to a larger screen. They’re cheaper than matrices made from LED strips.

  14. I know, but it is limited to a 16×32 or 32×32 matrix. With these tiles it is easy to make bigger screens as you wish.

    • They’re pretty much the same tiles I think, but yes you’d need to adapt the adafruit code to address more than one tile. Also with driving more tiles, the arduino might not be fast enough, you may want to switch to a propellor or such like. (Or you can buy the official driver boards that the companies that make the tiles sell.. I’ve seen them on ebay but they are $$$!)

      Henner has 4 tiles going with a Rasberry Pi and the pixelpusher protocol. The Pi acts as a client, receiving data from a PC and displaying on the tiles: https://www.youtube.com/watch?v=ZglGuMaKvpY

  15. That’s already quite cool this link! But I would even make it bigger – the 32×16 pixels tiles are cheaper than comparable led strips (approx. $20 including shipping). Controllers cost between $100 and $200 which can easily connect 250×250 pixels.
    I can play all img files or video files on it, that’s a good start. But I’d like to have pac man (80-ties style) and kind of animated gif’s running around.

  16. Cool project! Thanks a lot!
    Is it possible to do the same thing (or 16×24) using COLORDUINO? I know that COLORDUINO has only i2c and UART on then board. Perhaps it is too slow protocols.
    But I have at the moment there is nothing else…:)
    6 colorduino, 6 matrix 8×8 RGB, Arduino MEGA2560 and I have a wish… i have a big wish to make my TETRIS!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s