# ESP32 + SN74AHCT125N, Wiring? Max. length data cable to SK6812?

**URL:** <https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294>\
**Category:** Issues\
**Created:** [February 13, 2021, 7:19pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294 "2021-02-13T19:19:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mekanikless](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mekanikless](https://wled.discourse.group/u/Mekanikless)\
**Post date:** [February 13, 2021, 7:19pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/1 "2021-02-13T19:19:01Z")

</div>

My first LED project and new member here, so I can’t upload more than one picture and add more than two links.  
It works good when the data cable is short but not for as long I need (5m in first room, will be longer at other room). Read a lot about this and some said the resistor is too big so I went from 470ohm to 100ohm (didn’t had 62ohm as I saw wled wiki prefer). Also read that the data signal is 3,3V instead of 5V from ESP32 so a levelshifter is to prefer according wled wiki. Bought SN74AHCT125N but it didn’t solve it like I was hoping for. Probably wiring is wrong, please take a look and help me if you can. Hope for a fast answer 🙂

Don’t understand this levelshifter drawing at wled wiki. Data, 3,3V , 5V and GND in and Data, GND out?

Info I found:  
ESP32 + SN74AHCT125N (mixed up + & - at breadboard)

[![](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/9/9c0534e3c2224f38219f1eef154dd45487200bcf.jpeg "Using a 74AHCT125 chip as a logic level shifter") ](https://www.youtube.com/watch?v=ZZenXfToFB0)

SN74AHCT125N

> **[NeoPixels on Raspberry Pi](https://learn.adafruit.com/neopixels-on-raspberry-pi/raspberry-pi-wiring)**
>
> Learn how to install and use a Python library that lets you control NeoPixel/WS281x LEDs connected directly to a Raspberry Pi. No microcontroller needed!

My setup:  
POWER SUPPLY 5V 60W  
ESP32  
Levelshifter SN74AHCT125N

My wiring

 ![2](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/b/be4b7d08d8a4714e39c60065d6f231078c383ce4.jpeg)

---

<div class="post-metadata">

**Author:** ![Thedannymullen](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/thedannymullen/32/297_2.png) [@Thedannymullen](https://wled.discourse.group/u/Thedannymullen)\
**Post date:** [February 14, 2021, 12:06am UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/2 "2021-02-14T00:06:38Z")

</div>

Off the top of my head wiring looks ok. Only thing I do know is the 125 chip suggest tying unused output enables to vcc or ground possibly the input also pull up the data sheet to verify.

Personally I would remove the resistor. But also what wire are you using to connect the nodemcu to the strip? I had an issue with some wire I used causing my data signal to be corrupt. It was the three conductor white led wire from Amazon. I peeled the outer jacket off to separate the wires and my problem went away.

---

<div class="post-metadata">

**Author:** ![Mekanikless](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mekanikless](https://wled.discourse.group/u/Mekanikless)\
**Post date:** [February 14, 2021, 8:41am UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/3 "2021-02-14T08:41:04Z")

</div>

Thanks for reply. “Only thing I do know is the 125 chip suggest tying unused output enables to vcc or ground possibly the input also pull up the data sheet to verify”. Unfortunately I don’t understand this, is it important? If’s so please try to describe so even I can get it 🙂

Forgot to mention that I’m using RGBW SK6812 5V led strip 60 led/m.

> **[SK6812 RGBW 4 in 1 Pixels Individual Addressable Led Strip DC5V](https://www.btf-lighting.com/collections/pixels-led-strip-1/products/1-sk6812-rgbw-4-in-1-pixels-individual-addressable-led-strip-dc5v?variant=25757793714276)**
>
> Shipping Policy Note:  The price is only Led Strip, Not Included Power Supply or Led Controller! SK6812 RGBW Must Use DC5V Power Supply AND Led Controller to Control!   every 0.5meter with solder joints, please note!  ...

Have tried one core from Cat. 5 TP cable and 0,75mm2 RKUB in different length for data. For +5V and GND i use 0,75mm2 RKUB. I solder all connections so I believe it’s good connection.

I will remove resistor and see what happens.

---

<div class="post-metadata">

**Author:** ![srg74](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/srg74/32/3018_2.png) [@srg74](https://wled.discourse.group/u/srg74)\
**Post date:** [February 14, 2021, 4:10pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/4 "2021-02-14T16:10:43Z")

</div>

SN74AHCT125 all OE have to be tight to GND and you need a capacitor next to IC 0.1uF from 5V to GND.

---

<div class="post-metadata">

**Author:** ![Mekanikless](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mekanikless](https://wled.discourse.group/u/Mekanikless)\
**Post date:** [February 18, 2021, 6:00pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/5 "2021-02-18T18:00:40Z")

</div>

I will try to get a capacitor but I already tried to connect all OE to GND. Do you connect the capacitor just before the level shifter or doesn’t matter?

**What’s the max. length of data cable in my case? How far have members here reached? Best cable to use?** Think this could be a good youtube topic, how to maximize data cable with wled, esp32, 5V sk6812.

Think it’s very sensitive or I’m making something wrong. Is SK6812 worse to deal with compare to WS2812?

Resistor seems to be important, found this “and it will act as a termination resistor reducing “ringing” from signal edges”

> <https://electronics.stackexchange.com/questions/102050/what-is-the-purpose-of-adding-a-300-ohm-to-500-ohm-resistor-on-the-ws2812b-neopi>

My tests so far. Will continue this weekend.

1. Cat. 5, only using one thread, length 0,24m between ESP32 and led strip SK6812  
No resistor Not working good  
22ohm Not working good, right color but flashing  
33ohm Working good  
47ohm Working good  
100ohm Working good  
470ohm Working good

2. Cat. 5, only using one thread, length 0,24m between ESP32 and level shifter SN74AHCT125N, from level shifter to led strip 0,28m  
33ohm Not working good  
47ohm Not working good  
100ohm Not working good  
470ohm Working good

3. Cat. 5, only using one thread, length 0,24m between ESP32 and level shifter SN74AHCT125N, from level shifter to led strip 4,5m  
100ohm Not working good  
470ohm Not working good, flashing a little

4. Cat. 5, only using one thread, length 0,24m between ESP32 and level shifter SN74AHCT125N, from level shifter to led strip 2m  
100ohm Not working good  
470ohm Not working good, flashing a little

5. Cat. 5, only using one thread, length 0,24m between ESP32 and level shifter SN74AHCT125N, from level shifter to led strip 2m, **all OE at level shifter connected to GND**.  
47ohm Not working good  
100ohm Not working good  
470ohm Working good

---

<div class="post-metadata">

**Author:** ![srg74](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/srg74/32/3018_2.png) [@srg74](https://wled.discourse.group/u/srg74)\
**Post date:** [February 20, 2021, 3:50am UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/6 "2021-02-20T03:50:46Z")

</div>

Please bring some science to equation. Oscilloscope will be a proper tool to examine your signal and understand what is really happening with your data signal. Otherwise it’s so called guesstimate. For your knowledge using CAT5 cable for addressable LEDs is a bad practice. Unless you want use RS-485 for extending distance between board and your strip. In this case distance will be up to 1000ft.

---

<div class="post-metadata">

**Author:** ![Mekanikless](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mekanikless](https://wled.discourse.group/u/Mekanikless)\
**Post date:** [February 20, 2021, 10:34am UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/7 "2021-02-20T10:34:36Z")

</div>

Thanks srg74 for your support, really appreciate this. Honestly this is not my area, mechanical engineer. Thought I could follow a guide, works good for short distance data signal. Didn’t expected it should be a huge problem for 5-10m. I’m interested about oscilloscope and there are nice video at youtube how to get one cheap, but then you shall have the knowledge to use it also. This will take time. So I only done this stupid trial and error because I don’t know better, guesses as you say. I’m in a big house renovation and just want this to work as soon as possible so I can proceed. I have prepared hoses in the walls for invisible installation and want to use these, not possible to change them now. All led strips and esp32 I already bought. Seems you know what you are talking about, can you help me solve this with a guide how you would solve this, components (art.no), cable and wiring? Will it work with just a better cable, any suggestion of which one in that case? Tried to read about RS485 but realize it’s a big area. Is it possible to just have a chip like this in both ends, see link? 1000ft is a bit overkill maybe there are better options? Ready to pay some money for help if that will increase motivation 🙂

> **[Maxim Integrated MAX485CPA+ Interface IC - transceiver RS422, RS485 1/1 PDIP 8...](https://www.conrad.com/p/maxim-integrated-max485cpa-interface-ic-transceiver-rs422-rs485-11-pdip-8-170069)**
>
> Conrad - your technology specialist. More than 550,000 products for professionals. 95 years of experience in electronics, information technology, mea

---

<div class="post-metadata">

**Author:** ![srg74](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/srg74/32/3018_2.png) [@srg74](https://wled.discourse.group/u/srg74)\
**Post date:** [February 20, 2021, 2:53pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/8 "2021-02-20T14:53:24Z")

</div>

Let me straight out the whole deal here 🙂 What exactly is your project? Few strips installation is a one thing but entire house lights? Best to know your vision.

---

<div class="post-metadata">

**Author:** ![Mekanikless](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mekanikless](https://wled.discourse.group/u/Mekanikless)\
**Post date:** [February 20, 2021, 3:33pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/9 "2021-02-20T15:33:15Z")

</div>

It’s not the entire house 🙂 I will have four small strips in the bathroom to start with, believe it’s a simple project. Then it will be LED strips in the kitchen but lets focus at bathroom to start with.

LED strip 1 & 4 = 0,9m (furniture 1m)  
LED strip 2 & 3 = 0,25m (furniture 0.3m)

 ![image](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/d/de582ebb13f2f2ffc9e7106dd8da3df3dd3b4141.jpeg)

---

<div class="post-metadata">

**Author:** ![srg74](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/srg74/32/3018_2.png) [@srg74](https://wled.discourse.group/u/srg74)\
**Post date:** [February 20, 2021, 5:30pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/10 "2021-02-20T17:30:09Z")

</div>

That is simple. Change all your CAT cables to normal one 18AWG for your setup will be enough (16AWG better). You have to use some kind of shifter or “sacrificialm pixel”. That pixel have to be located next to your board. Good practice is to use ready made boards or you can assemble one for yourself if you have skills. This one have a relay and for your bathroom setup will add more safety.

> **[srg74/WLED-wemos-shield](https://github.com/srg74/WLED-wemos-shield)**
>
> Wemos D1 Mini (ESP8266) or Wemos ESP32 D1 Mini (ESP32) based shield for WLED firmware

This one is in waterproof enclosure:

> **[srg74/Controller-for-WLED-firmware](https://github.com/srg74/Controller-for-WLED-firmware)**
>
> Wi-Fi controller based on ESP-07S module with external antenna for WLED firmware.

---

<div class="post-metadata">

**Author:** ![Mekanikless](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Mekanikless](https://wled.discourse.group/u/Mekanikless)\
**Post date:** [February 20, 2021, 7:53pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/11 "2021-02-20T19:53:38Z")

</div>

5V and GND are all with 18AWG at bathroom (will use this at least for the other rooms too, have 16AWG and 14AWG if necessary). It’s just the data signal I use one thread (1 of 8) of the TP cat. 5 cable. So it’s better to use 18AWG also for data signal? I have tried that too but I think the cat. 5 cable was a bit better. (I have Cat. 6 cable also but I did not plan to spend it for this). From LED 3 to LED 4 it’s about 4,5m. Can’t place anything in the hose, too small diameter, in worst case it’s possible to sacrifice one led in the wall box at bathroom. But in kitchen there are more than 5m (max. 10m, have to check distance) at the hose without any “opening”, so the problem still exist. Also read some more about rs485 and found this video. Hope it can be solved without this, at least at bathroom. Think these are a bit too bulky but if it works with the chip in previous link or similar that’s maybe an option for the kitchen in worst case?

[![](https://global.discourse-cdn.com/free1/uploads/wled/original/2X/9/91a1493934931b8999ea4d00c1837e53e5399466.jpeg "Using eBay RS485 boards to transmit Pixel Data") ](https://www.youtube.com/watch?v=T80llbFYD98)

I believe you have made a really good work with this board, but seems I need to spend some time for this also in that case 🙂 I will continue with my ESP32 to start with but of course the safety is important.

---

<div class="post-metadata">

**Author:** ![Modelman](https://yyz2.discourse-cdn.com/free1/user_avatar/wled.discourse.group/modelman/32/416_2.png) [@Modelman](https://wled.discourse.group/u/Modelman)\
**Post date:** [February 20, 2021, 10:48pm UTC](https://wled.discourse.group/t/esp32-sn74ahct125n-wiring-max-length-data-cable-to-sk6812/2294/12 "2021-02-20T22:48:27Z")

</div>

The signal outputs on some ESP32 clones are very marginal and sometimes not even 3.3v. Your controller data line to level shifter is around 240mm. Reduce this to the absolute maximum of 75mm and try again.  
I use the sacrificial pixel and diode method. My ESP32 to sacrificial pixel and diode is 50mm. I use a 330 ohm resister on the data line which on my outbuilding is current 8m long (32 strand copper speaker cable) with no flickering issues. I have tested data runs up to 12m also with no problems using 64 strand cable.
