Strange behavior of WS2816 LEDs---very long reset time (4-5 ms) required - Page 1
Forum section: electronics / projects

author: mark03
author_rank: Frequent Contributor
timestamp: May 28, 2024, 07:17:43 pm
content: I'm really scratching my head on this one and hoping that another forum member has played with WS2816s and can compare notes.I designed a custom PCB with 128 of these RGB LEDs for a course in embedded systems that I teach. All of the driving logic and software is fully custom and bare metal to give students a chance to use timers, DMA, etc. The LEDs are arranged as 8 parallel strings of 16. I *thought* all was well when I was able to get nice color gradient patterns, animations, and so on, but I have run into problems trying to update the LEDs more frequently than every ~ 5 ms.I have carefully scoped out the signals going into each string, as well as the inter-LED data within a string. Everything is exactly as it should be, with stable and proper timing and good signal integrity. When I try to update the LEDs more quickly, I am not changing anything whatsoever about the bit timing; all I am doing is to send updates more frequently by reducing the "reset" interval. The datasheet has this at 280 us minimum, but my LEDs seem to randomly stop updating whenever the reset is less than about 5000 us!When the LEDs stop working, it is random and gradual. Each LED either updates to the new RGB data when it should (with probability p) or keeps its old RGB data (with probability 1-p), on each update. As I reduce the reset time past ~ 5000 us, "p" starts to drop, and by the time I get to reset times of 1000-2000 us, p is well below 0.5. Crucially, while this happening, all of the serial waveforms, both going into the string, *and inter-LED*, remain textbook-perfect. There is also no pattern in terms of location within a string; LEDs at the head or the tail are equally likely to have failed updates. So I am 99% sure this is not a bit-timing or signal-integrity issue.The LEDs were sourced by JLCPCB---I used their assembly service.Has anyone used WS2816s, and did you try updating them at a rate which could contradict my findings?Thanks.

author: NiHaoMike
author_rank: Super Contributor
timestamp: May 29, 2024, 04:37:23 am
content: If the control logic is 3.3V, are you properly level translating that to 5V? Those LEDs may work with 3.3V signals but get quite flaky.Other than that, I would suspect the LEDs are poorly designed clones.

author: mark03
author_rank: Frequent Contributor
timestamp: May 31, 2024, 04:19:52 pm
content: The LEDs and driving logic are powered by a Li-ion battery, so around 3.8-4 V when fresh. Inputs to that logic are 3.3V from the microcontroller, so everything meets the datasheet requirements. I did try powering the LEDs from a variable DC power supply and noted no significant difference over the range of 3 to 5 volts. They actually worked about as well below 3V except for a color shift! So I'm pretty sure that isn't the problem.It seems there is an aura of mystery behind the WS28xx LEDs, in terms of production, responsibility, repeatability, and so on. Guess I should have gone with APAxxx or something else. This was my first JLCPCB assembly order and they had a bunch of the WS2816B on hand for an unbeatable price; perhaps this is why :/

author: nctnico
author_rank: Super Contributor
timestamp: May 31, 2024, 04:35:09 pm
content: How is the power supply decoupling? I'd recommend using a 100nf capacitor for each LED and 10uf bulk for each string. Also, the operation of the WS2816 can get iffy below 3.7V. I wouldn't run these devices on a lower supply voltage than 4V.

author: mark03
author_rank: Frequent Contributor
timestamp: May 31, 2024, 07:38:05 pm
content: Quote from: nctnico on May 31, 2024, 04:35:09 pmThere is 100 nF decoupling on each LED despite the datasheet's insistence that it is not requiredNo bulk decoupling but in aggregate that's already 12.8 uF. They are running very close to 4V.I wish one of those factors could explain the observed problems but it seems highly unlikely.

author: nctnico
author_rank: Super Contributor
timestamp: May 31, 2024, 08:11:22 pm
content: Quote from: mark03 on May 31, 2024, 07:38:05 pmI'd test the board using a power supply set at 4.4V and with a 1000uf electrolytic across the power supply just to rule out your problem is caused by a power supply issue. It is very possible the reset time is supply voltage dependant. The datasheet of the WS2816 based LEDs I have used in a project say the minimum voltage is 4V. And usually for cheap parts, this is the bare minimum so the minimum voltage must be met even when the supply rail drops due to load variations.

author: mark03
author_rank: Frequent Contributor
timestamp: May 31, 2024, 10:00:34 pm
content: Quote from: nctnico on May 31, 2024, 08:11:22 pmReferring up-thread, you will see that this has already been tried---minus the 1000 uF capacitor. It's not clear to me what you think a bunch of bulk capacitance would accomplish? There is no evident voltage sag on the LED rail during/after updates.BTW my datasheet says 3.7 to 5 volts, so go figure.

author: nctnico
author_rank: Super Contributor
timestamp: June 01, 2024, 10:23:50 am
content: Far fetched idea: what if you end with one entire cycle high and make the data line low after that. Other than that, I'm out of ideas.

author: mark03
author_rank: Frequent Contributor
timestamp: June 02, 2024, 03:26:36 pm
content: Quote from: nctnico on June 01, 2024, 10:23:50 amBy "one cycle" do you mean one bit period (1.25 us), or longer? Should be easy to try.

author: nctnico
author_rank: Super Contributor
timestamp: June 02, 2024, 05:58:09 pm
content: Quote from: mark03 on June 02, 2024, 03:26:36 pmYes. At least 1 bit period. But it is a far fetched idea...