[Resolved] Photon WS2812B project fickers crazily, unless I'm part of the circuit?

I’m picking up a Photon/WS2812B project that I’ve neglected for a few months, and having issues that I hope someone can help with. I’m not much an electronics guy, so it’s probably something silly.

I have a Photon running a short length of 43 WS2812Bs. For now its just a test pattern using the Neopixel library (although I’ve tried FastLED as well). My super professional test setup looks like this: http://i.imgur.com/zh7HgpK.jpg . Pretty simple. Data is connected with a long spliced wire to D3, have a tiny cap on the power because thats a good idea apparently, and a resistor from D3 to nothing (I’ll get to that). The button isn’t anything.

If I run it as is, most of the time it flickers and the colors are wrong, like this: https://gfycat.com/FormalMelodicFallowdeer

If I hold the data line at the splice point, it works great: https://gfycat.com/TestyThunderousBass

There is a splice because I’m going to need the data line to be a foot or two long, and I’ve been testing longer distances.

The resistor is because it’s supposed to be a good idea to put a small resistor on the data line, but if I use it the lights dont change at all.

So, any thoughts on whats wrong, and how I can fix it?

Is the data cable soldered or simply twisted?

I would recommended connecting the data line ditectly to the photon and see if it works well first.

1 Like

Do you use an external antenna? Can’t see it from the picture but I do see a coaxial cable. If we are TX-ing on WiFi there could be RF energy coupling into the dataline. Have you tried moving your dataline away from the coaxial cable

The data cable splice is simply twisted. It’s soldered to the led strip and connected to the breadboard on the Photon side. When connecting the soldered data line directly to the breadboard it works fine (although not through the resistor) but it’s only a few inches long.

Yeah, there is an external wifi antenna just out of frame. I’ll do some experimenting, but so far this has happened in whatever configuration the parts happen to fall when I’m setting it up. Would me holding the splice point somehow “block” the wifi interference? Maybe I should see if I can dig up a shielded cable for data?

Once it booted I disconnected the wifi antenna, and there was no change. Hm.

You having it working by pressing on the meeting point of two cables tells me that the connection is causing the issue.

Try soldering them together and see what happens?

I quick gave it a shot, but no luck. I’m just resting my fingers on it (not really pinching), especially now that it’s soldered, so I’m not sure I’m helping the mechanical connection.

I have more LEDs that dont have a connector soldered on already. Later I may try soldering long wires to those to remove the splice from the equation, and see how that goes. I’m not optimistic though

I had a similar problem a while ago – I was using a Teensy 3.1 instead of a Photon but both are 3.3V devices.

Some batches of the WS2812 in general and the WS2812Bs in particular are very sensitive to voltage on the data line; they’re 5V devices and 3.3V should be readable a “1” but it’s right at the threshold of what they want; the result is the line noise flickering like you describe.

The solution for me was to add a 3.3V->5V level shifter between the GPIO pin and the 1st WS2812 data in pin. You can use a 74HCT245; even though you’ll only need 1 of its 8 control lines they’re cheap. You can also use a 74LV1T125 but it’s not available in through-hole form factor.

More information on this problem:

https://www.pjrc.com/teensy/td_libs_OctoWS2811.html
https://forums.adafruit.com/viewtopic.php?f=47&t=48908&p=246902#p246902

I hope this helps.

1 Like

Ooh, thanks, that sounds promising. I’ve ordered a few, and I’ll report back with the results!

Just wired up a 74HCT245, and it’s working like a champ so far. Thanks again!

3 Likes

if it’s a small strip just connect it to the 3.3v pin

He had/has it on Vin, which is actually a better idea than 3.3V, but that wasn’t the issue to begin with. The neopixels are supposed to work with a 5V data signal, so it got finicky when it only got 3.3V which is on the edge.

1 Like

Yeah I know, but if the strip is small say 14 led then it can be powered via 3.3 the problem/flickering comes when the strip has 5v power and 3v data but if it all runs on 3.3 it works pretty well.

You might also be able to power it from a flux capacitor, and that might work, but it’s not the way it’s intended to be used. Though your suggestion might work, portraying it like its the actual solution rather than a ‘lucky hack’ is perhaps not the best idea. Even more Sketchy is the “if it’s a small strip” part. Without actual numbers, you might easily go over the rated values and risk damaging your hardware. If you’re going to make suggestions like that, then please make it clear what the restrictions are and state the fact that it might not work, considering it’s not the specified way of operation for said items.
Hooking it up to 5V and controlling it with 3.3V is also working pretty well for me, but obviously not for the OP. Using the product like its supposed to be used is then the best suggestion, in my opinion.

The link below has a good technical explanation of why powering a 5V WS2812B LED strand doesn’t always work with 3.3V logic. The reason is the WS1812 design recommendation is 70% of the supply voltage for logic high, so 70% of 5.0V is 3.5V, and 3.3V isn’t quite enough. But if you’re powering everything with a 3.7V LiPo battery, then 3.3V is enough. And often you can get away with being out of spec, but sometimes not.

Thanks for the specs I have been working on this project https://github.com/JeanPierreFig/SunRiseLamp and I was able to use ws2812b strip just 14 led from the 3.3v pin and D0 for data

Hi Moors7 I never said that it was the solution to the problem and I do agree that the correct solution for the task at hand is to get a logic lever chip to convert the 3.3v to 5v data line, but I did find that with my strips that if I keepe everything at 3.3v it worked. Like I said I never suggested that was the solution to this problem and if it seemed like I did I apologized for that.

2 Likes