Go Down

Topic: Driving a shift register over a medium length wire (Read 782 times) previous topic - next topic

kmwkmw

I would like to control a bank of six relays with my Arduino Uno.  The relays are less than 5 meters from the microcontroller, so I'm hoping I can connect things with some medium length (less than 5 meters) wires.  In order to preserve output pins on the Arduino and (slightly) reduce the number of longish wires, I'm considering locating a shift register next to the relays and driving the shift register from moderately far away.

I know how to calculate the voltage drop and if I'm not mistaken it will be negligible.

What I don't know is what effect (if any) the the distributed inductance/capacitance of the wires will have.  I suppose this depends on the frequency of the digital signals sent to the shift register.  The sample Arduino code for shift registers that I've seen sets the pins high and low without any intervening delay()'s.  For 5 meter, unshielded wires (telephone cable, say), will I need to slow down communication with the shift register in order to compensate for slow transitions between 0 and 5 volts on the wires?

tack

Have a look at the ShiftPWM library as there are some instructions there for how to add push-pull line driver to ensure you can drive long signal wires to shift registers adequately.

It might help you.

kmwkmw

Thanks for the suggestion.  I downloaded to source code for ShiftPWM (from http://www.elcojacobs.com/shiftpwm/ ), but I couldn't locate the discussion of push-pull line drivers.  Am I looking in the wrong place?

LarryD

Quote
six relays

You can use a ULN2003 or ULN2803
The way you have it in your schematic isn't the same as how you have it wired up!

tack

http://www.elcojacobs.com/using-shiftpwm-to-control-rgb-leds-with-arduino/

Alongside the schematics towards the bottom of the page.

fungus


I would like to control a bank of six relays with my Arduino Uno.  The relays are less than 5 meters from the microcontroller, so I'm hoping I can connect things with some medium length (less than 5 meters) wires.  In order to preserve output pins on the Arduino and (slightly) reduce the number of longish wires, I'm considering locating a shift register next to the relays and driving the shift register from moderately far away.


I don't think you'll have much trouble over 5m. At the very worst you'll have to drop the clock rate down from MHz to kHz.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

kmwkmw

Thank you, everyone, for the helpful answers.

LarryD: I'm using the relays to switch 24 volts AC (thermostat inputs to a radiant floor heat valve controller).  I assumed that for AC I needed to use mechanical relays rather than some sort of solid state alternative, but if I'm wrong about that please let me know -- I'll be pleasantly surprised.  I'm relatively new to this stuff.

SirNickity

Well, there are Triacs... which have the added advantage of possibly detecting zero-crossings and not switching the load at the AC waveform high points.  That doesn't change your control circuitry much, if any, though.

fungus


Thank you, everyone, for the helpful answers.

LarryD: I'm using the relays to switch 24 volts AC (thermostat inputs to a radiant floor heat valve controller).  I assumed that for AC I needed to use mechanical relays rather than some sort of solid state alternative, but if I'm wrong about that please let me know -- I'll be pleasantly surprised.  I'm relatively new to this stuff.



Solid state relays exist... google it.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

dhenry

Quote
What I don't know is what effect (if any) the the distributed inductance/capacitance of the wires will have.


I would estimate it to be 10uf/20pf-ish, 10-20ohm.

Shouldn't be a problem if you stay below 1Mhz clock speed.

If the wire is exposed to the elements, I would put a 110ohm resistor on the line and dial the speed back to 100khz.

Go Up