Determining correct series resistor value

its not about inductance but impedance. keep that as constant as you can.

I have 500 ohm trimmers in-line right after the level shifter outputs. I never get a “clean” square wave, either the beginning has a “rollercoaster” (which is what the signal looks like between the gpio and the shifter’s input), so it’s like 4.4v than 4 then 4.3, 4, 4.2, etc. for about .25 of the positive half wave, or the flank has tiny “steps” and is not really vertical, or the top of the wave is full of ripples, or the flank is curved.

You’ll get an ideal output when the total of the source driver’s impedance and your resistor match the impedance of your line, which is the square root of the line inductance divided by the capacitance between the wires. If you move the wires closer together you’ll need a smaller resistor. Further apart, a larger resistor.

In your case you don’t have a single distance between the data and matching ground wire, so there is no resistor value that results in a perfectly matched source and line. If you match it for one place its wrong for another. What you should do is a pick a type of wire that you’re going to use (coax, twisted pair, even speaker cable; doesn’t matter so long as it holds the data and ground equally far apart). Then wire everything with that wire, and keep any spots where you separate that line into two wires as short as possible and as close to the source as you can. That will give a single impedance for the entire line, which you can match with a resistor that is as close as possible to the source.

1 Like

I’ll keep that in mind. I admit, I was looking for quick and easy with my prototype.

So, I cleaned up the wiring some, but that made no difference.

(It’s hard to tell in the screen shot of a video, but there are vertical white “bars” that flash around)


Next, I removed the breakout board and connected the duponts to the pins. No difference, the panel still flashes. I burned another ESP 32 and uploaded the presets and configuration. Imagine my surprise when the flickering disappeared… I have a few I bought on AliExpress waiting on projects, so I flashed another, and it worked just fine too. Chalk that one up to tolerances, I guess.

Anyway, the oscillograms look like this (ch 1 is shifter’s input and ch 2 is output after the trimmer):
I assume this one is the “best” squre wave, or is the negative spike or ripple an issue?

Then we have this:

And finally this:

The ESP32 that was having the issue, had the issue throughout the entire range of 0 - 500 ohms. The ones that worked never flickered once.

@dedehai: If youd explain them, I’d be very interested. Thank you!

Thank you @saratoga! That is helpful.

Your output actually looks very clean and any of those waveforms would be fine. As a rule of thumb, the effect of the resistor will start to matter when your line gets longer (in inches) than the rise time of your signal (in nanoseconds). If the line is very short relative to the rise time, then the resistor has very little effect, which I think is what we are seeing here and why you aren’t able to do much with those trimmer pots. If you put a longer line, you’ll see that they have a dramatic effect on the signal coming out the far end.

the last one, while still ok, clearly has too high of an impedance, you can see that in the rounded flanks and the “step”. the other two are about as perfect as you can get, to see which one is better you would need longer lines.
overshoots and undershoots are perfectly acceptable as long as they stay below 0.5V. you can dampen them with more resistors at the right places but that would be gilding the lily.

what the LEDs see on the other side of that line can be somewhat different, if you want to measure that you need to consider what the probes do to the signal as well.

Thank you all so much for your help. I very much appreciate your taking the time!