Short/Summary: Don’t use BSS138 to logic level shift data signal to DIN of first WS2812B. Diode trick will likely/probable. Ideally, should use level shifter capable of handling 800khz+ frequencies, multiple Mhz even.
Yet another LED board project… My 1st attempt failed, working on 2nd… Does this BSS138 based logic level shifter schematic and layout look okay to you? Trying to boost data signal from QTPY ESP32 to first WS2812B RGB LED. Maybe shifter isn’t required for such a tiny project? Am trying to minimize failure risk. This is my 1st custom PCB design, my goal is to learn and have fun, so any feedback/suggestions are appreciated.
Can just about visualize ~3V3 data signal on my cheapo DSO138 scope, but am unable to reliably visualize boosted ~5V signal with enough clarity to inspire confidence that the level shifter fragment of the circuit is good enough for ‘neopixel’ frequencies. Not sure if scope and/or BSS138 and/or me are the issue. I did temporarily hack code to set pin constantly high, this helped verify ~3v is boosted to ~5V. However success at constant 0hz doesn’t mean the circuit works at neopixel frequencies. Mentioning this, because am seeing misc interweb info saying BSS138 are only good up to 2mhz(?). Currently using 10K pull-up, anyone think lower value e.g. 2.2K would be better and help with working well at the 800khz that WS2812B use?
The basic data stream for WS281x series is less than 1Mhz, but with some fairly tight timing requirements for the Hi and low pulses - down in the 150ns range. That means the ~2Mhz speed of the BSS138 device might not deal well with all of the data waveform, especially the faster bits.
Any of the 74AHCTxxx devices will do a better job ('08,'32,125,245), they’re cheap, fast and reliable.
If the size of the package is too much, the 74lvc2t45 is a tiny package with 2 independent shifters.
Much faster than the MOSFET and still very cheap.
On the scope:
If you’re looking for a scope to properly visualize the actual data stream, you need to start at the 10Mhz devices at minimum. When dealing with pulse widths of 100-150ns you’re talking 10Mhz, and more bandwidth (that means more than 10Mhz) is always better.
That should be fine, it’s just a single channel version of the 74LVC2T45 I recommended above. Only “downside” to these devices is that they need both 3.3V and 5V supplies vs the 74AHCTxxx which are 5V only.
Not a big issue, you just need to know.
BTW, LCSC lists the 74AHCT1G17 which would work as well and is a single 5V supply device…
You also need a connection for the ~OE input of each gate.
The ~OE (read as Not Output Enable) needs to be LOW to enable the output of the gate.
Here’s a wiring diagram I stole from @tonyno who pinned it to Learning on the Discord site:
You’ll note all the used ~OE lines are grounded.
In addition the unused inputs are tied together (and grounded) as well.
This is to prevent “floating inputs” that can cause all kinds of trouble, flickering, etc for your strips.
Note the 100nF bypass capacitor from pin 14 to Ground.
That’s good insurance to prevent power supply noise from creating “glitches” on the outputs and more flickering, etc.
Edit: found better drawing -to steal- thanks @tonyno Corrected for unused ~OE lines
hi thanks for the help. I tried both schemes, both the one that closes the channels with the GRD and the one with the 5v I inserted the 100 capacitor in both cases. I noticed that the flicker was canceled with the oe scheme and GRD , but I had to put in a 300 ohm resistor. so I was able to extend the data cable about 60 meters without flickering.
Credo che mi posso spingere ancora di qualche metro non saprei. Domani provo a vedere, aggiungendo altro cavo. Il primo led e accesso, nessun sfarfallio. Dovrei provare a saturare tutti i canali del CIP per verificare che non ci sia troppo calo di tensione. Compro tutto da AliExpress. Anche se ultimamente i prezzi sono aumentati.
Thanks again for your help and the Amazon link . I am from Canada, this is what I found and it seem like regular chip.
And the one you linked as well. I am going to order this one instead.
I also got a bunch of this TXS0108E too but I couldn’t get it to work when I bought them couple year back. But for some reason it started to work now on my bench test and I am not sure I should use this one or get the one you linked.