Long Data Wire + ESP8266 + Level Shifter

I have 2 ESP8266 boards running 700 leds each. The first board is running lights across the first floor of my house the the data wire is connected directly to the D4 pin on the board and all works without issue.

The problem I am having is the second board is to run lights on the upper level of the house and I need to have a long data wire (over 10M) to reach the first strip. The data cable I am using is 14 AWG.

Both boards are sitting in my garage and the lights are outside.

I have read that when using a long data wire I need to add a level shifter, which I have done. When putting an LED strip directly off the level shifter everything works. However, when I add my 10+ meter data cable I run into the issue where the board will not boot up.

I have tried with and without the 470 Ohm resistor as I have seen mentioned in other questions.

I am new to all of this and am not sure what I am missing?
I am also attaching my wiring diagram.

Here is the level shifter that I am using:

Add a pull-up 4k7 resistor to a D4 pin.

I just put a 4k7 resistor from the D4 pin to 5V+ and it still does not boot with the data wire connected.

Not 5V!!! 3.3V.
You will damage ESP.

Tried again with 4k7 from D4 to 3.3V. Still does not boot with data wire attached. I unplugged the data wire and it booted properly.

then your data line is pulled low which prohibits booting.
use some other pin (GPIO12-GPIO14 or GPIO4-GPIO5)

The “How far can I put my controller from my LED’s” question comes up often as we’re all trying to cover our living spaces with wonderful LED projects.
Here’s my short primer on the 3 scenarios (for serially addressable LED’s, WS281x, APA102,etc,etc):

Legend:
D1 is the 3.3V LED data from the ESP-WLED controller.
D2 is the “corrected” LED data after a level shift back to TTL (quasi-5V) levels.
Ro is the kludge resistor used when you’re in scenario “B” and trying to force things back to “A”.
A+,B- LED data “encoded” for long distance transmit over 2-Wires (GND is also required).
LD Pwr is the power required for the long distance receiver (Rx).
Strip Pwr is the power line needed for LED’s, need NOT be 5V, sometimes 12V (or even 24V).
Gnd’s need to be connected together - Common GND.

The “secret sauce” to these diagrams is the “Long Dist Tx” and “Long Dist Rx” modules.
They’re nothing more (or less) than RS485 modules configured for half-duplex TX and RX.
You can look at another thread for my examples of how simple they can be. That thread also talks a little more on my cabling choices for B setups (22/4, alarm wire).

IMHO many people are trying to “force” a scenario B into an A by using just enough wire or adding Ro.
I get it, A is simple, less parts, easy to visualize everything.
Hey, I typically push my setups as A’s without even the Level Shifter or Ro (never used Ro) and lots of them work well.
But if I want to be sure the setup is reliable beyond 3m, I’ll wire it up as a B.

The other nice thing I find with B scenario is I can build it in the “lab” as an A with the controller right near the strip and then go into “production” by adding the Tx/Rx pair after the code is all doing what I like.

Note, you don’t need an extra Level Shifter for B or C, the specs on the MAX485 give you that for “free”.

All the other notes about GPIO’s to use still apply.

2 Likes

Also, the shifter you linked says I2C which means it’s likely too slow. See recommended shifters in wiki/kno.wled.ge base.

I changed from gpio pin 2 to pin 5 and that fixed my issue of booting. Thanks!

As for the distance and shifter comments, could both of those be corrected by using a sacrificial pixel right at the board and eliminate the shifter?

The sacrificial pixel is the “poor man’s” level shifter.
At best you can try and put it halfway from the board to the strip.
You’re still counting on that 1st pixel reading the board reliably and then being able to send over a longer than standard spec distance.
On the plus side it’s cheap to try, if it works go for it.