Pages: [1] 2   Go Down
Author Topic: Help with brightness levels on 5x7 matrix  (Read 5289 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi...  I am testing out a 5x7 LED matrix, being driven by an MCP23018 I/O extender.  Everything is working great, scrolling text and all.

The problem is...  The LED's are much brighter when only one light is on in a column, and much dimmer when all seven are on.

I'm probably missing some basic electronics thing, I suppose.  Any ideas?

Schematic is here, or click through for bigger:



BOM...
  • 1 604-TA12-11YWA Kingbright YELLOW DIFFUSED 5X7 DOT MATRIX LED Display $2.22 Datasheet
  • 1 579-MCP23018-E/SP I/O Expanders, Repeaters & Hubs 16B I/O Expander I2C interface $1.58 Datasheet
  • 1 652-4116R-1LF-100 Resistor Networks & Arrays 16pin 100ohms Isolated Low Profile $0.60 Datasheet
  • 5 512-2N3904BU Bipolar Small Signal NPN Transistor General Purpose $0.10 Datasheet
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LED's are much brighter when only one light is on in a column, and much dimmer when all seven are on.

That is because you have wired it up wrong. Put those resistors the other side.

Also you need resistors in the base of the transistors. And those are the wrong sort of transistors, you can't use NPN as a top switch because you don't get the full voltage out of them. They need to be PNP and the other way round, that is emitter to +.
Logged

0
Offline Offline
Shannon Member
****
Karma: 201
Posts: 11744
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The circuit looks good -  the dimming is either an insufficient power supply or you need to beef up those 2N3904's - the Vbe may be quite large when driving 7 LEDs as that's taking the transistor close to its max rated current... In general emitter-follower circuits like this tend to droop as the current increases, it might be the cause here.  The situation will be being compounded by the fact you load the chip close to its maximum sink current of 25mA (its output will be significantly higher than 0V because of this).

Try checking the voltage on one of the columns as you change the number of LEDs lit.   You might want to get a higher rated transistor (at least an amp Ic).  Look at the specs for the ZTX851 for instance (5A continuous current, 20A peak, 0.05V Vsat at 1A..., gain 200 at 2A)  I think that's about state of the art for a small bipolar transistor.

But do stick a multimeter on it to figure out what's actually happening.
Logged

[ I won't respond to messages, use the forum please ]

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, guys!  I'll try these ideas out.

The situation will be being compounded by the fact you load the chip close to its maximum sink current of 25mA (its output will be significantly higher than 0V because of this).

Should I also be using transistors on the rows then, too, to fix this problem?
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The circuit looks good
Well I would disagree with you, there are lots of things wrong with it.

Quote
In general emitter-follower circuits like this tend to droop as the current increases,
Simply not true, emitter followers don't droop.
It could be that the outputs of the arduino are drooping because there are no base resistors and the voltage at the emitter is never going to be greater than 0.7V lower than a logic high. That's why emitter followers are no good here.

Quote
But do stick a multimeter on it to figure out what's actually happening.
This circuit is multiplexing, you will get no sensible reading with a meter, you need a scope if you are going to see something happen.

Quote
The LED's are much brighter when only one light is on in a column, and much dimmer when all seven are on
How are you driving the multiplexer? You should be enabling a row and then setting the columns. If you are then it is the fact that you are using the wrong type of transistor circuit that is your problem.

So two conflicting pieces of advice, you choose.
Logged

Norman, OK, USA!
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Klingon Machinist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm very interested in this. I have a handful of Column Anode 5x7 matrix displays to play with.

Thanks.
Logged

M.S.

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The LED's are much brighter when only one light is on in a column, and much dimmer when all seven are on
How are you driving the multiplexer? You should be enabling a row and then setting the columns. If you are then it is the fact that you are using the wrong type of transistor circuit that is your problem.

Ah..  Oh really?  Well, the way I am driving it right now is akin to the following.  It's actually in interrupts, but let me pull it out here just for simplification

Code:
uint8_t row_bits = { 0x7f,0x41,0x41,0x41,0x7f }; // Perfect square
int col = 5;
while(col--)
{
  port_extender.SetPorts(0x80>>col,row_bits[col];
  delay(3);
}

My 'SetPorts' method sends the first out to the 'A' port, where the columns are connected (with pullup resistor enabled), and sends the second out to the 'B' port where the rows are connected.

Would you mind explaining why it should be driving one row at a time?  This would help my understanding.

I'll try driving it by rows first, because that's the easiest thing to change...  It's only software smiley

So two conflicting pieces of advice, you choose.

That's ok!  The more advice the better.  I can try both.

Quote
I'm very interested in this. I have a handful of Column Anode 5x7 matrix displays to play with.

I shall post the entire thing on my blog when it's working.  You can see the schematic and BOM I'm using above.  If you want the code in the meantime, I'll post that too.

My next step is going to be to hook up 8 of these next to each other for a bigger display.  8 is the max port extenders I can have active on the I2C bus at once without driving the address pin with software.
« Last Edit: March 10, 2011, 03:20:39 pm by maniacbug » Logged


Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I swapped the multiplexing to "by rows", and left the electronics alone, just to see what would happen.  The problem is still there (as we can imagine), but the impact is lessened considerably.  Probably because the instance of long swaths of horizontal lights is much less than the instance of long vertical swaths, especially with lowercase letters.

Next up, the joy of rebuilding the circuit.
Logged


Norman, OK, USA!
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Klingon Machinist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Bug. I'm watching to see how this goes.

Thank you.
Logged

M.S.

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok,I now moved the resistors to the columns.  That, along with multiplexing by rows, seems to have fully SOLVED the problem.  Yay.

Here's the new circuit.


Still, in the interest of learning what the heck I'm doing, I'm trying to understand transistor circuits, and trying to figure out how to get it actually 'right'.  I tried simply putting in PNP resistors, flipping C/E, and flipping the 1/0 logic on my outputs to the base.  Thought that would do it, but no.  Darkness.  Next up...  Trying to understand all the Vbe Hfe gobbledygook.
Logged


Norman, OK, USA!
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Klingon Machinist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bug, thank you. I'm still new to the Arduino and this sort of stuff really helps keep my interest up.

I visited your blog and really liked what I saw. The first thing I noticed was the purple PCBs. I know where they come from! (Even before I found the link to Dorkbot in one of your posts!)

I'm looking forward to building one of these. I have a pile of like 8 or 9 column anode 5x7 displays I want to tinker with. thus far most of the similar posts use the (admittedly nice) MAX7219/22 which is Common Cathode.

Thank you.
Logged

M.S.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26570
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

MS,
You should get yourself a MAX6953, drives 4 common cathode displays.
You could wire up inverters basically to drive current out when the cathode control lines went low, and pull the cathodes low when the anode control lines went high.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Norman, OK, USA!
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Klingon Machinist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know about the OP, but, I have a handful of column anode 5x7 displays. I'd like to play with them. Also, the schematic and BOM provided by the OP is a pretty low cost deal. The IC used is $1.58 Q1 from Mouser. The MAX6953 is $13 in Q250 from Mouser.

Other than cost I suppose the point I am trying to make is while there may be 'easy' ways to implement a project, perhaps part of the fun is making what you have work? And learning something along the way too.

I'm very grateful that the OP has started this thread. Thank you Bug.

Logged

M.S.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26570
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I see your point, I cannot locate them in qty 1 anyplace.
Got an e-mail from AVNET.com,  claim to be local distributor for maxim. Browsed their website, NO STOCK of any of the 52 part numbers listed for display drivers.
So I guess 2 shift registers per part is the way to go.

If it was obtainable, it controls four 5x7 displays.  vs (MPC21018 + 5 NPN transistors + 5 base resistors + 5 current limit resistors) x 4, plus larger board to put it all on, plus debug time for wiring errors, plus increased coding time, vs $13 and some I2C commands, possibly using a library.

I have 2 that I was able to obtain as samples from Maxim.

Here's what I would do: get a part like 74AC299 from Newark (I just bought 20 in DIPs for 56 cents each) to drive the anodes, and something with more current sink capability like a ULN2003 on arduino outputs to pull the cathodes low. Then put a bunch of them in parallel, make a 25x7 display.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Norman, OK, USA!
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Klingon Machinist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I hope I did not come off as snarky....

If I were designing a commercial product and needed low part count, small board size etc, (ie minimizing costs) I'd be right there with you.  (Or if I were going from idea to parts order.)

I cannot speak for the OP here, however speaking for -me- hacking this stuff is a source of enjoyment in my otherwise crud world. Assembly, debug and code writing are part of the learning process. I have a lot to learn!

For fun, I have sat down with Eagle and drew up a schematic and board layout using the above and an ATMEGA328 in an MLF32 package etc.

Sometimes the road to a destination is not the shortest/fastest route.

Logged

M.S.

Pages: [1] 2   Go Up
Jump to: