Controlling many LEDs with the BS2
Archiver
Posts: 46,084
Hello all,In the project I'm currently working on, I would like to be able to
control many LEDs with a single BS2, but I don't have enough free pins left on
my Stamp to be able to do this at one pin per LED. The actual number of LEDs I
need is not fixed; it would be lovely to be able to control 10 or 15, but the
more the better.The ideal soultion would be to get some sort of chip that my BS2
can talk to via a pin sending serial signals thereby only using only one of its
pins, though I am able to free up more then one pin if necessary. I need to be
able to turn any given LED on or off individually.I realize that I could
accomplish this with a second BS2, but this is overkill for such a simple job,
and it would be nice to be able to use something cheaper, too. Any ideas?Thank
you!Richard
control many LEDs with a single BS2, but I don't have enough free pins left on
my Stamp to be able to do this at one pin per LED. The actual number of LEDs I
need is not fixed; it would be lovely to be able to control 10 or 15, but the
more the better.The ideal soultion would be to get some sort of chip that my BS2
can talk to via a pin sending serial signals thereby only using only one of its
pins, though I am able to free up more then one pin if necessary. I need to be
able to turn any given LED on or off individually.I realize that I could
accomplish this with a second BS2, but this is overkill for such a simple job,
and it would be nice to be able to use something cheaper, too. Any ideas?Thank
you!Richard
Comments
The PAK-III allows up to 8 extra I/O while the PAK-IV allows up to 16. You
can "daisy chain" as many as you want together using the same serial output
from the host BS2.
Original Message
From: ellwood@b... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=1CVsMuPGV8RxtOkXNMvXjVVaYeEgpWDEbIqXeNeAxsT07xGaL_INR_8QAcmtl7TMbmvVXRwmg-qt]ellwood@b...[/url
Sent: Sunday, July 23, 2000 5:30 PM
To: basicstamps@egroups.com
Subject: [noparse][[/noparse]basicstamps] Controlling many LEDs with the BS2
Hello all,In the project I'm currently working on, I would like to be able
to control many LEDs with a single BS2, but I don't have enough free pins
left on my Stamp to be able to do this at one pin per LED. The actual
number of LEDs I need is not fixed; it would be lovely to be able to control
10 or 15, but the more the better.The ideal soultion would be to get some
sort of chip that my BS2 can talk to via a pin sending serial signals
thereby only using only one of its pins, though I am able to free up more
then one pin if necessary. I need to be able to turn any given LED on or
off individually.I realize that I could accomplish this with a second BS2,
but this is overkill for such a simple job, and it would be nice to be able
to use something cheaper, too. Any ideas?Thank you!Richard
like the 74HC595. This would give you control over eight LED's with three
stamp pins. There are also 16 and 32 bit shift registers (TI makes some),
though they aren't as common. An excellent dedicated LED driver chip is the
MAX7219 or 7221. This is a synchronous serial device, and can drive 64 LEDs
from three stamp pins. There is stamp code available for this chip, you can
find out more at:
http://www.maxim-ic.com
I've used this thing successfully and it really is an excellent device -
you can even control the *brightness* of the LED array in software! Maxim
has a very liberal sample policy, and they're about 10 bucks at Digikey...
Hope this helps, Duncan
you can control it with only 2 wires, and if you sacrifice
one output (of 8) you can chain another one or two to each's last
output for a total (with no VISIBLE artifacting) of 22(?) outputs
all on two wires. Easily expandable at only about $1.5 each.
You simply use the shiftout function.
Ask me more about it off the list and I'll happily supply schematics,
software, and instructions!
PLEASE don't pay too much.
Please E-mail the information to me - software and schematics.
Thanks
Jack
Original Message
From: Anubis <mikorians@y...>
To: <basicstamps@egroups.com>
Sent: Sunday, July 23, 2000 10:51 PM
Subject: [noparse][[/noparse]basicstamps] Re: Controlling many LEDs with the BS2
> I highly recommend the radio shack 74ls176 (?pn?) shift register
> you can control it with only 2 wires, and if you sacrifice
> one output (of 8) you can chain another one or two to each's last
> output for a total (with no VISIBLE artifacting) of 22(?) outputs
> all on two wires. Easily expandable at only about $1.5 each.
> You simply use the shiftout function.
> Ask me more about it off the list and I'll happily supply schematics,
> software, and instructions!
> PLEASE don't pay too much.
>
>
>
>
>
> Hello all,In the project I'm currently working on, I would like to
be able to control many LEDs with a single BS2, but I don't have
enough free pins left on my Stamp to be able to do this at one pin
per LED. The actual number of LEDs I need is not fixed; it would be
lovely to be able to control 10 or 15, but the more the better.The
ideal soultion would be to get some sort of chip that my BS2 can talk
to via a pin sending serial signals thereby only using only one of
its pins, though I am able to free up more then one pin if
necessary. I need to be able to turn any given LED on or off
individually.I realize that I could accomplish this with a second
BS2, but this is overkill for such a simple job, and it would be nice
to be able to use something cheaper, too. Any ideas?Thank you!Richard
Some of the CMOS serial to parallel gates that have been mentioned
will do the job if the current isn't too high, but if you need a
little more hefty power output, look at some of the Allegro driver
chips. One we use is the UCN5833A, which, although it requires 3
inputs (data, clock, and strobe), gives 32 outputs of fairly high
current capacity(100 ma+). Cost is about $6. They also make similar
chips with 8, 12, and I believe 16 outputs. We use these in our power
coprocessor boards, but if you don't need the coprocessor
functionality, the chip alone is pretty easy to interface to a Stamp.
Chuck Davis
Oak Tree Systems LLC
www.oaktreesystems.com
>Hello all,In the project I'm currently working on, I would like to be able
>to control many LEDs with a single BS2, but I don't have enough free pins
>left on my Stamp to be able to do this at one pin per LED.
You can control as many LEDs as you like using only 3 lines from your
controller. I use either 74HC595 or TPIC5B595 shift registers - each
drives 8 LEDs per package. The HC595 is CMOS has CMOS output stages - OK
for LEDs driven from 5V or less. I generally use the outputs in active LO
- the CMOS drivers have better drive and I have the option to use a lower
supply voltage if I am driving many LEDs.
The TPIC6B595 is ideal if driving loads from a higher supply voltage (up to
40Vdc or so) - the output stage of this part is a high current MOSFET that
is sink only. I use it when driving relays.
Be aware that the two parts I have mentioned are slightly different in that
the data is inverted in the 6B595 - a HI on the data input results in the
MOSFET turning ON which is a LO at the output. No problem once you know
about it.
The 3 control lines you need from your controller are clock, data,
strobe. Set the clock LO, set the data line to the state desired, wait a
short time, set the clock HI, wait a short time. Repeat the sequence for
each data bit required, then set the strobe line HI, wait a short time, set
the strobe line LO. You are done!
Note that the total number of clock - data sequences matches the total
number of bits in the shift registers. If you are driving 5 shift
registers, you need 40 clock - data sequences before you send the strobe pulse.
I mix and match both parts (HC595, 6B595) on my boards as required. If I
am driving lots of LEDs, I include a separate switch mode regulator and run
the LEDs from 3.3V or 4.0V - the LEDs are not harmed by reverse voltages
less than 3V. One of my cards drives 64 LEDs from 8 HC595s, another drives
40 LEDs and several +15V loads from a mixture of HC595s and 6B595s. Yet
another uses HC595s to drive a bunch of logic level control lines (MUX
control lines) as well as 6B595s to drive relays. All of these boards have
been in production for several years.
I hope this helps.
dwayne
Dwayne Reid <dwayner@p...>
Trinity Electronics Systems Ltd Edmonton, AB, CANADA
(780) 489-3199 voice (780) 487-6397 fax
Celebrating 16 years of Engineering Innovation (1984 - 2000)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.
Thanx
Seth