Pages: [1]   Go Down
Author Topic: Driving a shift register over a medium length wire  (Read 605 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
 
Logged

Offline Offline
Edison Member
*
Karma: 64
Posts: 2489
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
six relays

You can use a ULN2003 or ULN2803


* 2803.jpg (82.58 KB, 999x432 - viewed 10 times.)
Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Alongside the schematics towards the bottom of the page.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5358
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 144
Posts: 5358
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: