Shop OBEX P1 Docs P2 Docs Learn Events
Matrix of bi-color leds — Parallax Forums

Matrix of bi-color leds

RambomanRamboman Posts: 101
edited 2008-11-25 10:39 in Propeller 1
My intention is to build a large matrix of bi-color leds under control of the propeller.
Each led has to be set (or not) to red, green or yellow (alternating red and green).
For one led, it's pretty easy; I connect the led to P0 and P2 thru a 100 ohm resistance.
With (as output) P0 to 0V and P2 to 3.3V, it's red; with P0 to 3.3V and P2 to 0v, it's green.
Alternating red and green fast enough, it's yellow (or orange).
Let's take an example with a matrix 2x2 where P0 and P1 drive the rows and P2 and P3 the columns.
If I set P0 to 0V and P2 to 3.3V, the led at the intersection becomes red.
If I set P0 to 3.3V and P2 to 0V, the led becomes green.
My question is: "How do I have to set P1 and P3 to avoid the other leds to light up?"
Thanks
Roland
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-23 15:38
    Truthfully, you can't. You have discovered what is referred to as "sneak paths" through the matrix. Because the LEDs are bidirectional, current can flow through all kinds of alternate paths in such a way that some (undesired) LEDs will faintly light no matter what you do. The only way around this is to use 3 lead bi-color LEDs so that every LED has its own row and column. You will probably need a separate diode in series with each LED to prevent LED reverse leakage from providing "sneak paths".
  • RambomanRamboman Posts: 101
    edited 2008-11-23 16:02
    Thank's Mike for your feedback.
    Using 3 lead bi-color LEDs is a nice idea!
    Reducing the size of the matrix to fit the 28 available pins on the propeller.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-23 16:18
    Do remember that there are limits on the total amount of current drawn through the Propeller. Check the Propeller Datasheet for "Absolute Maximum" values.
  • RambomanRamboman Posts: 101
    edited 2008-11-23 17:19
    The basic idea is to multiplex the LEDs, one at a time, 20 mA each, I don't think that's a problem.
    Thanks for the remark.
    The basic idea was a cube 5x5x5, with 25 colums and 5 floors for a total of 30 pins.
    With bi-colors LEDs, I have to reduce the cube to 4x4x4, using 24 pins.
    Or to use add'l multiplexers from 4 to 16 ???
    Another (stupid) question based on my example:
    "What happens if P1 and P3 are defined as input (high impedance)?"
  • Andrew E MileskiAndrew E Mileski Posts: 77
    edited 2008-11-23 17:32
    You might want to look at the 64x32 boards from Sure Electronics:

    DP-033 (3mm LEDs)
    DP-030 (5mm LEDs)

    There are also a few threads on them in the forums:

    SNEAK PEAK at 64x32 LED Display Board project.
    SX controlled 6432 Dot Matrix Bi/Tri-Color LED Display
    PWM help with SPI type RGB LED Displays - Is it possible?

    If you are looking for do-it-yourself design, download their documentation (as poor as it is) so you can get an idea from their schematics. Basically they use a shift register IC, the 74HC595, which even Parallax sells on their webstore.

    There are also RGB boards on the market.

    Post Edited (Andrew E Mileski) : 11/23/2008 5:39:12 PM GMT
  • RambomanRamboman Posts: 101
    edited 2008-11-23 17:50
    Thanks Andrew, I will look at that!
  • BamseBamse Posts: 561
    edited 2008-11-25 05:03
    There is a driver for the Sure electronics 6432 boards in the Propeller Object Exchange...

    http://obex.parallax.com/objects/388/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Living on the planet Earth might be expensive but it includes a free trip around the sun every year...

    Experience level:
    [noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
    [noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
    [noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
    [noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
    [noparse][[/noparse] ] I dream in SX28 assembler...

    /Bamse
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-11-25 09:52
    LEDs are usually high brightness these days which means you probably will not have to drive it with so much current. I usually use a 1K or higher resistor. In fact, I use a 10K on my prop, and a superbright blue LED. Obviously, pulsing it will lower the brightness, so trial and error will prevail, but do try higher value resistors. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    We used to marvel at Maxwell Smart·having a phone in his shoe. Now we just say what a stupid place to put a phone!
  • RambomanRamboman Posts: 101
    edited 2008-11-25 10:39
    As suggested by Mike, I will use 3-wire LEDs in a 10*(4+4) configuration, driven directly from the propeller (18 pins).
Sign In or Register to comment.