WS2812D Question

I have a need for a 24 pixel string on a fully committed Nano. It occurs to me that D13 is underutilized, because I only use it for status/error signaling. Could anyone intimately familiar with the WS2812 LEDs tell me if the following seems feasible:

  1. D13 is set/reset as needed in loop() or subsidiary code for signaling.
  2. The pixel string will be connected to D13 as well, with the usual 330 ohm resistor. The Pixel string will have it's own 'reservoir' capacitor and power supply.
  3. the update to the pixel string will store the present state of D13, transmit the data for the LEDs, and restore D13's state.
    https://www.tme.eu/Document/6ea29838e05beac06400c47a846319d2/WS2812D-F5.pdf

I see nothing in the TME datasheet, such as it is, that indicates to me that the pixel string will be confused by a prolonged high or low on the data pin, outside of the data update timing restrictions; certainly, clearly, I will have to provide the required minimum low time for 'reset' prior to sending the data, but other than that, I don't see clear indication that prolonged high time, or very long period low-high cycles, would be a problem.

And yes, I fully expect to write my own code for driving the pixels in order to achieve this. Already did that once, just need to dust it off.

Comments?

Does it matter that D13 has a resistor in series with LED_BUILTIN?

No, but on the other hand, perhaps it's good to take some insurance and throw in a GPIO expander somewhere.

It shouldn't(but I've not tried it). Iin is 1uA, so it's not heavily loading D13.
The Arduino output just drives 1k to the LED to GND, so at most ~3 mA load there.

Well, it's a home project, so I won't have a boss breathing down my neck... I still have A4/A5 on a header, so if needed, but I'd rather not. I think I'm just going to go ahead and test it out. Everything I'm seeing says if I can stand the blinky it might cause, just go ahead.

If there's plenty of flexibility in the project anyway, it's worth a shot. Please post back and tell us if it worked! I suspect you're right and the WS chips will ignore the constant high/low level.

1 Like

I just don't want to tie up one of A4/A5 if I don't have to. Round 2 will probably involve a 23017, so I'm holding off. I have another ace up my sleeve, but again I'd rather keep that one hidden, too.
Thanks, I'll try to remember to wrap this up. It'll likely be a showcase or something, the way it's evolving.

Why do not add a one more W2812 led to the string and not use it for @signalling@ purpose?

I believe this will cause interference on the led string. Don't forget the noise.
Anyway, I would be interesting to know the result.

Because the string can be there, or not, but the diagnostic must still work. I'll update when the test happens, likely Sunday.

That doesn't always follow. :expressionless:

This may be of interest

a7

Thanks for that, it's a good read. However it plays out, I'll post back. Since what I want is the ability to blink the onboard LED in cycles a human can distinguish, the timescales are hugely different. Blinking the LED on 4 times 200 ms, then dark for a second sort of thing. However, I also have the option of 'overloading' the function of the pixel string itself. Since the pixels normally display GREEN, RED, YELLOW, BLUE, DARK, DIMWHITE, I could simply choose an unusual colour to indicate my error conditions; an annoying hue of pink might do. So, we'll see how it goes.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.