Controlling a linear array of LEDs and switches?

Newbie question: I want to control a linear array of about 100 LEDs with a PC. I want the PC to light up a particular LED (working from data in Excel) and then be switched off again, either from the PC or by an operator hitting a touch-switch or button next to the LED.

The LEDs / switches will be mounted on the edge of a bench to facilitate ordered assembly of coloured tiles.

I was thinking some sort of "Christmas-light" controller might do the job - or do I need a programmable logic controller? I'm reasonably fluent in software - mostly VBA - and a quick study, but right now I'm just starting in on control-related stuff, and very much a newbie. Any suggestions, links, resources welcome.


Reply to
Stuart Dawson
Loading thread data ...

This would be a good question for sci.electronics.basic. This newsgroup is for people involved in motion and process control, where you want to get performance out of the plant while keeping it stable.

That having been said, you could drive an 8-bit number out of your parallel port into a chain of decoders -- you should be able to do this with 8 74HC138's, and the 'HC line will drive an LED directly.

Post on s.e.basic and you'll get more detail, though.

Reply to
Tim Wescott

Suggest you use a printer port as Tim Wescott says. 100 LEDs (one on at a time) can be driven with 3 74HC595s using only 3 unidirectional port lines. Total cost will be a few dollars (pounds) plus your time to wire it all up (mostly the LEDs). You'll also need 8 resistors, and a few 0.1uF bypass capacitors.

formatting link
The electronics newsgroups would be of more help on this, as Tim says.

The strategy is to bit-bang serial data (clock + data) in 24 bit groups out to the 3 shift-registers, then clock the data into the latches. You'd make (say) 1 of 16 high and 1 of 8 low to select a single LED (the LEDs connected in a 16 x 8 matrix with 28 positions empty). Pretty much trivial stuff if you can wire stuff up at the component level.

Best regards, Spehro Pefhany

Reply to
Spehro Pefhany

Look at using a lab jack or similar USB I/O device

formatting link
to at least get your push button inputs from a 10 row X 10 column cross contact 100 switch matrix. Each of

10 outputs are sequentially ON in a repeating scan (say they are the columns). The 10 rows are tied to 10 inputs and you can now determine which switch(s) are ON in a column when that column is being scanned.

I would use a C, C++ or VB program to do the above and store results in a bit array, It could also be done in a nano or micro PLC w/ no labjack, if you stick with the 100 LED output array. Here you would use a 10 X 10 cross point output scan at =>30 Hz to pulse ON desired LED's. 10 say columns are sequentially ON in a repeating scan and apply + power and 10 rows are pulldown outputs to the resistor-diode cathode side you want to turn ON when that column is being scanned.

You may also want to consider using the PC screen or a PLC operator panel for your display, instead of the LED's. In any case you would have both a

100 input and 100 output BIT array in memory that the PC or PLC program would work through. INPUT and OUTPUT scanning would be separate program subs that also work through the appropriate 100 bit array.

This is called multiplexing.

Reply to

The most cost-effective way of controlling a large array of LEDs is with a long shift register made up of cascaded 8-bit chips. You can get them with parallel load capability so that the transient values during shifting do not affect the parallel output. If the LEDs take only 10 ma, then you can drive them directly from CMOS logic. The interface with the PC is just three lines: data, shift clock, and parallel load. Each update of the LED array is comprised of shifting the entire 100 bits in and then pulsing the parallel load line. If you can't find shift registers with parallel load capability, then ordinary shift registers will do provided that the time to shift in an updated array of LED values is so short that there is not time enough to cause any visual impression, compared to the resting time between updates.

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott

In article , Tim Wescott writes

Thanks for your reply, Tim (and to all you other guys who've posted useful advice in response). I've reposted in s.e.b. as you suggested.

It's all a bit gulp-inducing for a simple dig-a-hole-and-fill-it-up- again civil engineer like myself, though. I'm going to have to do a lot of head-scratching and chin-pulling, I can see.

Reply to
Stuart Dawson

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.