SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Barx
#112002
Bought an led matrix (off the eBay). Is there a part of the code to tell me whether it's common anode or cathode. On the side it's got 1088DEG 33 M2. On the bottom seen through the resin is WLG B1088.

Thanks
By Blackfin
#112007
Barx wrote:Bought an led matrix (off the eBay). Is there a part of the code to tell me whether it's common anode or cathode. On the side it's got 1088DEG 33 M2. On the bottom seen through the resin is WLG B1088.

Thanks
Does it look anything like this:

http://www.chlazza.net/files/TOM-1088BMR-B.PDF

You could always simply use current limiting resistors and a low-voltage power supply and check the wiring by point-to-point connections if need be...
By Barx
#112010
Looks 'like' it but its not 'it'.

Here is the fella. Its bi colour, has 24 pins.

Using this page, I can assume the pinout is same as the 8 x 8 bicolour matrices but smaller scale unit (mine is <40mm). It's just a matter of common anode or common cathode. I have mailed the seller and will wait a few days for reply before I blow it up making mistakes. I did think about using a small voltage/current to see if an led light 1 way or other. Think I will hit it with the multimeter. Do LED's act like standard diodes. i.e. will the diode test feature determine this.
User avatar
By thebecwar
#112012
LEDs behave exactly like diodes. (They are just diodes after all) Just give it a low voltage (~5v) and limit the current with a reststor. (at 5v you'll want about 330 ohms to get a nice safe 20mA). The reverse breakdown voltage should be no less than 5v, but if you want to be really safe give it 3v. Not too many LEDs made that can't withstand ~3.3v reverse voltage.
By tecoist
#112014
The forward voltage will depend on the color (thank you, Professor Planck), but aside from that, yes, they're diodes.
By Barx
#112027
Sussed it out. Common anode. Not sure if thats good or bad, Sure I will soon find out. Would have thought it would have to be common cathode for use with arduino, But not got my head round it yet so could be talking babble.

Thanks for the info.
By Barx
#112039
Realised I cant drive the matrix direct and do 2 colour. I've had a look around and dropped on the 4051 8 channel multiplexer/demultiplexer. My thoughts are. 3 of these, 1 to select row, 1 for Column Red other for Column Green. So when doing code trickery it's a matter of selecting row and outputting it to Row mux. Then Select column position and output to Red mux if red required or Green mux if green required. I count the pins at:
3 for S0, S1 and S2 for addressing in mux,
3 for E(nable) on each mux (so I only set which 1 I need to)
1 for the Z, the actual data to set.

so 7 in total as apposed to the 24 originally requied (and not possible with arduino uno).

What do you guys things? will this work? would you choose another way?

Thanks as usual
By tecoist
#112051
Barx wrote:Would have thought it would have to be common cathode for use with arduino...
Arduino (i.e., the Atmel AVR microcontrollers) both source and sink current, so they can drive common anode or common cathode devices (though only 100mA worth of them or so).

SFE's own backpack controller, here, would be a reasonable place to start for an 8x8 2-color controller based on Arduino (or pretty much any microcontroller). Oooh, schematic! Plagiarism! Or if you prefer, Design Reuse.
By esklar81
#112270
Barx wrote:Realised I cant drive the matrix direct and do 2 colour. I've had a look around and dropped on the 4051 8 channel multiplexer/demultiplexer. My thoughts are. 3 of these, 1 to select row, 1 for Column Red other for Column Green.
Why not use a 1:16 mux for column selection, as you're selecting only one column at a time?
Barx wrote:So when doing code trickery it's a matter of selecting row and outputting it to Row mux. Then Select column position and output to Red mux if red required or Green mux if green required.
You appear to be assuming that you can write a selection to a mux and that it will latch to that selection while you move on to another mux. I don't think that latching function is provided by the part you selected.
Barx wrote:I count the pins at:
3 for S0, S1 and S2 for addressing in mux,
I believe you need this for each mux. (That's another reason that using a 1:16 for column selection would be helpful.)
Barx wrote: 3 for E(nable) on each mux (so I only set which 1 I need to)
I don't think the "enable" on the mux works that way. My interpretation of the truth table on page 2 of the datasheet is that the "inhibit" input controls whether any of the outputs is connected to the input. On the upside, you don't appear to need to control this pin actively in some configurations; you can tie it to ground.(There doesn't appear to be an "enable", but "inhibit" and "enable" are inverses of each other, so it's the same functionality with the logic reversed.)
Barx wrote: 1 for the Z, the actual data to set.
I'm not sure what "data" you're thinking of "set"ting. An LED matrix doesn't have a memory or a digital-to-analog converter (DAC). If you apply a suitable voltage in the right direction across an LED, it's on. If you don't, it's off.
Barx wrote:so 7 in total as apposed to the 24 originally required (and not possible with arduino uno).
My count, using this method, is:
3 digital output (DO) address lines for the row mux (The common input terminal of this mux is tied to Vcc or Gnd, depending on the orientation of the diodes in the matrix.)
6 DO address lines for the column muxes (only 4 if you use a 1:16 mux for column selection)
1 "analog" output (AO) for the intensity. ("Analog" output pins aren't really analog, they're PWM digital, but that should work in this case. It does, however, mean you don't need a mux that can handle analog.)
This totals 10 pins if you use 8:1 muxes, 8 pins if you use one 1:8 and one 1:16.
Barx wrote:What do you guys things? will this work? would you choose another way?
It appears to me that this will work, but very dimly. Using this approach, each LED is on only 1/(number of lit LEDs in the pattern) of the time. There are (8 rows X 2 columns X 2 colors) 128 LEDs in your matrix. If you use, say, one quarter of the LEDs for an image, each is on at most 1/32 of the time, so the apparent brightness is far below what the LED can produce. Also, to avoid visible flicker, you need to cycle through the entire array 16 or more times per second, for convenience lets say 64 ms per cycle. For images that use most of the LED, that means you have ~ 0.5 ms per LED in the cycle. That presents a problem in trying to use the Arduino's "analog" output function. According to the Arduino Reference entry on AO, the frequency of the PWM is approximately 490 Hz. That's plenty fast to avoid flicker (if you provide it constantly to an LED), but if you're providing it in random, 1 ms time slices, your apparent intensity will be all over the map.

To address this timing/intensity problem, I suggest you drive more than one LED at a time. To minimize parts count, how about: Use 8 DOs for the anodes (rows) and a 1:16 mux for the cathodes (columns), for a total of 12 DO pins. That should get you about 4 ms per column in each cycle. (Not great, I admit, but it's close to an order of magnitude better than the previous approach.) Within each column's time slice, you can power each LED in that column for the fraction of time that corresponds to the desired intensity by switching the DO for that LED's row on for the appropriate number of sub-cycles.

One problem that this does not address is the available current. The internal resistance of the mux, according to the datasheet, is "typically" 270 Ω. If the LEDs have a forward voltage of ~2 V, that leaves ~3 V to be dropped across the resistance, giving (~3 V / 270 Ω = ~ 10 mA). To make matters worse, that will be shared by however many diodes in the column are being lit.

If you used a shift register, instead of a mux, for column selection, you could reduce your pin count by 1, as 3 pins will control a shift register of (effectively) arbitrary length. For example, if you daisy-chain a couple of these, you'd reduce the resistance of the switch to < 10 Ω and, thereby, increase the current to be shared by the LEDs in the column to > 300 mA, which is well above the nominal 20 mA/LED.

If you'd care to bother to do the additional computing to take advantage of it, using shift registers allows you to select more than one column at a time. (The available current from the DO of 40 mA will limit you to two columns at a time, though.)

A relatively minor issue is that this approach would require putting resistors between the row DOs and the rows of the matrix, so the same resistors would be there for the different colors. You could, however, compensate for this by using different time fractions for the different colors to get the same average current. The available average current, even with the "wrong" resistor for one of the colors, would still be much higher than through the mux you chose.

If you needed to reduce the pin count further, you could use an external, 8-channel DAC instead of the 8 DO pins for the rows. That should save 5 pins, but I didn't find a suitable DAC in a quick search.
Barx wrote:Thanks as usual
You are, as usual, welcome.

Have Fun,
Eric
By Barx
#112287
Wow, thanks for that eric.

As per either you or tecoist foil my plans and blow my theory out the window. Back to the drawing board. I had 4051's in mind after watching this video.

After reading this and some similar pages, I assumed S0, S1 and S2 could share signals. And, by 'Data' I just meant a 1 or 0 to turn on or off the LED. It's my n00b terminology I'm afraid. I dont quite have the lingo yet :wink:

cheers