Searching \ for '[EE]:How to matrix bicolor LEDs?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/displays.htm?key=leds
Search entire site for: 'How to matrix bicolor LEDs?'.

Exact match. Not showing close matches.
PICList Thread
'[EE]:How to matrix bicolor LEDs?'
2000\12\14@130242 by Brian Aase

flavicon
face
Here's an interesting (and somewhat PIC-based) situation;
A customer has a requirement for a product that would have
an array of bicolor LEDs, the kind with two leads. Since the
necessary states of each LED include Off as well as red
and green, the obvious but messy way to drive them involves
connecting each LED lead to an output port. I.E. each LED
uses up two outputs.  This works great for just a few LEDs
but uses up port pins really fast!  We're talking some 50 or so
LEDs here.  :-(

One variation I thought of would be to connect one side of
each LED to a source of V+/2 and then tristate the output
to get the Off condition.  Better, but it still uses too many
i/o pins.  The code needed to do mutliplexing for power
reduction is a little scary too, but that can be dealt with.

Can anyone suggest a way to further reduce the i/o pin count
by some sort of clever matrix connection?  My poor tired brain
is just drawing a blank on this.

Brian Aase

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\14@131531 by Spehro Pefhany

picon face
At 10:02 AM 12/14/00 -0800, you wrote:

>Can anyone suggest a way to further reduce the i/o pin count
>by some sort of clever matrix connection?  My poor tired brain
>is just drawing a blank on this.

Just connect them in an m x n matrix, resistors in series with
each of the n leads. Usually you'd want m~=n , but m>=n, but
perhaps modify this considering the differing sink vs. source
current capability on a PIC.

Let's say you have an "R" bitmap:

Make one of m high, rest tristate
Make each of the n low that you want on, the rest tristate
(repeat for each of m)

now, switch to the other "G" bitmap:

Make one of m low, rest tristate
Make each of the n low that you want on, the rest tristate
(repeat for each of m)

Total # of scan periods are 2 * m.

Tres simple, non?

Best regards,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\14@134159 by Vogel, Alan

flavicon
face
Brian,

If your supply for the PIC can be around 3V (less than the forward voltage
drop of two LEDs in series) then you can drive a bicolor LED from every pair
of port pins.  In this way, three I/O pins can drive three LEDs.  Four I/O
pins can drive 6 LEDs, etc.

I/O---------------------
             |          |
           LED      |
             |          |
I/O----------        LED
             |          |
           LED      |
             |          |
I/O---------------------


Of course, you'll have to add the current limiting resistors in the above
drawing.

Alan

> {Original Message removed}

2000\12\14@142955 by M. Adam Davis

flavicon
face
You can do a simple LED matrix, where you dedicate x pins for y leds
according to the equation y = x(x-1).  So 50 regular LEDs could be done
with 8 lines (56 leds), but each LED in this matrix has an inverse
parallel counterpart, so you'd be able to do up to 28 bi-color LEDs with 8
pins.  The only issue with this method is that you can only have one LED
on at a time, so it gets unweildy to multiplex brightly after long.

You need 50 bi-color LEDs, which will take 11 lines.  Put a resister on
each line that is half what you'd use to limit the current.  Now the
current has to flow through two of these resisters and the LED, so you
have proper current limiting no matter what led is lit.

Now take one pin (We'll call it pin 11), and hook it to every other pin
(the remaining ten) with an LED.  If you now test it, you should be able
to make pin 11 low, another pin high, and tristate the others and you'll
get one led lit of one color.  You can light all the others in a similar
fashion, and you can reverse the current to get the other color.

So far we have 10 bi-color LEDs, and 11 resisters.

Take pin 10, and hook it to every remaining pin (9 are left) with an LED.
Take pin 9, and hook it to every remaining pin (8 are left) with an LED.
...
...
...
Take pin 3, and hook it to every remaining pin (2 are left) with an LED.
Take pin 2, and hook it to pin 1 with an LED.

You now should have 55 leds hooked up.  You can skip the last 5 if you
want so you have exactly 50.

Now you can select any single LED and color by tristating all the lines,
bringing one high and another low.  You'll notice that some of the other
leds (depending on the resisters you picked) do glow dimly.  This can't be
helped without dimming the leds more, or using external circuitry.  The
difference between the bright and dim ones will be great, and when you are
multiplexing them quickly the dim glow will come from all of the leds that
are off pretty evenly, so it won't be a bad look.

If it is really bad, then you can drive them at 1.75 times their voltage
drop (ie, if one led drops 1.2v then drive them at 2.1v) through
transisters.  This will eliminate the glow, as it is caused by the main
current going through a string of leds as well as the intended led.

Ascii Art follows (fixed width font needed):
5 pins provides for 20 LEDs, or 10 bicolor.  The Z was the closest I could
find to match to inverse parallel arrows (ie, one bicolor led) below:

1       2       3       4       5
|       |       |       |       |
/       /       /       /       /
\       \       \       \       \
/       /       /       /       /
\       \       \       \       \
|       |       |       |       |
+--|Z|--+--|Z|--+--|Z|--+--|Z|--+
+------|Z|------+------|Z|------+
+----------|Z|----------+       |
+--------------|Z|--------------+
       +------|Z|------+       |
       +----------|Z|----------+

Note that if 1 is high, and 5 is low then the LED in the 3rd row is
getting
(5-vd)/(res*2) = current through LED.
(vd is voltage drop, res is resister value)
The four leds in the top row are getting
(5-(vd *4)) / (res*2) = current.
If your vd is larger than 1.2v then they won't light at all.  But the led
in the third row will complete the circuit with an led in the first row.
Those in the second row will light each other, and could combine with
those in the first row, the last two rows may also combine with one or
more in the first row to complete the circuit.

Given the addition of the voltage drop they will likely be very dim or not
on at all, but they will still be conducting current if the drop isn't
greater than 5v.  If you run your uC at 3V or less, you'll have less of a
chance of that happening.

-Adam

Brian Aase wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\14@154114 by Thomas C. Sefranek

face picon face
Brian Aase wrote:

> Here's an interesting (and somewhat PIC-based) situation;
> A customer has a requirement for a product that would have
> an array of bicolor LEDs, the kind with two leads. Since the
> necessary states of each LED include Off as well as red
> and green, the obvious but messy way to drive them involves
> connecting each LED lead to an output port. I.E. each LED
> uses up two outputs.  This works great for just a few LEDs
> but uses up port pins really fast!  We're talking some 50 or so
> LEDs here.  :-(
>
> One variation I thought of would be to connect one side of
> each LED to a source of V+/2 and then tristate the output
> to get the Off condition.  Better, but it still uses too many
> i/o pins.  The code needed to do mutliplexing for power
> reduction is a little scary too, but that can be dealt with.
>
> Can anyone suggest a way to further reduce the i/o pin count
> by some sort of clever matrix connection?  My poor tired brain
> is just drawing a blank on this.

Ultimately, the pin count is the count of the LED pins...
But, You can set up a series of latches to accomplish driving an array of
LEDs.
Row = 1, Column =1 LED is OFF, Row = 0, Column =0 LED is OFF
Row = 1, Column =0 LED is RED, Row = 0, Column =1 LED is GREEN
and you can have Row(n) by Column (m) of LEDs.
So the I/O pins required are the number of bits in the Row and columns
latches (8!),
and the address bits for the latch(es).

>
>
> Brian Aase
>
> --
> http://www.piclist.com hint: The list server can filter out subtopics
> (like ads or off topics) for you. See http://www.piclist.com/#topics

--
 *
 |  __O    Thomas C. Sefranek  .....tcsKILLspamspam@spam@cmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\14@160941 by uter van ooijen & floortje hanneman

picon face
> One variation I thought of would be to connect one side of
> each LED to a source of V+/2 and then tristate the output
> to get the Off condition.  Better, but it still uses too many
> i/o pins.  The code needed to do mutliplexing for power
> reduction is a little scary too, but that can be dealt with.

This is a low-frequency FAQ. Take N I/O lines. Make a mental matrix of these
lines, each line is used both as column and as row. Now put a LED on each
intersection (except of course the intersection of an I/O line with itself).
There will be N*(N-1) LEDs. To light up a particular LED make all pins
input, except the ones that connect to the anode and cathode of the LED. Of
course you would light up all LEDs of a row (or column) at the same time to
save time. I used this with a 16F84 to make a 3*3 LED matrix (for a dice).
At 5 V no resistors were needed. A limit the the total current that can be
handled by a PIC I/O pin, but you can use an emitter follower transistor as
boost. Your 2-leg bi-color LEDs count as two LEDs, so you should only use
the lower (or higher) triangle of intersections. Writing the mutiplexing
code for such a matrix is tedious but not very difficult.

success,
Wouter

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\15@051937 by Nebelong Bjarne

flavicon
face
Brian,

With a couple of A6276 from Allegro you can do a lot of LED's with just 3
outputs. Each handles 16 LED's
http://www.allegromicro.com/

Very easy to set up (the LED's + just ONE resistor) and easy to control from
a PIC micro. Just shift and clock.

/Bjarne Nebelong

{Original Message removed}

2000\12\15@062207 by Andy Faulkner

picon face
Just had a thought.

There's a product called "Thought stream" developed in
the USA that uses bi coloured leds driven from some
kind if 4MHz PIC for some reason I cannot understand
the product will produce 8 colours by somehow driving
each side if the LED at different frequencies. I
looked at these with my scope but still cannot work it
out.




--- Nebelong Bjarne <bjarne.nebelongspamKILLspamBINDOMATIC.SE>
wrote:
{Quote hidden}

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...