0
\$\begingroup\$

enter image description here

I'm trying to use a WS2812B addressable LED with a multiplexer 74LVC1G157. The WS2812B uses NZR protocol comunication at 800 Kbps and each pixel scan frequency not less than 400 Hz.

I have test code on an Arduino, and all works fine, but when I use two different LED signals, one from an Arduino and one from a Raspberry using the Neopixel library, it sometimes works fine, other times, the LED goes crazy, always with the Raspberry signal.

I have tested all, the signal from the Raspberry is fine if I test it with an LED without the multiplexer. If I touch the multiplexor connectors, the behaviour changes (sometimes fine, sometimes wrong).

I attached an image with the adapter I'm using (where I think the problem comes from):

enter image description here

enter image description here

\$\endgroup\$
7
  • 1
    \$\begingroup\$ The board occupied about 5% of the giant photo you posted. So I have trimmed the image right down. Please trim photos with such excess instead of just dumping them on the site. Thanks. \$\endgroup\$
    – TonyM
    Commented Jan 26, 2022 at 12:57
  • \$\begingroup\$ Sorry, my mistake. Thank you so much. \$\endgroup\$
    – Juanma
    Commented Jan 26, 2022 at 13:11
  • 1
    \$\begingroup\$ It is unclear how the mux is connected in the actual setup. The amount and quality of wiring can also make a difference, but so does lack of bypass caps and any termination. If you want to know where and how the signal goes wrong, you need an oscilloscope to see the signal waveforms. \$\endgroup\$
    – Justme
    Commented Jan 26, 2022 at 13:16
  • \$\begingroup\$ @Justme I have added a PCB image. The footprint is not the same (8 vs 6) and the pad step is not the same, but I didn't find nothing for this. Sorry for multithreading, but I would like other opinions, I have though about Analog Discovery 2, is this a good option? Or better one dedicated oscilloscope? \$\endgroup\$
    – Juanma
    Commented Jan 26, 2022 at 14:13
  • \$\begingroup\$ The picture of a PCB does not show how all your boards and LED strips and power supplies are wired together. Please post a photo of your prototype which shows connections between different modules and PCBs etc. It makes a difference if wires are 10cm or 1 meter and what kind of cables/wires are used. \$\endgroup\$
    – Justme
    Commented Jan 26, 2022 at 14:57

1 Answer 1

3
\$\begingroup\$

WS2812B requires 5V logic levels.

74LVC1G157 is 5V tolerant, so it will accept 5V logic levels when powered from 3V3. However if it is powered from 5V in order to output the 5V level required by WS2812B, then it also requires 5V levels on its inputs.

In addition there is no decoupling cap on the module.

So I'm betting on 74LVC1G157 being somewhat able to process the Pi's 3V3 logic levels, that would work depending on luck. Sometimes yes, sometimes no. If that's the problem, then you need voltage translation between 3V3 and 5V. You can do that with a 74HCT buffer or logic gate powered from 5V. Or just replace the LVC mux by a HCT mux.

The lack of decoupling cap means its local power supply will collapse and ring when driving the wire. You can simply solder a decoupling cap on the back of the module, between VCC and GND pins. The usual 100nF should work fine.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ All the components are powered by 5V (except WS2812B output), it should be that the problem. I will try all the options, thank you so much. \$\endgroup\$
    – Juanma
    Commented Jan 26, 2022 at 13:12
  • \$\begingroup\$ @Juanma The internals of the RPI are 3.3V and the RPI's gpio are not 5V tolerant! \$\endgroup\$
    – Jeroen3
    Commented Jan 27, 2022 at 8:27
  • \$\begingroup\$ @Juanma I think the lack of decoupling cap weighs much heavier. This is LVC, not HC. It is fast. When a switch occurs, the slight available charge will be immediately consumed, bringing the supply voltage essentially down to half (assuming the power lead and output lead have the same approximate shape. So there is a strong chance for erratic behavior or even momentary power-down when the output is commanded high. \$\endgroup\$
    – tobalt
    Commented Jan 27, 2022 at 8:28
  • \$\begingroup\$ @bobflux Shouldn't a 3.3V signal reliably qualify as "HI" on a 5V CMOS logic IC ? \$\endgroup\$
    – tobalt
    Commented Jan 27, 2022 at 8:33
  • 2
    \$\begingroup\$ @tobalt 5V CMOS Vih is 0.7xVCC so 3.5V, so 3V3 is not supposed to work. Most of the time it kinda works because Vih is a maximum spec, so the real chip will have a bit lower Vih, so 3V3 will be taken in as HIGH. But it's not guaranteed, it'll depend on temperature, and there is no noise margin at all... if you use HCT powered from 5V, it guarantees 2V on the input is read as high, so it'll work with 3V3 levels. \$\endgroup\$
    – bobflux
    Commented Jan 27, 2022 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.