I have a little bit of Arduino experience, but the project I'm working on is a little more complicated. I'm interested in creating an array of 300 relays, so I believe I would need 300 outputs. I've read that I can connect multiple Arduinos or daisy chain shift registers, and program them to talk with each output? Does anyone know of any controllers that have 300 or more outputs to begin with?
For the shift registers, could I put 38 x 74HC595, in line and have the pins react as outputs 0-300?
A TPIC6B595 (ebay) shift register has build-in mosfets, and can switch eight relays directly.
Coding/wiring is the same as a 74HC595.
Post a link to the relays you are planning to use.
Leo..
What current do the relays need? I offer a couple of shift register boards that might do the trick to sink current thru relay coils.
One uses TPIC6B595 and can control 96 outputs at up to 150mA per output.
A second uses shift registers to drive N-channel MOSFETs at 1 or more Amps, depending on how many are driven at one time. It is set up as 4 channels of 8 outputs, with each channel supporting 8 to 10A.
The first one has arduino controller built in, only an FTDI Basic or equivalent needs to be plugged on to download code into it. The second one needs a separate Arduino to control it. Both are easy to control, just blast one to however many bytes are needed to fill the shift registers being used.
We've redone this one recently to use SMD transistors, resistors, caps, and LEDs. Very easy to daisychain the control signals with a 6-conductor ribbon cable.
You'll have to put your own diodes across the relay coils, to dissipate the coil generated current when you de-energize the coil. The TPIC6B595 datasheet says
"The device contains a built-in
voltage clamp on the outputs for inductive
transient protection. Power driver applications
include relays, solenoids, and other mediumcurrent
or high-voltage loads."
and it shows test results for a 200mH load, but how much are relays really?
I use this one on a board I offer, but I don't see a mH rating, so I use a diode across the coils, and have not had a problem.
Thank you so much for all the advice. I don't have the relays yet, but I'm thinking to use optocouplers because of their high speed. The outer circuits only need close contact switches, so low/no current is necessary, I'm now researching if there are any optocouplers that can close a low/no voltage circuit. Any ideas?
Thanks Wawa and CrossRoads for offering hardware options. The Mosfets and relays need a voltage in the end circuit though right? If I can add voltage to the end circuit to make it work I may be able to use these.
Tom, the final goal will be to switch them on in sequence from 1-300. Each relay will be on once, but not at the same time. I tried connecting multiple Arduino's together, by sending an output signal from one to another (with it's separate program) to start, but there was a slight delay in that transition, so I think working with one program is best.
birdhouse:
I'm thinking to use optocouplers because of their high speed.
I'm not sure what you mean by "high speed", but I would argue that optocouplers are generally slower than any a properly driven transistor (such as a mosfet). If you are comparing optocoupler's to relays then they are faster than a mechanical relay, but generally can't switch the same amount of current.
birdhouse:
The Mosfets and relays need a voltage in the end circuit though right? If I can add voltage to the end circuit to make it work I may be able to use these.
What "end circuit"? How would any circuit work without a voltage applied to it?
Relays are basically mechanical switches, operated electronically.
MOSFETs have a minimum gate voltage before they start conducting; I don't know what happens if the drain-source voltage is lower than the gate-source voltage.
Optocouplers have a minimum voltage drop over the phototransistor, typically about 0.7V. Any voltage lower than that on the switched side and you won't have any current, not matter how bright you make the LED side. See data sheet for details.
With assumptions only one relay need be on at one point in time and a directional diode was used on each. And given the tri-state ability of the output ports. In theory, it seems 18 pins would provide the ability to drive 306 small relays directly in a Charlieplexing like format. Assuming I did the math correctly where the sum of the sequence 2x(n-1) with n limits from 1 to 18 is 306. A simple small example using n=3 pins to drive ((2x0)+(2x1)+(2x2))= 6 relays would be...
This is a lot of relays! And a lot of un-answered questions. This method would probably need a directIO to port library like the one from mmarchetti to get any decent sequence speed. And with one on at a time the sequence speed would be limited by the mechanical close rate of the relays.