View Full Version : Discussion computer controlling 100-110 swtiches
vener
Dec 11, 2006, 12:03 PM
any options how to do it?
Malc C
Dec 11, 2006, 12:56 PM
Do what.. you want to turn on and off 100 off switches or are you referring to the voltage.. some details on the project would allow other posters provide you with better answers ;)
MatC
Dec 11, 2006, 01:33 PM
Assuming you mean 100 relays, and you want to interface to serial or parallel port of a PC, for low speed control (less than 1KHz) without realtime accuracy (eg 10ms is ok).
With a ucontroller: Output the data to serial or parallel port, read it out with a PIC or other microcontroller. Use the microcontroller to address an array of latches [8bits to latch inputs, 4 bits to select which to latch to clock). Output the latches to transistors. Transistors to relays. Job done.
Without a microcontroller: Output from the parallel port. Use a sequence of shift registers to generate your 100-110 signals. Then use latches to maintain this data, clocked from 3rd parallel port pin. You'll need about 14 shift registers (eg 74hc164) and 14 latches (eg 74hc373/4) to get 112 signals.
arx_n_sparx
Dec 11, 2006, 09:45 PM
PLC - programmable logic controller
vener
Dec 11, 2006, 09:53 PM
I would like to avoid the use of a microcontroller.
I am controlling about 100 leds in a 20X5 grid.
Miami Mike
Dec 11, 2006, 11:04 PM
Here's something interesting:
http://www.epanorama.net/circuits/parallel_output.html
According to that page, a printer port has eight regular data outputs and four control outputs that you can control with various types of software available from that site. There are probably many more sites like it on the web.
To use those outputs to control over 100 LEDs, you can build a 16 X 8 matrix and control it by sequentially writing three 8-bit words to three latches on a homemade circuit board, selecting the individual latches using two of the control outputs. The principle would be the same as the circuit used to control light bulbs in a pinball machine. It shouldn't be too hard to design and build it.
z-matrix
Dec 12, 2006, 12:52 AM
I would like to avoid the use of a microcontroller.
I am controlling about 100 leds in a 20X5 grid.
hey dude :)
for that application you need only 20 + 5 ports,
connect them in matrix :)
you can address the leds then as x,y addresses
you can control for example y lines directly with latches, and buffer the x lines using transistors, so in this case, you need to scan the matrix horizonbtally (buffered lines), and set the leds vertical leds active.
you need to scan through with a repitition frequency of more than 25Hz to be cool,this means a stepping frequency of 20x25Hz = 500Hz
you might need to use more parallel shift registers to increase bandwidth, parallel port is not so fast in software.
simply use the other databits too, shift registers need 1 clock, this can be (should be) common.
( parallel port has 12 outputs, 8 databits, strobe, and controls )
so,
you may use 5 ports of your parallel port for y output,
and use shift registers +transistors for x.
Acetronics
Dec 12, 2006, 03:38 AM
Hi, vener
In the best case, without added circuits ( but some diodes ! ) ... 110 switches need 11 port lines.
... thinking to it ... how many keys has your keyboard ???
- may be you could consider customizing one !!! ... really not expensive ...
Alain
PS ... sorry, I had understood INPUT switches ... :o
vintage1
Dec 12, 2006, 04:12 AM
I would like to avoid the use of a microcontroller.
I am controlling about 100 leds in a 20X5 grid.
Haha. My first real programming job was a PC controlling a 64x32bank of 60W lightbulbs..it was a blast to actually stand in front of it and feel the heat coming off my software!
That particular device was of course a custom job..we used a high speed serial line to send a frame of data in about 1/6th second.
At some level you will need some kind of latching decoder, in order not to have 100 wires coming out of the PC..
I'd say the easiest place to attach it all would be the parallel port.. you've got 8 bits and a few control wires you can use..you need an 8->256 type decoder, and 256 latches..a lot of hardware..
Another approach is to pulse drive the LEDs in the matrix..that takes you down to 25 wires or so..
AndyKunz
Dec 12, 2006, 09:42 AM
I have a similar situation in a product we are about to ship.
I used a Lattice MACHXO (actually, 2 of them because I needed both in and out) and a little code to provide a SPI bus to talk to the pins.
This gave me 128 independent logic-level controls and a 20MHz SPI bus to talk to them. Blazingly fast, simple to work out.
Andy
MatC
Dec 13, 2006, 10:27 AM
LEDs? You said switches :)
Makes a big difference because now you don't have to worry about glitches or latches.
If the output capacity of 74HC logic is sufficient (about 20mA per pin), and you want to use the parallel port (by far the easiest if you want to avoid microcontrollers), this would work:
2 parallel port outputs into a chain of 3 * 74HC164 (clock and data). They daisychain easily - just common the clocks and put the last output of each into the data of the next.
5 parallel port outputs are buffered and go straight to the LED's. You only need 5 transistors to do this.
Then you output a 1 to the shift registers and clock it along with 0's, while outputting data to the other 5 bits.
I suspect this won't allow you much brightness however, and you'll have to buffer the 74 logic (25mA, but only a 5% duty cycle because of your 20*5 matrix). You should be aiming for something like 500mA at 5% to get full brightness : which leads to big problems if windows pauses your output sequence (hence a microcontroller is a much better idea).
If you can avoid the matrix, and use individual control for each LED (ie 14*74HC164), you'll be immune to such problems. Make sure you scan out the new data quickly and noone will notice the new data "sliding" into position. You can even arrange 7 pairs of '164s and use 8 outputs (1 clock, 7 data into the shift registers) to get quicker response.
xorcise
Dec 16, 2006, 10:20 PM
If you can avoid the matrix, and use individual control for each LED (ie 14*74HC164), you'll be immune to such problems. Make sure you scan out the new data quickly and noone will notice the new data "sliding" into position. You can even arrange 7 pairs of '164s and use 8 outputs (1 clock, 7 data into the shift registers) to get quicker response.
This is where the 74HC595 is nice. You can clock in the data (and can be cascaded in the same manner) behind the output, and then send the clocked data to the output with a single pulse when ready.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.