View Full Version : Multiple switches and lights

01-09-2006, 03:20 AM
If I want to handle multiple buttons, and use button pushes from these multiple buttons to control multiple lights ( > 100 of both)

How would I go about doing this with a Stamp or other microprocessor?

I'm comfortable with the Stamp programming concepts, but presumably need some kind of co-processor to handle so many connections.

Also perhaps interrupt capabilities are required to allow 100 switches to be monitored simultaneously. I don't know if this is supported on any Stamp platform.

If anyone has a pointer to an existing project, or can suggest the hardware i need to consider, this would be very helpful.

Lee Harker
01-09-2006, 07:13 AM
There are a couple of practical ways you can do this. One method would be to daisy chain shift registers for your input switches so that you could read the values at 100 different inputs. Likewise use shift registers to drive your LEDs. The Parallax documentation shows examples of this. Another way to read many switches is by placing them in a matrix of 10 rows by 10 columns and scan them as you would any smaller keypad. Once again you would want to use shift registers to reduce the Stamp pin count necessary. You could also drive the LEDs in a matrix fashion.
One thing to keep in mind is that when you read switches or drive LEDs in a matrix configuration, only one switch can be read and only one LED can be lit at a time. There is also the issue of speed. It takes a finite perriod of time to read a matrix of keys. If the timing wasn't too critical it should be doable.

Clock Loop
01-09-2006, 11:55 AM
I did a similar project with many switches and leds. The best way IS with shiftregisters.

Use 74HC595's to light up your LEDS.....

And use 74hc597's (or74HC165's) to read the switch states.