RGB led matrices with animated gifs
Hey guys, I just came back from a trip to China! Not only was it an occasion to visit this vast country but also a good opportunity to go to the numerous electronics markets in the cities of Xi'an and Beijing. Yes, even on holidays I'm still into electronics ;-) .
So here are the few interesting things I brought back, and especially what I did with them...
For people following my blog, no surprises there, led matrices! I was actually surprised to not find any other things that I'd like. The reason for this is that most interesting components (for example the screen of my ECU monitor project) are made by companies that are voluntarly not present in this kind of markets. You'll thus only find common components and of course a lot of leds! Prices are obviously much cheaper than in Europe ;-) .
The matrices I bought were actually quite hard to find (especially the one on the left). From left to right, you'll thus see a 64 * 32 RGB led matrix with a 4mm pitch (around 160 dollars) and a 32 * 16 RGB led matrix with a 6mm pitch composed of SMD leds (around 40). If you compare their prices to the individual 8 * 8 elements you can find on Sparkfun, well I would have been stupid by not buying them :-D .
Two different types of led matrices for two very different types of uses: the one made of the 32 8*8 individual matrices put together is made for indoor use (normal brightness, good opacity, small pitch thus small viewing distance) while the other is meant for outdoor use (very high brightness and long viewing distance). If you are interested in these (the first one can't be found on internet, and the second one is very expensive on ebay), you can contact me to organize some importation (the seller only speaks chinese!).
I have to say that the aspect and quality of these led panels seem very good when examining them (I still have the cliché that "made in china" = bad quality). Solders and assembly are neat, the seller even provided me with some magnet feet allowing me to put the led panels on every metalic surface (ie: my computer!). Very convenient if you don't have much space on your desk. The production date written on the board is end of september 2010 so I am very surprised that it is not possible to find this LED panel on the web.
The main component in charge of controlling any of the (64 * 3 = 192) pixels of one line is the JXI5020 chip (don't forget that you need to scan the array), which seems to be only used in china as I spent 3 hours to find its datasheet (which is in chinese of course). Look at the bottom of this page to download it. The JXI5020 is basically a 16bits shift register with store and output enable commands, and its outputs are inverted. The specified maximum clock frequency is 25 MHz and thus a maximum theoretical LED panel refresh rate of 24.4KHz, allowing 8 bits PWM for 60 FPS (thus 24bits / pixel).
As I wanted to quickly show you these matrices in action, I decided to adapt the wiring of my other FPSLIC based led matrix control board to make it work with these ones. This is when I was very happy that I applied my rule number one when producing this control board: always make two boards when you only need one! As the interface to control the pixels hasn't changed since single color led matrices (only additional contacts for the additional colors), no need to change my code in depth.
My other led matrix is bi-color, composed of 3 64*32 led panels as well. As there is one additional color in the matrices I bought, with the same control board I can thus only control a 2 * 64*32 RGB led matrix panel without using any trick. One led panel interface is thus "sacrified" to connect its color data lines to the addional color on the other two indoor led panels (all the panels have synchronized signals). Of course it is possible to control more of these LED panels by soldering together the clock / latch / enable signals to free some pins on the FPSLIC.
The result looks quite nice! I didn't implement any PWM to correct the colors, but the white balance is still very sweet. Of course, if you are planning on assembling a bigger panel, you'll surely need to control this, as it is the biggest inconvenient of led screens nowadays.
I indeed realize that my control board is now completely obsolete for the led panels I use, so a new one will be made in the coming months (I am thinking using an AT90SAM, FPGA + ARM in a single chip).
In the meantime, I decided to tweak my VHDL & AVR code to allow additional functionalities and max my overall performances :
- Separate buffers for red green and blue
- Possibility to change the red, green and blue data buffer addresses on the FPGA side to allow double (or more) buffering
- Higher display refresh rate: 480Hz! You don't see any flickering now...
- Individual control of each color of the led matrix from the AVR side of the FPSLIC, with only one function call (on / off / normal / inverted). Cool effects are thus easy to do when bringing this led matrix to several shows :) .
- 2bits PWM per color per pixel (woot!), thus allowing a total of 160 frames per second
- 1Mbit/s RS232 speed between the PC and the FPSLIC (through the use of the FTDI) to enable 40 frames per second in streaming mode
And then I wondered, as I always lack of things to display on my led matrices, where could I find nice animations to show on such small resolution screens? The solution was pretty obvious: animated gifs. Yes, these crappy things that are at least 10 years old, who were used so much at the time the internet was at its beginning! Small resolution, no anti-aliasing, simple design, this was perfect.
As my control board is resource-limited, I created a simple 100 lines Matlab script that display on the led matrix one after the other all the animated gifts in a given folder on your computer. Please look at the code below, you will see that Matlab makes it very easy to do such complex tasks. Ah yes, photographing leds (and even worse, filming them) is a very complex task that I still haven't mastered. So the colours you see in the different pictures and videos are not exactly the ones you actually see. Anyway, check out this video:
And here is a small video of my matlab program adapted for this new led panel (you will see that I added a "lag effect" to show the different colours):
And if you are thinking of building a big led screen, look at what I found next to the Xidan metro station in Beijing (this is made with the SMD led panels):
Yes, there are no limits! Don't hesitate to contact me if you have any question, or if you want to buy any of these led matrices (the more we are, the cheaper it will be!) :) . You can also check out the gallery I made with some pictures of the led matrices.
Meanwhile, here are all the files you might need:
JXI5020 datasheet FPSLIC VHDL display code Picture to led matrix transfer Gif to led matrix transfer Webcam matlab script