Hello, I had to add some line drivers to my Arduino in order to

Hello, I had to add some line drivers to my Arduino in order to drive my WS2812 LED strips (due to distance). The line drivers invert the output of Arduino pin, so I need to compensate.

I know I could invert the outputs using additional hardware, but it would be easier for me to do this in software.

Does the FastLED library provided some mechanism to invert the output of the pin? I did see some posts about this question from about 18 months ago which said “no”, but I was wondering if any functionality like this has since been added?

No, it hasn’t been, and it is unlikely to be, it isn’t really easier to do in software (without some re-writing/re-coding/re-working of the logic in about a dozen+ places)

Thanks for the quick answer.

Maybe I’ll dive in and have a look at the guts and decide which path is easier for me. Any words of wisdom for me?

I am guessing from your response that there is no central “write to pin” function that could be easily inverted.

In any case, thanks Daniel!

what’s the distance?

Eventually I’ll have 7 strips driven from a single Arduino (3 installed so far). The strips are in different places and range in distance from about 20’ to 50’ away (distance from Arduino to the first LED in the strip).

Hi @Dan_Jakubiec , I remember successfully driving a very long coiled single wire between an Arduino Uno and a single WS2811. I think it was around 40 feet in length but not 100% sure.
Did you actually try it without that inverter ??

I use cat5 cable for this and have gone up to 50’

Dan! Could you share your approach with the line drivers? I was actually about to open a question since I am trying to drive 10 leds strips (from one arduino) with 6 to 10 meters of cable (22awg) in between and the data starts failing after I connect the 4th.

I really dont know anything about line drivers…

thanks!

One of strips works OK at about 30’, the other two (30’ and 25’) are in various states of flakey behavior.

We put a scope on all the outputs with and without the runs connected and the signal gets quite marginal with the runs attached. It did look like some line drivers would clean up the transitions.

I was about to wire it up to try it but didn’t have all the parts I needed for the hardware inversion. So I was hoping for a simple software solution instead.

Hi @Dan_Jakubiec , just now repeated a similar test that I had done a few years ago with approx. 90 feet spool of 4-wire awg22, the type that is typically used to interconnect 4-wire strips. I use only 2 wires, one for data out of the Arduino Uno and the other is GND. Note that the GND wire does not carry any current for the LEDS that are powered locally. The GND wire only provides the voltage reference. That is 90 feet of data wire AND 90 feet of GND wire.
The 4 WS2811 LEDs at the far end work 100% !!!

@Leo_Bettinelli Sure Leo… I have one Arduino Yun driving 7 GPIOs via a single cable (plus GND) running to a junction box about 20’ to 25’ away. From that junction box I am sending 7 independent CAT6 drops to 7 different LED strips (anywhere from 2’ to 25’ away).

Each CAT6 drop uses one pair to provide signal and GND to its strip. Each strip has its own independent 5V power supply located next to it. V- at the strip is tied to the GND wire in the drop.

All the grounds in the whole system (including Arduino GND) are tied together in the junction box only (to avoid ground loops) and from there to earth ground.

I had originally used a CAT6 cable for the 25’ run from Arduino to junction box, but was later advised that combining the different signal lines in the same twisted pair could potentially result in some noise from cross-coupling… so I’ve since switched out that one run with straight-thru thermostat wire (but honestly it did not make a difference as far as I could tell).

The scope shows sloppy transitions on the signals once they get loaded down with transmission lines (very clean without them) and the theory is that the Arduino’s output drivers are a little underpowered for my set up (but I could certainly be wrong).

I’m adding some Intersil EL7232 line drivers between each output on the Arduino and the connector to the primary control cable. So:

YUN > EL7232 -> RJ45 socket> RJ45 connector -> thermostat wire -> junction box -> individual drops

But sadly (for me) the EL7232 inverts the output signal so I either need to go solder up 7 sets of inverter circuits on my perfboard or figure out how to flip a bit in the software.

And there is the whole sad and happy story. Hope that helps.

@JP_Roy Wow, thanks for the test and the data point. Honestly I was a bit surprised that I was having problems as I agree the distance does not seem that great.

Perhaps it has something to do with my additional connectors, junctions, cross-coupling between my 7 control lines, etc. Or maybe the Yun has weaker outputs??

Or maybe its just some other problem. I’ll try to play it more this week. Thanks for the help though!

Hi @Dan_Jakubiec , I have only done this test on a single strip with only a few LEDs. I am convinced that my setup would handle hundreds of LEDs just as well.
However, multiple strips spread apart could bring problems if the GND level is not consistent. IE GND loops carrying some current and causing some DC bias. Something for you to check carefully.

thank you so much +Dan Jakubiec. I have reaaround people using sN75176 and I am myself waiting for them to arrive to do my tests.

there is this information around (http://www.teknynja.com/2014/02/driving-ws2812neopixels-rgb-leds-over.html?m=1) and it seems to be very helpful for lots of people on this regard. With my ultra limitated knowledge of electronics, I will get into this to make my setup work and thus, expand my knowledge. :slight_smile:

@JP_Roy Ya I’ve got 150 WS2812’s on each strip (5m long).

And yup, I have all grounds tied together with earth ground in a single location in the junction box (and nowhere else).

I’ve verified the grounds with a voltmeter where I was close enough to an earth ground source… though I suppose it would be worth it to pull a temporary ground line to some of the more distant strips to double-check those.

Thanks for the idea!

@Leo_Bettinelli Cool idea. Ya RS-485 would be ultra-immune to noise… it was designed to go 1000s of feet. Though I suspect it would be overkill for my relatively short runs.

Besides the general transmission line effects of distance, there could be a problem at the junction box; the transition between different wiring of different impedance (and the box itself) could cause reflections for example. This makes it different than a simple length of wire between sender and receiver.

Actually, the Cat6 might work well, but I would send each signal down half a twisted pair, and ground the other half of each pair (at least on the sending end). There should not be too much crosstalk between twisted pairs - which is how they get very high frequency to work in those pairs. This means a maximum of for signal wires (plus the corresponding grounds in each pair). But putting two data signal in the same twisted pair would not be so good! (Just in case anyone doesn’t know what I’m talking about, the cable consists of 4 twisted pairs of wire; you can look up the corresponding pin numbers; they are a bit scrambled).

RS-485 is cool, but you will also need a powered receiver on the far end, to convert from differential signalling on a pair of wires, back to TTLish single ended levels for the pixels. BTW, it doesn’t go thousands of feet at our signalling speeds (tho it can at lower speeds), but it should have more than enough slack anyway for our length of runs.

@Zeph_Smith that is exactly how you do the twisted pair - ground/data on each pair, which means you can do 4 data lines on a single cat5/cat6 cable. I can also tell you from direct experience that having two data lines on a single twisted pair will crosstalk out the wazoo!

+Dan jakubiec what do you mean by “overkill for my relatively short runs.”

it could be too much if the cable extension is not a lot?

I am also not dealing with a lot of cable! “10 leds strips with 6 to 10 meters of cable (22awg) in between”

@Zeph_Smith Yup agree. My original configuration actually had a CAT6 cable wired as you recommended with half of each pair ground. The main reason I switched to non-twisted thermostat wire was because I needed 7 transmission lines (plus 1 GND line). Or I could have run two CAT6 drop.

In any case, for what it is worth I saw no difference in behavior between the grounded CAT6 and the thermostat wire. So I think both ways are good.