Overview
As you probably have read by now, the LED display has 256 white LEDs producing a 16x16 display. I chose white because I was a little concerned about the brightness of the display, especially when outdoors under some sunlight. As it turns out, I now have a super bright display. The brains of the display is a microcontroller from PIC, PIC18F4520. Its internal oscillator can only go up to 8MHz, but you can use an external oscillator of up to 32MHz. Many features of the chip includes 13 channels of 10-bit ADC, 4 timer modules, 5 PWM outputs, serial communication (I2C and SPI) support, 32KB of ROM, 1.5KB of RAM. However, for this project, all I needed was 32 digital outputs to control the 16 rows and 16 columns.
Materials
- 12"x12"x(3/16)" Black Acrylic Sheet
- 256 White LEDs
- 16 2N 2222A Transistors
- A 32-Wide Ribbon Cable
- A working microcontroller with at least 32 digital outputs*#^
- A hot glue gun
- Some hot glue sticks
- A soldering iron
- Lots of solder
- Some heat resistive tape
- Access to a laser cutter big enough for the acrylic sheet (Sorry, this is probably the hardest one to get.)
I
*I will not cover how to setup a microcontroller here as it can be an entire separate project by itself for beginners. However, that means you can make a Graduation Cap LED Display with any, ideally your favorite, microcontroller (I sense many of you grabbing for your Ardunio Megas).
#For beginners, you have 2 options. One, read up online about the Ardunio solution. Note that you will need the Mega version since you need at least 32 digital outputs for this project. Two, you can visit the wiki that my lab has setup. It should have enough information for anyone to start from scratch.
^Technically, if you have a 4-bit decoder, you could get by with 20 digital outputs. More on this later.
Step 1: Laser Cut The Acrylic Sheet
Time: 1 hour. Including experimenting with different hole sizes, separation distances and configurations.
Each LED has two leads, an anode and a cathode. So in order to glue them onto the acrylic sheet, each LED would need 2 holes. Here's a picture of how I cut my acrylic sheet.
The square is 10" by 10", roughly the size of the mortarboard of the graduation cap. Then there are 256 pairs of holes for the LEDs. The holes are 0.03" in diameters and 0.08" apart. Each pair of holes is spaced 0.60" apart. The ones on the edges are 0.50" from the sides. Here's a video of the laser cutter in action.
Time: 2 hours. This was one of the most tedious part of the project.
Now that you have the holes in the acrylic sheet, we can start putting the LEDs in. Most LEDs will actually press fit into the hole because of the little bulge on the leads near the bulb (see picture below). However, just to be on the safe side, I put a dot of hot glue at the bottom of the LED right between the two leads before jamming them through the holes.
IMPORTANT: Make sure you put the LEDs in the same orientation. All anodes (the longer lead) should be on one side.
Step 3: Solder The LED Leads
Time: 10 hours. I kid you not. This part took forever! Imagine soldering all 256 LEDs, that's 512 solder points!
After securing all the LEDs onto the acrylic sheet, you can turn it over without worrying about them falling out. A vice would be very handy here. Find the side where the anodes of the LEDs are closest to. This is the row that we will start with. Bend all anodes towards the edge of the acrylic sheet and all cathodes to either side. Solder all the cathodes together and then put some heat resistive tape over the entire row. For the next row, you do the same thing except you also have to solder the corresponding anodes together. This may seem very abstract right now, take a look at the pictures below and everything will make sense.
To make sure you have everything connected correctly, you can connect +5V to any anode and ground to any cathode. This should light up the LED corresponding to the chosen anode and cathode. It is recommended that you have a resistor in there as well, 1K would do. It's not a big problem if you don't have a resistor, just make sure you don't have the LED on for too long, otherwise you may burn it. How long is too long? Well, if it's hot to the touch, that's not good. Another alternative is simply to use a lower voltage.
Step 4: Solder The Ribbon Cable To The LEDs
Time: 45 minutes.
This step is pretty straight forward. You just have to keep in mind which wire is for which column and which wire is for which row. A tip would be to figure out how long of a cable you need from the center of the board to the furthest lead, then separate all wires to that length before soldering. It will make your life easier. See pictures below. Step 5: Connect It To Your Microcontroller
Time: 45 minutes.
So your microcontroller should have at least 32 digital outputs. You should also have 16 2N 2222A transistors. 16 of your digital outputs will be used to control the transistors (connected to the gate) and the other 16 are directly connected to the cathodes. The collector of the transistors should be wired to +5V and the emitter to the anodes. A high signal to the transistor and a low signal to the cathode will allow current to flow through the LED.
I did not include any resistor into my circuit because I wanted maximum brightness over longevity of LED. Yes, the LED will probably burn out faster, but I wanted the brightness. Furthermore, I'm going to be scanning through the rows anyway, so the LEDs are really only on at most 1/16th of the time and not continuous operation. Well, that's the theory anyway.
Step 6: Program Your Microcontroller
Time: 4 hours.
This step will obviously depend on the microcontroller you use, but I will try and outline the structure of the program that I wrote.
Scanning Interrupt
This is the most important part to make this work. The reason why we can control 256 LEDs with only 32 outputs is because we are only controlling 16 LEDs at a time. But we switch between rows of 16 LEDs so fast that our eyes can't tell (persistence of vision). This is the same as how TVs and monitors work. My interrupt scans at 260us, so it takes 260us x 16 = 4.16ms to scan the entire display, which yields 240Hz! Pretty sweet yeah?
Global Variable For Display
You will need a global variable that stores all the information on what the display should be showing at any given moment. When the scanning interrupt is called, it is going to look up this global variable, find the row it needs and set the output pins accordingly.
Constant Data For Characters
Text is probably something that you will be displaying over and over again, and since the letter "A" will always look the same, you probably want to store that in your ROM instead of your RAM. Most microcontrollers have way more ROM than RAM, so make use of it!
4-Bit Decoder
I mentioned earlier that you could actually get away with only 20 digital outputs if you have a 4-bit decoder chip. Well, the way to do that is you have 4 outputs that go through the decoder, which then gives you the 16 outputs to select which transistor to turn on. The only difference here is that you have to send one and only one high signal to one of the transistors and low to all others. It's not really a bad thing, but it is something to keep in mind.
|
