LED Matrix problem :(..

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone..

Sorry for such a long post. I have a lot to explain.

I have been trying for a few weeks now to get this thing working but with no luck.

I have limited parts so this is the setup.

I'm using the micro to send data to some 74ls164's and then latching that using MIC5801BN's. I'm using the 74164's to cut down on how many wires are needed. Now I started assembling this before it was tested and I have started over from the beginning.

Although I can understand how some of this stuff works. I'm still kinda shooting in the dark when it comes to the correct way to use some of these components. So if I'm way off base please let me know.

My first problem is that the MIC5801BN latches low. So when input = true the output pin goes to ground (is there a way to make it go high? probably not). So if these chips only go low I need something else to get the high side for the led matrix. So.. PNP transistors activate when the base is grounded. So I picked up some 2N3906's for the high side.

Second problem. I set up a small test. One 74164 + One MIC5801BN + 2N3906 + 4 led's. I setup the micro to send data to the 74164 and then latch it. I adjusted the time(the right way I hope) until the LED's no longer flickered. The LED's are dim! They are about 1/2 as bright as they should be. And when I take one LED out the others get brighter! The LED's are connected in parallel with resisters from ground through the PNP transistor. When I connect the LED's in parallel to the +5V to ground they are nice and bright and they don't get brighter when I disconnect one of them. Thinking it was a power problem I isolated the micro and logic. And put a higher voltage through the transistors. Now this seemed to work but it appears that when I disconnect one LED the others get brighter! I was slowly turning up the power on the transistors. At about 12 volts the LED's were at there normal brightness. But!! I could smell something getting hot! I quickly powered down and started probing. The 2N3906's were hot! Reading the datasheet it says they can handle about 40volts. I hope I read that right.

First question. Can these transistors handle more than 4 LED's in this way? If not I have a problem here.

The setup is something like this.

I'm using 2 8x8x2 color LED matrix's. These matrix's have 32 pins. 16 +V and 16 grounds. I would like to use 5 (8 bit 74164 + Latch) units. 2 for red LED's, 2 for green LED's, and 1 for the row's. So the one i'm having a problem with is the rows. In doing some math while posting this I can see that the 2N3906's might not work in powering one row for both LED matrix's. IF one LED can use about 10ma at full brightness thats (10ma x 8 x 2 x 2 = 320ma). So I guess I need a bigger transistor.

Why couldn't these transistors power the 4 LED's I tested them with.

Can an LED matrix of this size be powered on 5 volts? If I use a larger transistor will it take care of the LED's getting brighter when I disconnect one of them? And can that transistor use 5 volts or do I need to go higher? How much power can I expect these LED matrix's to take if all the LED's are on at one time?

Could it be the code I'm using?

I'm still kinda new to coding but it looks something like this.

This will not be complete but I think it will work for this explanation.

loop:

sbi PortA, 0 //set column data pin to 1
rcall clock_data // runs sub for clocking data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data // last clock for a total of 8 bits
cbi PortA, 0 // set data pin to 0

rcall latch_data // runs sub for clocking the latch

So this will now be latched as "11111111" Lighting all the LED's in one row.

sbi PortA, 1 //set row data pin to 1
rcall clock_data
cbi PortA, 1 // set data pin to 0
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data

rcall latch_data

So this will select the first row and activate the first row transistor. 10000000

rcall delay // delay for some time

rcall clock_data
sbi PortA, 1 //set row data pin to 1
rcall clock_data
cbi PortA, 1 // set data pin to 0
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data
rcall clock_data

rcall latch_data

And this will activate the second row transistor.
01000000

rcall delay // delay for some time

rcall loop

I'm doing this from memory but I think its right. This will active all of one color LED's in two different rows and it should not flicker if the timing is fast enough right?

I don't want a row with 1 LED to be brighter than a row with all of its LED's lit.

Can a larger transistor and more power ensure that this will not happen? Does my code need to be tweaked?
I can't remember what the delay code is off the top of my head. I used the delay code from http://avrbeginners.net in the first section. I adjusted the counter start value to reach a short enough delay to get no flicker.

I'm really pulling my hair out on this one. lol :)

Thanks for any help you can give guys.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tevian, a schematic of your setup and test-version would help us to help. It simply takes too much time to build a schematic in my mind from your description.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok.. Here is the schematic. I hope you can see whats going on from this.

As you can see from this schematic I'm using one
transistor to power all the LED's in both Matrix's. Thats 32 LED's in one row.

Are the 2N3906's going to provide enough power? If not could someone suggest a more powerful but small replacement?

Can someone tell me if the my code is proper for this test run?

Thanks again for all the help.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay, let's go ....

2N3906 is too small for this purpose, you need a beafier one
The matrix is connected the wrong way around: the cathodes must be pulled low, anodes high
You need resistors in the base of the 2N3906 (applies too for the beafier one) and you need resistors in the matrix ...
To drive a matrix, there are simpler solutions. You come a long way. Why did you choose this setup ?

Can you post datasheet of the matrixes ? Or at least a typenumber ....
Where do you live ? Where do you buy your parts ?
Do you wish to use the latches/drivers you're using now ?
Will Matrix 1 Green, Matrix 2 Red, and Matrix 2 Green each have their own columnlatch?

Let's take the next step after your reply .....

Nard

edit: added a question

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Plons..

I live near Portland Oregon. There are a few places I can get parts. Theres a Fry's electronics close and a Norvac. I have been buying most of this stuff at a local surplus store called Surplus Gizmos.

As for the setup. I kinda jumped head first into a micro controller a few weeks ago. LOL. I was introduced to the Atmel micros by the store owner at Surplus Gizmos. Since then I built the programmer suggested on the PonyProg.com website. That took me about one weeks a few hours a night to get working. The owner also gave me a kinda freeby circuit board with some logic chips and suck. The board had the 74164's and the MIC5801BN latches on it.

So in answer to your question. I ended up using them just for the sack of understanding how these components work. And I'm trying to make this work as cheaply as possible. Although I might have gotten in over my head in getting these parts to work with the LED matrix's. I have seen other similar setups and I think it will work. I just need a little help on the details.

Here is the info on the LED matrix.

http://www.datasheetarchive.com/specsheet/LTP2188AA.html

Each column will have its own latch channel. And the 8 rows will be controlled by one 8-bit latch. So the positive from each red and green led will be tied together. Then I can just ground either the red or green led to turn it on. And Both to get yellow.

I made that schematic late last night. Sorry. I have reversed the LED's and made a new one.

I kinda figured that the 2N3906's are too small. Is there something that will work at about the same size? Possibly a chip that latches high instead of low? Or should I stick will transistors? If I use another type can I still operate this system with 5 volts? Or do I need to go higher?

I'm not too sure about the resistance. If you could suggest how much and where? Is it necessary?

Thanks soo much for your help Plons.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Since then I built the programmer suggested on the PonyProg.com website. That took me about one weeks a few hours a night to get working.
Have a read over here: https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=36591

The data on the matrix is not very detailed. It would be nice to know what the max. pulsed current is.
For now, let's stick to what we know: 25 mA max. At 12% dutycycle this is average 3 mA.
For the cathode-side you can stick to the drivers you have. Max. 8 pixels are on in one display, so that makes 200 mA. For red and grn together: 400 mA. Driver can handle 500 mA, so that's ok

For the anodes .... hmmm ... maybe a fellow freak has a good suggestion for a high-driver. When using transistors: 2N2905 f.i. Or BC639. Or a darlington BC516. See what you can find/is available @ your supplier.

Resistor-values depend on the choice of high-driver. Add them in either high-side or low-side. See what is the easiest to build.

Nard

Btw: what program do you use for drawing schematics ?

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Plons.

I will see if I can get a few of the transistors you suggested.

The schematic was done with some free software from http://www.expresspcb.com.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The schematic was done with some free software from http://www.expresspcb.com.
The same as I use. If you choose File, Export, then you get a bitmap, default 200 dpi. That is a large file. I re-process it and turn it into a .png-format. Small in size and very clear to read.

For the transistors: in fact any PNP that can handle at least 500 mA collector-current is fine. Any chance you can give some more data on the matrices ? I tried as well, btw. No succes :(

Ooops, BC639 is NPN. BC640 is the PNP. BD140 is fine too.
Sorry for that

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update: found a datasheet of the LTP2258 ... LiteOn.

Max current per dot: 25 mA continuous, 100 mA @ 10% dutycycle. That's more or less what expected.

If you want to have the max intensity, you'll need tougher drivers. Low AND high. 1.6Amp. Have a look for logic level N-ch and P-ch Fet's when you are at the supplier. And 74HC595's.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Plons.

I was able to get some NTE254 Darlington PNP's

They have similar spec's to the ones you suggested. I think.

I have tried these in the test setup. They seem to work great so far. I can now power one whole row and the LED's don't get brighter when I disconnect one of them like before. This is great!!

I tried adding some resistance. I have 1.5k ohm on the base of the transistors. I tried a few different values but it didn't seem to change the brightness of the LED's at all. Is this correct? I also tried adding some resistance between the column latches and the negative side of the LED's. At a quick pulse they seem to need a very low ohm resistor to be full brightness. Something like 20 ohms was almost too much. Anymore than that and the LED's start to get dim. Is 20 ohms going to be enough?

I appreciate all the help so far and I'll wait for your reply.

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't run the NTE254's without base-resistor ... then you need to go to the shop again ... as they will get damaged. 100 mA is max. base-current.

For the base-resistor-value: 1k5 is fine. You can go as low as 100 ohm, but since the darlington has plenty gain ... this is OK.

The datasheet tells that Vce sat=2.5V max. That's the max indeed. I'd expect 1V or so. That is something to test: 5V on emittor, 1k5 from base to ground, and 3 ohm from collector to ground. Put the multimeter across emittor and collector, power up, read the value and power down. It will run hot when kept on.

Now for the series-reistor for the Matrix ;) : my guess is that you'll need a value for the red ones and a lower value for the greens.
Now how to calculate that:

[5V power minus Vce sat (measured) minus voltagedrop across led-dot minus Vce across the sinking driver] divided by, let's say 100 mA (=peak current when multiplexed, 10 % dutycycle)
Your 20 ohm looks very good. But keep in mind that the multiplxer must be running :!:

For experiments: take 100 - 150 ohm

That is it for the high side. We still have a problem on the low side. The drivers there can handle 500 mA (spec of MIC5801)
So either lower the pulsed current to [500 / 16 dots] mA, or get stronger sinkers. The NPN-version of the NTE254 is not recommendable, ... the 5V would need to be increased to 6 or 7 V.

For the software (later ...) : your method works, it's called bit-banging. But AVR's have an SPI-interface too, and that's a very powerfull interface for this application. But all that is something for later on.

Cheers

Nard

edited

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just in case anyone was following the forum posts about the LED matrix and my inability of making it work correctly.

I have now successfully gotten one dual color matrix running using 74164 shift registers mated with MIC5801BN latches for the low side. And some NTE254 PNP's for the high side.

I wish to thank Plons for the help and incite. I really started from ground zero with little electronics knowledge and no micro controller experience.

My code still needs major work and I also need to add the other matrix. :)

Thank you for your help.

PS. To Plons..

In another post I stated that I built my own programmer. It worked ok but I have recently purchased an STK500 so I can program with my laptop. Its working great!

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
In another post I stated that I built my own programmer. It worked ok but I have recently purchased an STK500 so I can program with my laptop. Its working great!
Wise decision :)

Nice to see one more succesfull project.

Cheers

Nard

PS I merged the two topics. Easier for other members to keep track.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm working on something similar, an 8x8 bicolor red/green LED matrix. It's my first major electronics project as well, and I've learned a lot.

Partial schematics, I even have some planned changes I haven't done yet, which will really improve the design. These might be useful to you.
http://blog.davr.org/2006/03/29/...

Two videos of it, including my Pong game I coded so far:
http://blog.davr.org/2007/09/24/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Davidpr.

I like the smaller LED matrix. I tried finding the 74595's locally with no luck. Couldn't even find them in the NTE book at the local Norvac electronics store.

Any way. I have assembled my finished project. I attached some pics on this post. I am happy that its all finished. However I'm not very talented when it comes to coding. Right now I can only display fixed images on the device. I also wanted to create a pong game. A friend is helping me with the coding and with any luck it will be running some.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice job ! Glad you made it.

74HC595's are quite common .... where do you live ?

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I got almost all of my IC's (except my AVR's) for free, by requesting samples from TI, Maxim, Analog, etc. You can do it on their websites, it's very easy. But yeah, shift registers are pretty easy to find in most any electronics (real electronics, not consumer electronics) store.