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

Thread Starter

mriksman

Joined Aug 31, 2010
113
Hi,

I’m trying to control a SK6812 programmable LED strip however, my data line cable is quite long; around 5-10m (I can’t remember exactly). The signal is obviously distorted, as the colours are wrong, and the first pixel is different than the rest.

Looking at the oscilloscope it’s obvious there are signal reflections. Doing some tests with an oscilloscope and a long piece of the same cable showed having a 330 Ω resistor flattened the signal nicely. However, when I inserted it into the signal line, it didn’t help with the LED control at all.

What DOES help is having the 1X probe connected (disconnected from the scope), between the data line and GND. Everything works great. Setting it to 10X REALLY screws things up.

So what is my probe doing to ‘fix’ the signal? How can I replicate this? Can anyone explain more why my 330 Ω resistor didn’t work? Or provide any more information on what is happening and how to fix it?

Thanks.
 

Thread Starter

mriksman

Joined Aug 31, 2010
113
I read that using 1X probes can affect signal readings so switched to 10x. Found ~2.2kΩ and 3.3kΩ had the best effect on the testing cable. Tried it on my circuit - it works!
Seems crazy that the characteristic impedance of my cable is ~2.2kΩ.
 

Marley

Joined Apr 4, 2016
502
Best if the cable is correctly terminated at each end with its characteristic impedance. Depends on the type of cable but could be between 100 - 600 ohms for a twisted pair. But this will reduce the voltage level by 50% at least so might interfere with the logic levels.

Adding some resistance (as you have done) will help to reduce the "ringing" and reflections in the line. So if it works, stick with it!

The proper way to do this is using a balanced line, correctly terminated, with line drivers and receivers that can cope with the loss of signal amplitude. As done in Ethernet, HDMI, DMX, RS485, etc.
 

crutschow

Joined Mar 14, 2008
34,280
As Marley stated, the cable should be terminated in it's character impedance.
Termination at both ends is the best (series at the transmitting end and parallel at the receiving end) but termination at the receiving end only should be sufficient.

What type of cable you are using?.
Cat5 ethernet cable would be good as it consists of twisted wire pairs with a controlled impedance of 100Ω.
 

Deleted member 115935

Joined Dec 31, 1969
0
The fact adding the 10:1 probe to the circuit says a lot,

Great you have a scope, can you post picture of the waveform at the sending and receiving ends ?

Your going to have a few things to look at.

a) Edge speed,
b) under / over shoot
c) voltage levels
d) High / low times,

All thee need to be right / within limit for the circuit to work reliably.
 

Thread Starter

mriksman

Joined Aug 31, 2010
113
It’s just crappy electrical wire. It's not twisted pair or anything.
63133243248__10D2139F-3DD7-48E1-9131-EC7183F8DFCD.jpeg

Using 1X probes I get the following
IMG_5521.JPEG
No series resistor

IMG_5522.JPEG
100ohm resistor

IMG_5524.JPEG
330 ohm resistor

As I said before, this didn't work when connected to my real circuit. I did some research and saw someone say that 1X probe settings can cause issue with signal measurements; because of the ~100pF capacitance (??) (which has a reactance..??)

So I tried it with the 10X probe
IMG_5537.JPEG
No resistor

IMG_5538.JPEG
1k resistor

IMG_5540.JPEG
3.3k resistor

I've settle on the 3.3k resistor and it's working 99% of the time (I am seeing occasional errors on the first LED, but it doesn't affect the rest of the LEDs).


@crutschow I have added the series resistor at the 'receiving' end - so just as it enters the LED after the long cable length. This seems to work. Any details as to why it should or shouldn't be parallel (to ground?)? Or why it is working in series at the 'receiving' end?
1609907244685.png


How would you determine a cable's characteristic impedance? I read I could measure the open circuit capacitance, and the shorted inductance and then Z = SQRT(L/C). But I don't have an LCR meter.

Does 2-3k characteristic impedance for a cable like this seem right?

I still haven't fully grasped the theory behind this. As far as I can tell, I have a low impedance controller, and a high impedance input LED. So how does adding a resistor in series help? Isn't high impedance already... a 'high resistor'...?
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,766
hi mr,
That wire , bundled up in that way is totally unsuitable for data transmission.
At least get two,12 mtr wires and twist them together, about 3 to 5 twists per inch.
Clamp one end of the pair in a vice and a slow hand drill at the other end of the pair and twist slowly.

Or use some old TV coaxial cable.

E
 

Deleted member 115935

Joined Dec 31, 1969
0
It’s just crappy electrical wire. It's not twisted pair or anything.
View attachment 226887

Using 1X probes I get the following
View attachment 226888
No series resistor

View attachment 226889
100ohm resistor

View attachment 226890
330 ohm resistor

As I said before, this didn't work when connected to my real circuit. I did some research and saw someone say that 1X probe settings can cause issue with signal measurements; because of the ~100pF capacitance (??) (which has a reactance..??)

So I tried it with the 10X probe
View attachment 226891
No resistor

View attachment 226892
1k resistor

View attachment 226893
3.3k resistor

I've settle on the 3.3k resistor and it's working 99% of the time (I am seeing occasional errors on the first LED, but it doesn't affect the rest of the LEDs).


@crutschow I have added the series resistor at the 'receiving' end - so just as it enters the LED after the long cable length. This seems to work. Any details as to why it should or shouldn't be parallel (to ground?)? Or why it is working in series at the 'receiving' end?
View attachment 226894


How would you determine a cable's characteristic impedance? I read I could measure the open circuit capacitance, and the shorted inductance and then Z = SQRT(L/C). But I don't have an LCR meter.

Does 2-3k characteristic impedance for a cable like this seem right?

I still haven't fully grasped the theory behind this. As far as I can tell, I have a low impedance controller, and a high impedance input LED. So how does adding a resistor in series help? Isn't high impedance already... a 'high resistor'...?

Hi @mriksman

Impressive debugging you have done there.


Re scopes:
as you have seen , the times 1 input of a scope probe is relatively low resistance / high capacitance.
most measurements are done on 10:1 ,
in 10:1 , the scope probe has an attenuator and compensation to compensate for the probe and cable.
That means the scope resistance seen by the circuit is typical in the M ohm, and "pure" resistive.

( Most scope probes have a compensation screw on the handle, that allows the capacitance to be tuned out, this is why most scopes have a reference output on them , to connect the scope probe to be calibrated )

I am amazed the signal looks so good overt that length of wire.

Are you measuring with the load connected or floating wires.
Your picture implies you are measuring floating wires, no load connected.

You need to measure with the load connected.
The load will have a significant impact upon the received signal.

technically, without the load, your measuring an open circuit transmission line,


Transmission lines can get very mathematical.
have a laugh here

https://s2629002012.files.wordpress.com/2012/11/huitransmissionlines.pdf

But , basically , all you have to remember, is that a signal travels as a wave down a wire, at a set speed.

You already know all about this, as a child.......
If in doubt, think of a stone dropped in a canal. The waves move out from the stone at a set speed,
when they hit something, some of the wave bounces back,
when the bounced back wave hits something , again some of that bounces around.
If the end is a nice shape, no wave bounces back. if its a wall, a lot bounces back.
The resultant waves on the pool can become very complex as they interfere with each other as they pass.
Remember wave theory, waves in phase add, waves anti phase subtract.

Think of the wire as the canal

At the far end, The wave hits the end. Now the fun bit.

If the end is a matched impedance to the cable, then the signal is absorbed.
But in most cases, the wave hits the end, and there is a mis match, and some signal is bounced back towards the transmitter.
The amplitude and phase of the return is dependent upon the impedance characteristics of the receiver.

if you change the end, the impedance changes, and so the refection changes.

An open end, is a perfect brick wall,
a short circuit end is a perfect absorber.

Re how the signals change.
Now we have to go into Fourier ........

Any waveform can be made upon a combination of sine waves, of various frequencies and phases.

a perfect square wave is made up on of the odd harmonics only of the orriginal.

https://en.wikipedia.org/wiki/Square_wave


The signals you see on the scope.

Your load is forming a low pass filter with the capacitance / resistance in the circuit,
as you increase the resistance, you are absorbing more of the high frequency.

Your signal has spikes on it, which according to Fourier, are higher frequency than the fundamental.
so the ripple gets attenuated first,

Then as you increase the resistance, you are seeing the rising / falling edges of the square wave smoothing of.
If you kept going, you would get back to more like a sine wave.

Teaching mode rant over.

Connect the wires to the load and see what the real signal looks like could be intuative.
 

crutschow

Joined Mar 14, 2008
34,280
That jumble of wires is not something you should be using, as its characteristic impedance will vary with wire position and arrangement.
The wire characteristic impedance is determined mostly by the distance of the wire to the returning ground, and that's all over the place with such a jumble.

Use a proper twisted-wire pair to get a reasonable controlled (and constant) impedance.
Then you can select the proper termination resistors.
 

Thread Starter

mriksman

Joined Aug 31, 2010
113
That jumble of wires is not something you should be using, as its characteristic impedance will vary with wire position and arrangement.
The wire characteristic impedance is determined mostly by the distance of the wire to the returning ground, and that's all over the place with such a jumble.

Use a proper twisted-wire pair to get a reasonable controlled (and constant) impedance.
Then you can select the proper termination resistors.
I can’t change the wire. It’s embedded in the walls now.
So you’re saying if I took that mess of wire and straightened into a single line, I’d get different results!?
 

nsaspook

Joined Aug 27, 2009
13,079
I can’t change the wire. It’s embedded in the walls now.
So you’re saying if I took that mess of wire and straightened into a single line, I’d get different results!?
Yes, you would but that just by itself might not cure your signal problem. It might be something you could easily match for a clean signal at the distant end by reducing reflections.
 

Sensacell

Joined Jun 19, 2012
3,432
Sending a single-ended TTL signal at 800 Khz over spaghetti wire is really pushing the limits, you might get it to work with voodoo tricks, but it will never be reliable.

The signal is referenced to ground, this ground reference can be corrupted by ground loop currents as well as reflections/distortions from the shabby transmission medium.
 

Thread Starter

mriksman

Joined Aug 31, 2010
113
Hi all,
I’ve added more LED strips to the circuit, and the data corruption is becoming more evident. I’ve added a level shifter to push the digital signal to 5V (to avoid triggering at 3.3V due to the signal distortions), which has helped a little.
Considering I can’t change the wire, could someone give me some tips on how to choose sending/receiving terminating resistors and how they should be wired (series/parallel)?
I can buy a LCR meter and get L and C of the wire if it helps (apparently Z0 = SQRT(L/C) )
@crutschow has already touched on this, but any additional information would be handy.
I put a 1k resistor at the receiving end, but I haven’t had much luck selecting a resistor at the transmitting end (it leaves a level shifter).
I just need to stabilise the signal to prevent data corruption.
 

nsaspook

Joined Aug 27, 2009
13,079
Hi all,
I’ve added more LED strips to the circuit, and the data corruption is becoming more evident. I’ve added a level shifter to push the digital signal to 5V (to avoid triggering at 3.3V due to the signal distortions), which has helped a little.
Considering I can’t change the wire, could someone give me some tips on how to choose sending/receiving terminating resistors and how they should be wired (series/parallel)?
I can buy a LCR meter and get L and C of the wire if it helps (apparently Z0 = SQRT(L/C) )
@crutschow has already touched on this, but any additional information would be handy.
I put a 1k resistor at the receiving end, but I haven’t had much luck selecting a resistor at the transmitting end (it leaves a level shifter).
I just need to stabilise the signal to prevent data corruption.
IMO You're polishing a wiring turd to reduce misinterpreted signals either by level or as additional edge transitions(ringing). You can get the lumped LC of the total length of wiring from some sort of impedance matching but what's usually more effective here (crappy non-constant impedance transmission line means crappy non-constant frequency/time dependent transmission line characteristics) is resistive damping to reduce the relative magnitude of energy reflections. The wanted signal needs to travel across the damp resistor(s) only once while unwanted reflections will need return trips across the lossy network. For this be very effective you need to push (lower the resistance) current in the loop with a 5V line driver to send signal power. A low value series driving resistor at the source end and a low value parallel load resistor at the receiver end.

https://www.electronicdesign.com/te...6367/back-to-basics-impedance-matching-part-1
https://www.mouser.com/datasheet/2/916/74LVC3G34-1597958.pdf
 
Last edited:

Thread Starter

mriksman

Joined Aug 31, 2010
113
IMO You're polishing a wiring turd to reduce misinterpreted signals either by level or as additional edge transitions(ringing). You can get the lumped LC of the total length of wiring from some sort of impedance matching but what's usually more effective here (crappy non-constant impedance transmission line means crappy non-constant frequency/time dependent transmission line characteristics) is resistive damping to reduce the relative magnitude of energy reflections. The wanted signal needs to travel across the damp resistor(s) only once while unwanted reflections will need return trips across the lossy network. For this be very effective you need to push (lower the resistance) current in the loop with a 5V line driver to send signal power. A low value series driving resistor at the source end and a low value parallel load resistor at the receiver end.

https://www.electronicdesign.com/te...6367/back-to-basics-impedance-matching-part-1
https://www.mouser.com/datasheet/2/916/74LVC3G34-1597958.pdf
Yes I totally appreciate the turd analogy. And I’m angry at myself for not thinking about this before wiring, I honestly should have known better.

I’m off to work for 8 weeks, so it’ll be a while before I can try your suggestion. But I’ll amass some more ideas hopefully on this forum topic and do some more research and come up with some plans to ‘polish the turd’ just a little bit more.
 

Deleted member 115935

Joined Dec 31, 1969
0
Some one said once words to effect of give us sufficient equalisation and sufficient voltage , I can send any speed signal down any line.

The fundamental problem you have is the wire , the load and the driver are very limited in your situation.

Also the load and the wires characteristics are going to change over time, so you could just inside the just works point now, and in a few months when the warmer weather comes, you could be in a no working situation.

Can you provide a rough schematic of what you have ?
I have impression that you have one source driving many loads,
are the loads daisy chained in series ?

Do you have access to the load end ?
I have not seen any waveforms of he signal at the load, which implies you don't,

If that is the case, we can not change the wires or the load,
the options are very very limited to the point I'd say its going to be impossible to make a reliable system,
 

Thread Starter

mriksman

Joined Aug 31, 2010
113
Some one said once words to effect of give us sufficient equalisation and sufficient voltage , I can send any speed signal down any line.

The fundamental problem you have is the wire , the load and the driver are very limited in your situation.

Also the load and the wires characteristics are going to change over time, so you could just inside the just works point now, and in a few months when the warmer weather comes, you could be in a no working situation.

Can you provide a rough schematic of what you have ?
I have impression that you have one source driving many loads,
are the loads daisy chained in series ?

Do you have access to the load end ?
I have not seen any waveforms of he signal at the load, which implies you don't,

If that is the case, we can not change the wires or the load,
the options are very very limited to the point I'd say its going to be impossible to make a reliable system,
There is a rough diagram above. It is an ESP32 module driving the 800kHz signal. This enters the level shifter (link provided above).

It then travels down the wire - which I cannot change as it’s in the walls/cavity/stairs.

It arrives at the first stair at the first SK6812 LED of a string of LEDs. It’s only the first LED that matters, because it then reconstructs the signal for the rest of the LEDs. But if the signal arrives distorted at the first LED, then the reconstructed signal will contain errors, which is why I see brief flashes of incorrect colours further down the chain.

So essentially, it is ‘one source driving one load’; even though there are other loads (the other LEDs in series) after that first LED, I imagine this wouldn’t have an effect on the signal coming in. I don’t think there would be a difference if I had 5 LEDs or 1000 LEDs; the choice of resistors would be the same?

I have access to the ‘load end’, or ‘receiving end’; the first LED in the circuit. This is currently where I have a 1kΩ resistor in series on the data line.

This is what it looks like at the load end right before it enters the first LED

5E929FB7-710A-4265-9A62-3AA2FB5DB1EA.jpeg

(Although I think this was before I added the 3.3-5V level shifter)
 

Thread Starter

mriksman

Joined Aug 31, 2010
113
Anyone have any ideas on how to measure/calculate the impedance of the cable as it’s currently installed? Most articles talk about open-circuit and short-circuit; but this assumes the cable is shielded and you are shorting the shield and transmission wire.
How would I determine appropriate series/parallel resistance values if I can’t determine the impedance of the cable?
 
Top