2

I have repeatedly heard that control of Neopixel LEDs running at 5v requires special voltage conversion when using a 3.3v processor, as the 3.3v control input is actually out of spec for the WS2812B LED control chip. I've not personally had problems, but as I'd eventually like to sell my device as a product that may use user-supplied Neopixels, I'd like to do a proper conversion.

The protocol is quite fast - The data rate is 800Kbps, although I've heard it referred to as 1MHz at times. I've tried basic logic level converters like the Sparkfun one, but they don't work at these speeds and are additionally large and expensive (plus I don't need all the channels).

Does anyone have a simple, cheap solution that uses a minumum level of components? Somewhere I was referred to an op-amp based solution, but that also has cost and complexity issues. Ideally I'd like a transistor-based version, and I may have found one, but I need help figuring out what it's doing. Here's the link: https://www.instructables.com/RGB-Circuit-Sculpture-Lamp/

It would seem to be using a MOSFET to switch power to the Neopixel strand, but I can't figure out where the 0v(low) half of the logic is coming from and the connections are very strange. One of the larger puzzling bits is the fact that it uses two data pins. The pin 0 marked in the schematic is set to a constant logic high (so, 3.3v) while pin 3 appears to do the actual controlling.

I then went to look up the transistor to determine what the pin connections are, but the datasheet is peculiar: https://www.onsemi.com/pdf/datasheet/nds7002a-d.pdf

The schematic listing gives the usual gate/source/emitter pinout, but this is not mapped to the device's package, which is listed with pin 1, 2, and 3. This is something I see in datasheets all the time, and while I understand the use of a transistor (except for cases like this one, where I can't find the ground connection), I still can never figure out how to wire one up.

TL;DR:

  1. Does a cheap, small, single-channel solution exist to megahertz-level signal level conversion exist?
  2. Does the example given actually work, and if so, what is the principle of operation?
  3. What pins of the transistor are connected here, and how? What is the secret to the pin mapping between the package and the schematic that I clearly don't know?
  • I'm pretty sure you could do an easy one-transistor level shifter for this. MOSFETs are nearly always GDS, but there are exceptions, so I wouldn't say it is for sure. This is something I've noticed about onsemi's transistor datasheets in particular, they seem to be rather unclear on the actual pin configuration of the part. – Hearth Nov 02 '21 at 02:25

2 Answers2

1

The 74AHCT125 is the classic level converter for Neopixels as recommended by Adafruit. This logic buffer accepts a 3v input (threshold is well below 3v) so switching is certain. It can easily handle the neopixel signaling speed. Here is the recommendation.

https://www.adafruit.com/product/1787

GT Electronics
  • 4,074
  • 7
  • 15
1
  1. Yes such a solution does exist, and multiple solutions have been suggested here to questions similar to yours already, please do a search. Asking what to buy and from where is however off-topic.

  2. That circuit you linked to is an identical circuit to Sparkfun bidirectional level converter which you specifically wanted to avoid, except the actual FET is of different type. It might just barely work if you make one prototype, just like it might barely work without level conversion too.

  3. It's a bidirectional level translator with a FET. Source is the 3.3V data input pin, gate is constantly set to 3.3V, and drain is the 5V data output pin as it has a weak 10kpull-up to 5V.

Justme
  • 127,425
  • 3
  • 97
  • 261
  • Good to know. I'll avoid that, then. Do you have a guide for the transistor pinout issue, though? Why do datasheets not map the G/D/S to the package? –  Nov 02 '21 at 14:21