# Digital signal 800kHz through long cable; reflections and how to compensate.

#### andrewmm

Joined Feb 25, 2011
1,754
Re calculating the impedance,
don't try ,

its going to have way to many variables
experiment is goinn to be your best option.

To be honest, that signal at the receiver does not look to bad.
I assume thats with the leds plugged in.
That shoudl work just fine..

#### mriksman

Joined Aug 31, 2010
86
Re calculating the impedance,
don't try ,

its going to have way to many variables
experiment is goinn to be your best option.

To be honest, that signal at the receiver does not look to bad.
I assume thats with the leds plugged in.
That shoudl work just fine..
I’m still getting a fair bit of corruption.

I’d like to measure the impedance so I can better determine what the sender (series resistor) and the receiver (parallel resistor) should be. I’ve also read a capacitor in series with that parallel resistor could help as well.

#### andrewmm

Joined Feb 25, 2011
1,754
What you are doing is adding an impedance, which works with the system impedance , and adding a filter .

At the sender end, assuming you have a series resistor at the transmitter,
if you put a capacitor across that resistor, it lets more high frequencies through , giving a faster rise / fall time.
if you put a capacitor from the output of the resistor at the transmitter to ground, you are attenuating the high frequencies, resulting in slower rise / fall times.

BUT ,

I understand you have led strips in series,
did you say the first strip works ok, the follow on strips have problems ?

#### mriksman

Joined Aug 31, 2010
86
What you are doing is adding an impedance, which works with the system impedance , and adding a filter .

At the sender end, assuming you have a series resistor at the transmitter,
if you put a capacitor across that resistor, it lets more high frequencies through , giving a faster rise / fall time.
if you put a capacitor from the output of the resistor at the transmitter to ground, you are attenuating the high frequencies, resulting in slower rise / fall times.

BUT ,

I understand you have led strips in series,
did you say the first strip works ok, the follow on strips have problems ?
The errors are random. Sometimes a single LED anywhere will flash. Sometimes a a few LEDs in a bunch will flash. Sometimes when I’m animating a white flicker (each LED dims in and out gently), all LEDs will briefly flash a different colour. It’s quite random.
If there is any corruption arriving at the first LED, then it’s best attempt to reconstruct the signal for the remaining LEDs will also include that corruption. Even when I turn it off, I’ll come back some time later, and note the first one or two pixels have turned on. Possibly picking up EMI and interpreting that as a signal.
I don’t think I can overcome EMI, as the cable is unshielded nor twisted pair. But I am hoping to ensure that the received signal is stable enough not to falsely hit trigger levels of the SK6812 controller thresholds and corrupt the incoming data.

#### Sensacell

Joined Jun 19, 2012
2,891
Even with a 'good' transmission line, a ground-referenced signal like this can get clobbered by ground loop currents, this could be your problem number two.

What currents flow in this ground? LED currents? Leakage currents from AC powered stuff at the other end? Different Ground potentials at either end?

If DC LED currents flow in this ground wire, it can have the effect of moving the threshold of the receiving chip upwards. Worse yet- the threshold moves with the current level.
(ground becomes higher on the receiver end due to voltage drop over cable)

Last edited:

#### andrewmm

Joined Feb 25, 2011
1,754
One option might be to put a better receiver chip transmitter chip.
will be a "bodge" , but it might be possible,

I'm wondering , say use RS422 ,
If its possible to put a different chip at the tx and the rx end,
let us know.

#### neonstrobe

Joined May 15, 2009
167
The capacitance can be estimated from the separation of the two wires. The inductance can be estimated from the length of the wire. There are some calculators on the web which may help, as the dielectric of the wire insulation will have an effect.
As a rough guide, twin cables will be in the region of 100-300 ohms (only approximately, could be more or less). A 3k resistor may attenuate the signal that reflections are not "seen" by the receiver. Your 330 ohm may not attenuate the signal enough, but this all depends on the sensitivity of the receiver. Likewise your 1M scope probe capacitance would have attenuated the reflections enough but 10Mhz reduces the capacitance to about 10pF and not provide attenuation.
The root cause is the reflections. If you can still access the two ends (first LED and transmitter?) and send a short regular pulse down the wire the reflection time will give you the characteristic impedance if you know the length of wire. Then the best way to reduce the reflections is to try to load the receiver (if you can do this) with the impedance. If you can still access the end of the long wire or a point nearby try loading it with a parallel 100-300 ohms (experiment a bit). From what you say it seems the receivers should work with a reduced signal and you just need to attenuate, or, as we are trying, to eliminate the reflections.

What are the input and output specs of the tx-rx? Often RF stuff works at 50 ohms. I'd anticipate having to use a 51 ohm terminator but your line may need to be matched to that to prevent new reflections but you may "get away" with some intermediate loading.

#### andrewmm

Joined Feb 25, 2011
1,754
The capacitance can be estimated from the separation of the two wires. The inductance can be estimated from the length of the wire. There are some calculators on the web which may help, as the dielectric of the wire insulation will have an effect.
As a rough guide, twin cables will be in the region of 100-300 ohms (only approximately, could be more or less). A 3k resistor may attenuate the signal that reflections are not "seen" by the receiver. Your 330 ohm may not attenuate the signal enough, but this all depends on the sensitivity of the receiver. Likewise your 1M scope probe capacitance would have attenuated the reflections enough but 10Mhz reduces the capacitance to about 10pF and not provide attenuation.
The root cause is the reflections. If you can still access the two ends (first LED and transmitter?) and send a short regular pulse down the wire the reflection time will give you the characteristic impedance if you know the length of wire. Then the best way to reduce the reflections is to try to load the receiver (if you can do this) with the impedance. If you can still access the end of the long wire or a point nearby try loading it with a parallel 100-300 ohms (experiment a bit). From what you say it seems the receivers should work with a reduced signal and you just need to attenuate, or, as we are trying, to eliminate the reflections.

What are the input and output specs of the tx-rx? Often RF stuff works at 50 ohms. I'd anticipate having to use a 51 ohm terminator but your line may need to be matched to that to prevent new reflections but you may "get away" with some intermediate loading.
From what I have seen, the wires are not twisted, or even "together" they are just buried in walls, and strung along other bits of wall.

I'd suggest that the characteristic impedance is going to be variable along the length, and all but un predictable.

From what I understand the IO is "LV TTL" at 3v3,

#### crutschow

Joined Mar 14, 2008
27,718
How would I determine appropriate series/parallel resistance values if I can’t determine the impedance of the cable?
Try various values of resistors across the cable output to ground (not in series) and select the one that gives the best waveform.

#### mriksman

Joined Aug 31, 2010
86
Try various values of resistors across the cable output to ground (not in series) and select the one that gives the best waveform.
@crutschow So - select the parallel receiving end resistor first.
Then do the series resistor sending end? Will it be the same value? Or very different?

#### crutschow

Joined Mar 14, 2008
27,718
Then do the series resistor sending end? Will it be the same value? Or very different?
With such a ratty line they could be the same or different.

#### Danko

Joined Nov 22, 2017
1,134
Last edited:

#### the.lbt

Joined Aug 22, 2021
2
@mriksman I'm having almost identical problems to you - I split a length of LEDs and join the end of one half to the start of the other half.

My question is about what resistors and configuration you used at the transmission and receiving ends? I know it will need experimentation but I'd like to know what order of magnitude to start with.

My setup is as follows:
I use a single strand of cable from the end of one directly connected strip back to the control board (2.2m) and then 3 cores of a 6-core cable to take power and the signal to the other strip (3m). That signal is the full 5v re-amplified from the last LED.

If I take the extended signal via a single core cable (even in a tight 10cm diameter coil)... it works. If I hold the single core coil tightly close to the 6-core wire or any other wire I get corruption. I think this is a capacitative effect and my problem is due to using multi-core cable. If I run the power through one multi-core cable and either use a single or twisted strand of cat5 I still get corruption.

I don't have a scope so all I can do is observe.

#### mriksman

Joined Aug 31, 2010
86
@mriksman I'm having almost identical problems to you - I split a length of LEDs and join the end of one half to the start of the other half.

My question is about what resistors and configuration you used at the transmission and receiving ends? I know it will need experimentation but I'd like to know what order of magnitude to start with.

My setup is as follows:
I use a single strand of cable from the end of one directly connected strip back to the control board (2.2m) and then 3 cores of a 6-core cable to take power and the signal to the other strip (3m). That signal is the full 5v re-amplified from the last LED.

If I take the extended signal via a single core cable (even in a tight 10cm diameter coil)... it works. If I hold the single core coil tightly close to the 6-core wire or any other wire I get corruption. I think this is a capacitative effect and my problem is due to using multi-core cable. If I run the power through one multi-core cable and either use a single or twisted strand of cat5 I still get corruption.

I don't have a scope so all I can do is observe.
Hey,

I ended up with 680ohm resistor in series with the data line just before Din on each strip. A scope will help tell you if you have too little (spikes/oscillations) or too much (you get a square-ish wave but it starts getting rounded edges).

I also have issues with running long, separate power cables to sections of strips. I run 4x cables, each powering 4x strips each. But between each ‘transition’ (Strip 4 of Power 1 to Strip 1 of Power 2 for example) I get a lot of issues. So if you do something like this, make sure you connect the GND of each LED strip; even if the power feed is separate. Keep those strips’ GND tied together.

#### the.lbt

Joined Aug 22, 2021
2
Hey,

I ended up with 680ohm resistor in series with the data line just before Din on each strip. A scope will help tell you if you have too little (spikes/oscillations) or too much (you get a square-ish wave but it starts getting rounded edges).
Thanks - I'll start there

I noticed the model of your scope and found a review on youtube - it looks like a good choice for "my first oscilloscope" so I think that's going on my shopping list.

I also have issues with running long, separate power cables to sections of strips. I run 4x cables, each powering 4x strips each. But between each ‘transition’ (Strip 4 of Power 1 to Strip 1 of Power 2 for example) I get a lot of issues. So if you do something like this, make sure you connect the GND of each LED strip; even if the power feed is separate. Keep those strips’ GND tied together.
Yes, I'm aware that I should use a single reference ground and I only use 1 PSU for my Pi and the LEDs but I'll bear that in mind for the future.

#### olphart

Joined Sep 22, 2012
88
SCSI ran chains up to 8 devices as TTL signals with last in chain terminated by 220 ohm to +5, 330 ohm to ground, and no series resistor.
This was at signal speeds WAY faster than .8 MHz, but also through ribbon cable.
Fancy terminators added a +5 zener and a Schottky to ground to kill over & undershooting.
Using one of those in testing them, I had a Macintosh running 1 hard drive at >75 feet!

#### Juhahoo

Joined Jun 3, 2019
175
is this for testing or for actual usable product? If it is a bit serious project, then use proper differential drivers for good results.

#### mriksman

Joined Aug 31, 2010
86
is this for testing or for actual usable product? If it is a bit serious project, then use proper differential drivers for good results.
Just a home project. Wires were put in place during construction, so can’t modify now.

#### Juhahoo

Joined Jun 3, 2019
175
Just a home project. Wires were put in place during construction, so can’t modify now.
CAN or RS485 needs only 2 wires.

#### Papabravo

Joined Feb 24, 2006
16,792
If you can characterize the impedance of your cable and properly terminate it that will help a great deal. You can also use TDR (Time Domain Reflectometry) to check the results.