Need help: How to make my own 24x16 LED Matrix display

CrossRoads:
Looks like a good start. Hard to tell which are anodes & which are cathodes.

I'm not sure myself :). The actual 8x8 LEDs that I have are far worse. They've got them all mixed up. i.e. Pin 1 is for column8 and pin2 is for row6 and so on :astonished:

One of the other members posted this URL to Nerdkits over here: NerdKits - DIY Marquee LED Array Display

I think it's a very interesting idea to connect 2 LEDs between the same terminals so that I alternate the polarity between the terminals in quick succession and light both of them. This should allow me to reduce the number of bitshifts by half. Theoretically, I should be able to run a 24x16 or even a 32x16 LED array with just 3 bit shift registers (2 for columns and 1 for rows). Of course, this would require twice the number of processing cycles by the MUC, but I think the Atmega is capable of doing it fast enough to avoid any flicker.

What do you think?

Seems like you'd be taking on a lot of hassle to save 2 parts.

CrossRoads:
Seems like you'd be taking on a lot of hassle to save 2 parts.

No hassle at all since I'm doing this for fun :). I think it's just amazing that with some thought, we can reduce the number of bit shift registers for a 24x16 display down from 12 to 7 to 5 and now to 3.

Of course this is theoretically speaking. I'm sure getting the algorithm to convert an array using 3 bit shifts will be a bit challenging. And I lose the benefit of the pull-up resistor to the +5V pin on the arduino, thereby limiting it to just 40mA max. I think bad code might actually introduce a flicker here since it takes twice the number of cycles to power the pattern.

Well, I may have been wrong. I've tried to bring it down to 3 shift registers, but I can't do it. The best I could do using the reverse polarity trick is to bring it down to 4. I've attached an image of the circuit I could come up with. The Anodes and Cathodes of the 8x8 displays are shown in the image. Anyone know of a way to bring it down to 3 shift registers?

Premature optimization is the root of all evil. - Donald Knuth

florinc:

Premature optimization is the root of all evil. - Donald Knuth

Agreed :). I'm not saying I'll do it this way in my project. I'm just curious to see how the difficulty increases. Honestly, I'm much better at coding than electronics. So, why not try to push the MCU to it's limits? Trying to code for this is like a real brainteaser.

why not try to push the MCU to it's limits

Beside the display, you may need your MCU to perform other operations, like reading buttons, getting time from RTC etc. If the MCU is busy most of the time with the display, it may look unresponsive to the user.

florinc:
Beside the display, you may need your MCU to perform other operations, like reading buttons, getting time from RTC etc. If the MCU is busy most of the time with the display, it may look unresponsive to the user.

Let me try it and see.

Well, looks like the circuit with 4 shift registers also doesn't work. I realised that the shift register doesn't have a high impedance state i.e. at any point, every pin will need to be either HIGH or LOW. It can't be 'disconnected' and hence, not possible to turn on just a single LED using that circuit. So, I guess the best way to do this would be with 5 shift registers.

I can picture florinc and CrossRoads smirking silently :blush:

Many (most?) shift registers have a high impedance state, with their output enable turned off - they look like an input then, allowing something else to drive the bus.

CrossRoads:
Many (most?) shift registers have a high impedance state, with their output enable turned off - they look like an input then, allowing something else to drive the bus.

They do, but high impedance can be applied for either all the pins or none of the pins i.e. output enable turned off or on. It can't be done for say, one of the 8 output pins. Checked this on both, the 4094 and the 595.

In any case, I've been able to make some progress today. I've got to the point of taking a matrix of 24x16 bits (48 bytes) and putting it on the display. On the simulator of course. Code currently uses shiftOut and no asynchronous updating of the display. Once I'm able to make it more flexible, the next steps would be to use SPI for the shift registers and use interrupts so that any updates to the display can be done asynchronously.

I have a few leftover PCBs from my LED matrix shield, which I can send to you to experiment, if you are interested:

They use 595 (4 pieces) and one ULN2803. Connect your own matrices to the board with wires (I don't think you have the same exact ones I have used).

florinc:
I have a few leftover PCBs from my LED matrix shield, which I can send to you to experiment, if you are interested:
Wise time with Arduino: New and improved "Dual LED matrix shield"
They use 595 (4 pieces) and one ULN2803. Connect your own matrices to the board with wires (I don't think you have the same exact ones I have used).

That would be awesome, thanks! :slight_smile: But I'm in India, is there a non-expensive way to ship them over here? Very nice blog btw, I did stumble upon it some days ago when I was researching on this topic. I hope to be able to make my own shields sometime.

Here's the progress on my board though. I've gotten the code to a point where I can place an 8x8 pattern anywhere on the 24x16 grid and it renders it fairly well. In the attached image, you can see the letter 'A' slowly drifting across the display. Of course, wiring these up on a breadboard will be next to impossible, so I'm trying to learn eagle cad so I can design a PCB and get it printed. But looks like that'll take time :(.

Very nice blog btw

Thanks.
PM me with your address and I will send the PBCs to you.

How do you simulate running the code? And how did you generate the pretty picture with the character on the LED matrix?

Sent you a PM with my address. Thanks once again, that's very generous of you! :slight_smile:

florinc:
How do you simulate running the code? And how did you generate the pretty picture with the character on the LED matrix?

I'm using Proteus to simulate the circuit. Here's a great tutorial which explains how to set it up. It just takes a few minutes to set it up. You have to use the Hex file that the Arduino IDE generates in your AppData temp folder and it works. Of course, it can't simulate as fast as the real thing, but it's great for prototyping.

Unfortunately, nothing fancy about the picture. Just ran the simulation, paused it, took screenshots and put them together in mspaint. Quick 5 mins :).

Have been experimenting with CrossRoads' schematic with pull-up resistors for a single 8x8. For one thing, the LEDs are brighter than when powering it through the pins directly. However, when 6-8 LEDs in a single column light up i.e. all powered through just one pin on the shift register, they're noticeably dimmer than when running just 1-2 LEDs.

Is there a way to keep the brightness constant irrespective of the number of LEDs that are lit up in a column? Maybe a constant current source?

I'm sorry I can't fully answer your question although I do believe that you can use a transistor that will switch when there is an amount of current going through. Now this wouldn't be used to bring the brightness up for the 6-8 but more so to bring the brightness down from the 1-2 leds. May not be the best but it would be consistent.

"However, when 6-8 LEDs in a single column light up i.e. all powered through just one pin on the shift register,"
Is this the shift register that is sinking the cathode current?
Otherwise I do not think your multiplexing is working correctly.

The LEDs in a column are each powered from their own pullup resistor. The cathodes are all sunk together.
The TPIC6B595 can sink 500mA, so 160mA from 8 LEDs should not be a problem.

funkyguy4000:
you can use a transistor that will switch when there is an amount of current going through

Not sure I follow completely. You mean a separate power source through the transistor which would be triggered by the shift register? Or perhaps connected directly to the pull-up. But again, I'm not sure if that would give me consistent brightness levels.

CrossRoads:
Is this the shift register that is sinking the cathode current?

Yes, one pin on the cathode shift register sinking the current from 8 pins of the anode shift register. I've attached a photo which shows the problem. The other alternative I tried was to have no more than one LED turned on at a time. But this increases the number of cycles by 8 times which is definitely not cool. The scanlines become visible in a camera. Also, the LEDs are considerably less brighter.

CrossRoads:
The TPIC6B595 can sink 500mA, so 160mA from 8 LEDs should not be a problem.

The store near my place didn't have 595 registers. So I'm using the HCF4094B which was all he had. Could that be the problem? Would the 74HC595 register do or would I need to use the TPIC6B595?