Gigantic 5x7 LED Matrix 
Written by AnubisTTP on 2010-06-17  


Completed LED matrix.

Back in 2006, Sparkfun Electronics published an article detailing the construction of a massive 7-segment display out of foam and plastic sheeting. The project was quite popular and a gigantic GPS clock built from such displays has featured prominently in Sparkfun promotional material over the years. When the project was posted, I like many other people wanted to build one of my own, possibly using a 17-segment display or an LED matrix for the increased display ability. After three years I finally decided to put that thought into practice, and built my own monster display modeled after a common 5x7 LED matrix. At the very least, if I manage to severely damage my eyesight from improper handling of lasers or high-brightness LED's, I will have no trouble seeing this monster from a distance!

History

The history of the 5x7 LED matrix is cloudy at best, but collectors generally agree that the Monsanto MAN-2, pictured below, was the first such device to be produced in any volume. Monsanto quite brazenly claimed that their early seven-segment LED displays were 'alphanumeric', but even company datasheets admitted that only nine letters could be generated with seven segment displays, making the MAN-2 a practical necessity. Monsanto later released the MAN-2A, which was manufactured using a dark red epoxy that did much to hide the display's crude construction. Crude or not, these early 5x7 matrix displays could generate nearly any English character, and other companies quickly followed suit in manufacturing their own competing devices.


Monsanto MAN-2 5x7 LED display with driver hardware.

These early devices were cumbersome in the extreme; in 1970 solid-state memory was still black magic and microcontrollers were a distant fantasy. The task of storing and displaying alphanumeric characters required an entire array of support circuity, the MAN-2 shown above is dwarfed by its character generator and buffer driver circuits. Early manual control 5x7 matrix displays like the MAN-2 were quickly replaced by a new generation of displays, which incorporated character driver hardware directly within the LED package.


Various LED smart displays; from upper right: Texas Instruments TIL311, Siemens DLR2416, Hewlett Packard QDSP-2273, Hewlett Packard HDSP-2112, Hewlett Packard HCMS-3966, Siemens DLO7135.

'Smart displays' were easy to use, as they take much of the heavy lifting out of designing circuits to drive all those LED's. Early smart displays, like the HDSP-2000, simply added shift registers to the diode package whereas more advanced displays like the HDSP-2112 bring entire character generators, memory addressing systems, and cursor control circuits directly into the display package. Smart displays like these have a problem however, they are crushingly expensive. A display like the HDSP-2112 can be bought today from the usual suspects like Mouser and Digi-Key, but a single display will set you back well over fifty dollars. Even a reasonably affordable display like the HCMS-3966 will set one back $25 - $30 dollars in single unit quantities. Smart displays suffer from an almost total lack of use in modern day electronics, they are simply too expensive to make sense in all but the most costly devices.




A selection of images showing a modern assembled 5x7 LED matrix as well as the major parts used in it's manufacture.

A modern 5x7 LED matrix shares about as many features with these earlier designs as a coelacanth shares with a slab of pollock being held by the guy on the front of the Gordon's Fish Sticks box. Gone is the ceramic substrate, photo-lithography traces, side brazed pins, hermetic packages, glass cavity windows, built in character generators, and any of the other niceties that make the older smart displays both reliable and fabulously expensive. Modern displays are made out of discrete LEDs soldered to a sheet of PCB material, with a plastic overlay to shape the light emitted from the LED's. Some displays use small surface-mount LED's for this process, but the majority of manufacturers opt to ball-bond naked LED dies directly to the PCB material. The plastic mask is backfilled with epoxy, bonding PCB and overlay material into a sturdy package. LED displays manufactured in this fashion are quite affordable and can be bought from innumerable Chinese vendors on Ebay, as well as from more reputable sources like DigiKey and Mouser. Most of these displays are only a few inches across... two inch displays are fairly standard, and four inch displays are about the largest size easily obtainable. The only easy way to get a display that is larger than this is with a LED matrix of your own construction.

Construction

The first piece I needed to make for my display was the LED overlay, the block of material that would confine the light from each LED to a single dot and define the shapes of the dots. The SparkFun 7-segment displays used standard white Styrofoam sheet for this purpose, which is cheap and readily available but impossible to cut cleanly without special tools. To get around this, the Sparkfun people used a thin sheet of foam board on top of the Styrofoam to mask the digit and give it a nice clean appearance. Already faced with the prospect of having to cut 35 holes for just a single display, I was not exactly thrilled with the prospect of doing it a second time with foam board and getting the holes to line up perfectly between the two pieces. I opted to use pink insulation sheet foam for my display; it's more expensive than the standard white Styrofoam, but you can make a smooth clean cut on a sheet of pink foam with nothing more exotic than a box-cutter. Trying to cut out 35 perfectly round holes in a piece of foam with hand tools would drive a person to insanity, fortunately I had a better solution. The key piece of equipment is a 'Dremel' style rotary tool, like the one shown below.


'Dremel'-style rotary tool.

For this to work your rotary tool will need to have a routing attachment and a drywall cutting bit like the one shown above; many rotary tools come with these attachments standard nowadays, but if you won your Dremel-clone at the state fair when a carnival carnie could not guess your girlfriend's weight, you might want to plan a trip to the hardware store. Drywall bits are for cutting irregular holes in drywall and other soft material, and look somewhat like a drill bit with the tip cleaved off. If you have multiple different sizes of bit, try each one on a piece of scrap foam first until you find a bit that does not vibrate and leaves a fairly clean cut.


Cutting round holes with a rotary tool.

The trick to cutting a nice round hole with a rotary tool is to drive a wood screw into the center of the hole you want to drill, then to use it as a guide as you are cutting the hole. As long as the rotary tool is pressed tightly against the screw, you will get a perfect hole every time. To make bigger holes, put washers around the wood screw before you insert it; the diameter of the hole cut will increase equally to the diameter of the washer.

The standard rotary cutting bit is, unfortunately, only half as long as pink foam insulation is thick, which necessitates that the foam sheet be flipped over and cut from both sides to completely remove the material from each hole. Be prepared to develop a deep lasting hatred for the pink dust that is produced by cutting this type of foam insulation, as by the time one has cut 70 holes into a piece of foam they will be covered with the stuff. Needless to say, a dust mask and safety goggles are not an optional accessory for this part of the assembly process. The cutting process unfortunately can not be rushed, even a slight slip during cutting will carve a gouge out of the side of the hole that will ruin the shape of that LED element later. (I ruined one piece of foam discovering this fact the hard way!)


The completed foam overlay and wooden frame.

Pink foam insulation is not exactly the most photogenic material on the planet, so I constructed a wooden frame to enclose the foam overlay and hold it firm to the panel that would eventually hold the LED's. The frame was constructed out of 1/4 inch basswood and finish nails, with a few wooden slats on the back to hold in the LED panel. Luckily enough, the local hardware store sold pre-cut lengths of basswood that were the perfect width to hide the edges of the foam overlay; a few cuts with a coping saw and some faux-walnut stain were all that was needed to hide the onslaught of pink. I made sure to drill some small holes around the front edges of the frame before I stained and finished it... these will be needed later to install fasteners that will hold the front of the display in place.


LED's affixed to a cardboard sheet.

The LEDs are attached to a sheet of cardboard cut to the same dimensions as the foam overlay, when assembled the cardboard will be firmly pressed between the foam overlay and the slats on the back of the frame. The LED's themselves are diffuse 5mm RGB models of a type that can be bought from China in large quantities on eBay. I chose RGB LED's not so much because I intended to make an RGB display, but because 4-lead devices are much easier to mount to a sheet of cardboard without drilling holes; just bend the leads into a plus-shape with the LED pointing upwards. It is difficult to glue or tape a two-lead LED to a flat surface, the LED tends to want to roll sideways or point in a useless direction while the glue dries. The LED's are wired up in a standard row-column fashion, the anodes of each row of LED's are ganged together as are the cathodes of each column. The actual wire is from a standard IDE cable... cheap and readily available.


Marking the locations of the holes on the cardboard sheeting.

Before affixing the LED's to the cardboard panel, I dry-assembled the panel and overlay in the wooden frame, and then marked the location of each hole on the cardboard sheet. This way I could place perfectly-centered LED's when I attached them to the panel later. This would also be a good point to take a few minutes and think about type of driver electronics to use and where exactly to stash them when the display is running. My driver board was fairly small, so I chose to carve a cavity in the back of the foam overlay of the proper dimensions.


A location must be carved away in the foam overlay to make room for driver electronics.

Now I needed a diffuser, something to attach to the front of the display to dilute the light and make it look more like a traditional 5x7 LED matrix. The logical choice would be smooth diffuse acrylic panels of the sort used for florescent light fixtures, but I could find no local sources for such a material. In the end I was forced to use textured plastic panels which were originally designed for use as ceiling material in cubicle farms, these had the virtue of being both cheap and available in continuous sheets large enough to cover the front of the display. To hold the plastic panel in place, I used strips of pre-cut plastic trim from the local hardware store. The trim, originally designed for sealing shower doors, seemed to exist solely to fulfill that old adage; "Nothing in a hardware store is bought for its intended purpose."


Plastic trim and diffuser.

The proper thing to do at this point would be to cut precise 45 degree miter joints along the edges of the trim pieces, allowing them to interlock when the front of the display is assembled. Various tools have been made to try to make this tricky process easier, but I did not have any of those. I ended up taking the path of least resistance and using lap joints on all the trim pieces; such joints look fairly clean with trim of this profile, and the only tool needed is a boxcutter. The front of the display is held on with a number of finish nails, which fit into the holes drilled into the frame earlier for this purpose. The next step; covering up that massive onslaught of pink foam foam with paint.


Diffuser installed into frame.

There are certain things that one discovers while constructing a project such as this. Like, for example, that spray paint will actually dissolve styrofoam sheeting! Mind you, it is even better if you discover this property of spray paint before you have taken a foam panel you spent four hours carving and then drenched it with enough paint to kill a New York street performer. I managed to douse the panel in water before it was totally destroyed but the face was pocked and burned from the chemical reaction. The solution: white-out correcting tape over the worst of the holes and about a dozen coats of latex based drywall paint to hide the shame. Cheap latex based paint from Wal-mart is thick and sticky, and works well to fill holes in situations such as this.


Completed LED matrix.

The Electronics

The circuits used to drive a LED matrix are fairly standardized and well known. The diodes in a LED matrix are wired up in a row-column circuit, where every cathode in a given row of LED's is shorted together as well as every anode in a given column. An IC 'scans' across the matrix, illuminating the selected LED's in each column sequentially. The scanning action happens so fast that the human eye can not discern it, making every column of LED's appear to be continuously lit.


LED matrix drive signals.

As it turns out, there is a standard IC designed to do this task, the Maxim MAX7219. A single 7219 can handle all of the scanning and storage needs for a 5x7 LED matrix, data is loaded into the chip serially through a three wire interface. The MAX7219 has a problem though, it is painfully expensive. MAX7219 IC's cost ~$10 dollars in single unit quantities, the expense for a multi-digit display can rapidly spiral out of control if you rely on this chip for every digit. For this reason I opted not to use a MAX7219, and instead drove the row cathodes directly from the I/O pins on a microcontroller, with a dirt-common 74HC595 shift register to handle the strobing of the columns. This is a fairly common circuit that is used in projects all over the Internet to drive LED arrays; apparently the rest of humanity considers the MAX7219 too expensive as well.


LED matrix controller schematic.

The entire circuit is shown above. Fortunately we used to sell a Game of Life kit that has an almost identical circuit, so I was able to cheat somewhat by taking a leftover PCB and modifying it to fit in the back of the LED matrix. This was due more to laziness than necessity, as the drive circuit has a low enough parts count that it can easily be assembled on a piece of scrap perfboard. (Once again I followed Ohms Law, and took the path of least resistance!)


YS-210 Game of Life kit.

Aside: Yes, the boards really are that color, despite appearances the camera is not having a questionable Automatic Color Correction Moment. While perusing the vast array of options at our board fab house, we discovered that blue was one of many colors our fabricator offered as an alternative to the boring green PCBs that have graced product interiors since soldermask was invented. Caught up in the moment, we blithely checked off "Blue" on the order form and sent the gerbers on their merry way, blindly expecting to get the color that has featured so prominently in certain popular electronics recently. Instead, we ended up with PCBs tinted a truly bizarre shade of blue-green that left onlookers wondering if all that homemade hooch was giving them color blindness.


Operational LED matrix.

In the operational photos it becomes abundantly clear that cheap Chinese LED's come with a caveat: widely varying brightness. It is impossible in a multiplexed display to use resistors to match LED brightness, the typical way to get around this problem is to pulse each LED with a different frequency to vary the brightness on a cell-by-cell basis. This can add a substantial computational load to to the processor however, and use up resources and interrupts that could be better spent on more interesting functions. Texas Instruments manufactures a driver IC, the TLC5947, which is designed to solve this problem by providing 24 PWM-capable LED outputs that can be loaded from a single serial input. Unfortunately the TLC5947 is only available in various hobbyist-unfriendly microscopic surface mount packages and is pricey to boot, about four dollars in single unit quantities. Ultimately I decided to just live with the patchy LED brightness, it is hard to justify an elaborate PWM control scheme on a decorative art object.


It's featherlight!

So there it is, a 5x7 LED matrix so large that it is almost hilariously impractical. Now I have a new problem... the thing is so big and awkward, there is no place in my house with enough free room to hang six of them! Building a six digit clock out of these things will have to wait until I win the lottery, or at least until someone invents a Bag of Holding that actually works.

Code

I banged out some quick code to display a static image on the matrix, using the circuit above. The code is designed for a PIC 16F84A, a common and well documented, if old, microcontroller. This code will probably work on a newer 16F628 chip as well, but will almost surely require minor changes to disable the built in comparator in the 16F628.

; File LEDmatrixdemo.ASM
; Assembly code for PIC16F84 microcontroller

; CPU configuration


processor 16F84A
include
__config _XT_OSC & _WDT_OFF & _PWRTE_ON
;--------------------------------------------

; Declare variables


J equ H'1F'
K equ H'1E'
mux equ H'20'

;------------------------primary onscreen area
cella equ H'21'
cellb equ H'22'
cellc equ H'23'
celld equ H'24'
celle equ H'25'
cellf equ H'26'
cellg equ H'27'
cellh equ H'28'
temp equ H'29'
rox equ H'2A'
ceox equ H'43'
eset equ H'44'
;-----------------------------------------------------
; Program

org 0 ; start at address 0

; Set ports and initialize


movlw B'00111100'
tris PORTA
movlw B'00000000'
tris PORTB
movwf PORTA
movwf eset
movlw B'00000001'
movwf PORTB
movlw D'8'
movwf mux
movlw D'9'
movwf rox

;-----------------load the offscreen with default values (Change these to change the image displayed)

movlw B'11111111' ;
movwf cella
movlw B'10000001' ;
movwf cellb
movlw B'10111101' ;
movwf cellc
movlw B'10111101' ;
movwf celld
movlw B'10111101' ;
movwf celle
movlw B'10111101' ;
movwf cellf
movlw B'10000001' ;
movwf cellg
movlw B'11111111' ;
movwf cellh

;----------------begin main loop
mloop: bcf STATUS,C

;Insert code here... change the contents of cella - cellh to change what is on the LED's

call segsend ; include this in your main event loop--- refreshes the LED sceen.

; Waste some time by executing loops (change this to change execution speed.)


movlw D'40'
call delay1

goto mloop ;---------------- end main loop

;----------------- generic delay routine


delay1: movwf J
zloop: movwf K
yloop: call segsend
decfsz K,f
goto yloop
decfsz J,f
goto zloop
return

;----------------- draw to bitmap
segsend: movfw mux
movwf temp
decfsz mux,1 ;skip if zero
goto segsend2
movlw D'8' ;reset the mux level
movwf mux
bsf PORTA,1 ; serial line high, new cycle

;---- and now to figure out which row we are on
segsend2: movfw temp
SUBLW 7 ;check and see if lsd is higher than 7
BTFSS STATUS,C
goto segd1 ; and do this if it is
movfw temp
SUBLW 6 ;check and see if lsd is higher than 6
BTFSS STATUS,C
goto segd2 ; and do this if it is
movfw temp
SUBLW 5 ;check and see if lsd is higher than 5
BTFSS STATUS,C
goto segd3 ; and do this if it is
movfw temp
SUBLW 4 ;check and see if lsd is higher than 4
BTFSS STATUS,C
goto segd4 ; and do this if it is
movfw temp
SUBLW 3 ;check and see if lsd is higher than 3
BTFSS STATUS,C
goto segd5 ; and do this if it is
movfw temp SUBLW 2 ;check and see if lsd is higher than 2
BTFSS STATUS,C
goto segd6 ; and do this if it is
movfw temp
SUBLW 1 ;check and see if lsd is higher than 1
BTFSS STATUS,C
goto segd7 ; and do this if it is
goto segd8
;--- end frame checks, begin drawing
segd1: movfw cellh
movwf temp
goto segend
segd2: movfw cellg
movwf temp
goto segend
segd3: movfw cellf
movwf temp
goto segend
segd4: movfw celle
movwf temp
goto segend
segd5: movfw celld
movwf temp
goto segend
segd6: movfw cellc
movwf temp
goto segend
segd7: movfw cellb
movwf temp
goto segend
segd8: movfw cella
movwf temp
goto segend
;---- and now we finally draw to the screen

segend: movlw B'11111111'
movwf PORTB ;--------------clear the screen
bsf PORTA,0 ; clock line high
movfw temp
movwf PORTB ;--- draw it
bcf PORTA,1 ; and clear the serial line
bcf PORTA,0 ; clock line low
return

; ------- rotate a byte, not through carry
rotx: rlf temp,1
BTFSS STATUS,C ; was low bit low
goto cob1 ; then do this
bsf temp,0
goto cob2
cob1: bcf temp,0
cob2: nop
return

end


©2000-2024 Industrial Alchemy. All rights reserved. | Switch to mobile version | Contact |