Problem connecting shiftregisters to UNO with a long cable

I have a display with 20 leds which I want to control with a UNO. The distance between UNO and display is about 5 meters. I don't want to have a 22 wire cable (20 leds, +5volt, ground) between the display and UNO. Instead I built at shift register with 3 circuits 74HC594 (8+8+4 bits) connected with short wires to the display. This reduced the need of cable wires to 5 (clock, latch, data, 5+, ground). The application is working ok, but only if the length of wires is short < 0.5meter. Using a 5 meter cable doesn't work. The display leds turn on/off random. The cable is an non-shielded "data cable". I have checked the level of the +5 volt to the shift registers is ok.

The straightforward solution is to move the shift registers near the UNO board, and connect a 22 wire cable to the display. But I also wonder if reducing the data stream speed could solve any timing problems due to the long cable? Would a shielded cable help?

Any suggestions?

What is the data rate you are using now?

Try a twisted pair cable for each signal (twisted to Gnd). If this doesn't work you need a line driver.

I don't know the data rate. The code is:

    digitalWrite(VLatchPin, LOW);
    shiftOut(VDataPin, VClockPin, MSBFIRST, (0xff0000 & data) >> 16);
    shiftOut(VDataPin, VClockPin, MSBFIRST, (0x00ff00 & data) >> 8);
    shiftOut(VDataPin, VClockPin, MSBFIRST, 0x0000ff & data);
    digitalWrite(VLatchPin, HIGH);

I assume the rate depends on the clock on the UNO board. It's a version 3 UNO board.

The shiftOut() function is pretty slow, it's a software function and doesn't use the Uno's SPI hardware. I doubt slowing it down further will help.

Ok, about the slow speed.

Maybe I shall try with a shielded network cable instead.

What's really needed is a 'scope to look at the signals going into the cable compared the the signals coming out. That would hopefully reveal what is needed to clean up the signals to the shift registers.

I have a scope. Maybe I shall try to see how it looks.

Try putting a 1K pullup resistor on each of the signal lines on the 595 end.

I shall try that. Simple to do.

Thanks for all suggestions! I come back and report how it's going.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.