Neopixel (WS2812) protection

1,704 views
Skip to first unread message

Toby Corkindale

unread,
Jan 28, 2014, 7:45:23 PM1/28/14
to Hackerspace Melbourne
Hi,
Looks like I need to learn a bit more about Neopixels.
The first neopixel in a 5m strip died.. I'd guess at around 30 hours
of operation. I haven't had that happen before, but previous projects
have been less ambitious.

Power seemed to get through, but not the important data line, so
effectively killing the whole strip. Removing the single LED at the
start of the strip, and re-attaching the connector to the next
neopixel sorted things out, but that wasn't an operation you want to
be doing in the field. (Literally - I was camping at the rainbow
serpent festival for five days)

I gather the WS2812 chips are fairly delicate?
I wondered what advice you'd give to try and protect them?

As it stands, I had a ~400R resistor on the data line (at the
microcontroller end of the cable) and a 1000µF cap between the power
lines (at the start of the strip end of the cable). The cable was
about two metres long.

A friend recommended a zener diode to prevent voltage spikes, and
using shielded cable for the data line, which sounds like good advice,
but I thought I'd check in here for your best practices?

Thanks in advance,
Toby

Luke Weston

unread,
Jan 28, 2014, 9:20:38 PM1/28/14
to connected-commu...@googlegroups.com
The first thing that's good to do is to have a look at the datasheet.

http://www.adafruit.com/datasheets/WS2812.pdf

It's a bit towards the crap end of the spectrum in terms of relative quality of datasheets from different manufacturers, but still basically usable.

Let's pick out some of the main points of information for safe hardware construction:

- The absolute maximum voltage on Vcc, and Vdd, is 7 volts, but a typical operating environment is 5V.

- Vi, which I assume is the absolute maximum rating of the voltage on the data input, is Vdd + 0.5V, so that should be fine to work with.

- In their example reference schematic, Vdd (the LED power supply rail) is connected to the +5V supply directly, but Vcc (the power supply to the control circuit) is not connected directly to the 5V supply, it's isolated and filtered a bit, derived from the main 5V rail through a 150 ohm resistor and then an 0.1uF cap to ground.

Bulk capacitance at one or two points along the 5V main rail along the LED strip, for a large LED strip, is probably not a bad idea.

I wouldn't expect it to be a particularly delicate chip, no more and no less than any other common digital chip really.

Now, you probably don't have just WS2812 modules by themselves - you probably have some strip or LED board from some other vendor, so just the WS2812 datasheet doesn't give you complete information. So what you probably need to do is track down a datasheet or information on this product from its manufacturer, if possible, so you can see how the WS2812 modules are wired up in a circuit, and what other components are included in that system, to see how you need to interface to that circuit and what you might need to add.

If you look at some of the Adafruit stuff, for example - http://www.adafruit.com/images/large/1586top_LRG.jpg

You will see they have one capacitor next to every LED module, let's say 100nF, this is good practice. But they've left out the resistor, it looks like they're just tying both power rails straight together.

If there's a problem with your data, timing, software, microcontroller etc, well, it probably won't display the way you want it to - but it won't damage the hardware either.

Also remember an appropriate power budget - assume max. 20mA per LED, so if you've got R+G+B full throttle on all the time (worst case assumption) say 60mA per LED module, so if you've got say 100 modules then your power supply will need to reliably supply 6A at 5V.

and if you're supplying 5V to a 6A load from a 5V power supply and many meters of wire you might need to watch your voltage drop in the wires too. Let's suppose you've got a 6A LED load, a 5V power supply, a 2 meter power cable, and the minimum acceptable voltage for the LED controllers to operate properly is 4.5V. The maximum acceptable cable resistance is 83 milliohms (0.5V / 6A). If the "5V" power supply is not actually well regulated 5V and it's really a little lower than the acceptable resistance will be lower still.

The "round trip" length of a 2 meter cable is 4 meters, so the maximum acceptable cable resistance is about 20 milliohms per meter.

If the wire vendor doesn't provide product data like resistance, you can look up typical estimated values for copper wire if you know the gauge (eg. AWG or whatever other systems are used) and you find that you need at least 18 AWG wire or lower (i.e. thicker wire = lower gauge) to meet the example values I picked above.

Remember that there is also some voltage drop as you go along inside the LED strip itself too, if it's a long one. The internal conductors will not be particularly thick. In some cases connecting power supply cables to both ends of the strip may be a useful technique.

Regards,
  Luke



--
You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to connected-community-h...@googlegroups.com.
To post to this group, send an email to connected-commu...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/connected-community-hackerspace/CABEgq97hif%2BBjs4VAxamDDUokTMDXOiLPjnE7HoY%3DKYjmaSNbA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
This email is intended only for the personal and confidential use of the human(s) named above. If intercepted by an extraterrestrial civilization, all opinions expressed in this email are my own and do not necessarily reflect the opinion of mankind as a whole.

Toby Corkindale

unread,
Jan 28, 2014, 9:58:13 PM1/28/14
to Hackerspace Melbourne
Hi Luke,
I think I discussed some of those elements recently. For instance, I
moved the 5V DC-DC converters right up to the start of the strip (to
avoid voltage sag on potentially long power runs). The same type of
converter runs the arduino nano running the affair, but elsewhere, so
there's potentially some voltage sag on the cable carrying the data
line over several metres. (But it seemed alright when I measured it at
the end.. It's only thin wire, but it's only carrying a few milliamps
of current)

You mentioned their spec added a 0.1µF cap between the data and ground
line; was that before or after the data line gets controlled? And if
after -- I guess I'd need to match the cap to the current on the data
line too? (I think I'm using a 350 ohm resistor, whereas you mentioned
the spec's data line had a 150R)

Cheers,
Toby
> https://groups.google.com/d/msgid/connected-community-hackerspace/CAEPooQEuRvh-kdpOJnM%3DsRH7rYAXCa%2B3PdtLmtRBGQBj2-Qkfg%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Turning and turning in the widening gyre
The falcon cannot hear the falconer
Things fall apart; the center cannot hold
Mere anarchy is loosed upon the world

Luke Weston

unread,
Jan 28, 2014, 10:28:16 PM1/28/14
to connected-commu...@googlegroups.com
I mean a capacitor on the power rail, not the data line.

You may need to think about impedance matching, termination, reflection and other transmission line effects on a long data line pushing digital data at very fast speeds, and those issues like termination might cause you to put resistors or other components on the data line, but I think it's probably not an issue in this case and you can leave the data lines alone

Cheers,
Luke
> To view this discussion on the web, visit https://groups.google.com/d/msgid/connected-community-hackerspace/CABEgq97%3D-yPkT3PTJHor6%3DiD19xuyxv5tUYocqzAiLCvRH7KOA%40mail.gmail.com.

Toby Corkindale

unread,
Jan 28, 2014, 10:36:40 PM1/28/14
to Hackerspace Melbourne
On 29 January 2014 14:28, Luke Weston <reindeer...@gmail.com> wrote:
> I mean a capacitor on the power rail, not the data line.
>
> You may need to think about impedance matching, termination, reflection and other transmission line effects on a long data line pushing digital data at very fast speeds, and those issues like termination might cause you to put resistors or other components on the data line, but I think it's probably not an issue in this case and you can leave the data lines alone

Hmm, OK. So, what can I do to avoid killing the first LED controller
in the strip next time?
What did you think of my friend's suggestion to put a zener in to act
as a voltage regulator in case of voltage spikes on the line? (Not
that I know how spikes would appear on it)
> To view this discussion on the web, visit https://groups.google.com/d/msgid/connected-community-hackerspace/8FF0B2B8-171C-46D2-8CE2-103C30B84E79%40gmail.com.

Andy Gelme

unread,
Jan 28, 2014, 11:27:06 PM1/28/14
to connected-commu...@googlegroups.com
hi Toby,

On 2014-01-29 11:45 , Toby Corkindale wrote:
> I gather the WS2812 chips are fairly delicate ?

There is nothing specifically delicate about the WS2812B LEDs.

The main thing to watch out for when running many hundreds of WS2812B
LEDs is that there is a lot of current involved, e.g for a 150 LED strip
running flat out ... you can be playing with between 6 to 9 Amps @ 5 VDC
(assuming you are using an appropriately rated power supply).

If you are in a "rough" environment, e.g camping, then any mechanical
movement / instability may cause wires to be shorted out ... and then
either your microcontroller or some LEDs somewhere along the strip
(often near the start) will receive the brunt of that large current and
fail immediately.

When using that amount of current ... a fuse close to your power supply
would be a good idea and ensure that all terminals and connectors are
secure enough. Use thick cable (large copper cross-section) for
anything carrying

--
-O- cheers = /\ /\/ /) `/ =
--O -- http://www.geekscape.org --
OOO -- an...@geekscape.org -- http://twitter.com/geekscape --

Toby Corkindale

unread,
Jan 29, 2014, 12:47:12 AM1/29/14
to Hackerspace Melbourne
Hi Andy,

On 29 January 2014 15:27, Andy Gelme <an...@geekscape.org> wrote:
> On 2014-01-29 11:45 , Toby Corkindale wrote:
>> I gather the WS2812 chips are fairly delicate ?
>
> There is nothing specifically delicate about the WS2812B LEDs.
>
> The main thing to watch out for when running many hundreds of WS2812B
> LEDs is that there is a lot of current involved, e.g for a 150 LED strip
> running flat out ... you can be playing with between 6 to 9 Amps @ 5 VDC
> (assuming you are using an appropriately rated power supply).

*nods*
In this case, a 3A @ 5V power supply per 150 LED strip, with those 12V
cables coming back to a (singly) fused power source.
As I mentioned in a previous thread, part of the challenge was to
design patterns that kept the power envelope well within the rating of
the power supply. In this case, I went for a max of 2A @ 5V so as to
have quite a bit of headroom on the rated supply.

> If you are in a "rough" environment, e.g camping, then any mechanical
> movement / instability may cause wires to be shorted out ... and then
> either your microcontroller or some LEDs somewhere along the strip
> (often near the start) will receive the brunt of that large current and
> fail immediately.

I tried quite hard to set things up so as to avoid wires being able to
short out, but it'd still be possible if moisture/condensation managed
to build up on or inside the connectors. (They were just 3-pin JST
type, with electrical tape wrapping them.) The setup survived a very
long, heavy shower on the first night, so I thought it'd be fine if it
made it through that! I guess moisture can make its way in easier than
big water droplets though.

> When using that amount of current ... a fuse close to your power supply
> would be a good idea and ensure that all terminals and connectors are
> secure enough. Use thick cable (large copper cross-section) for
> anything carrying

Would a fuse have helped if the data line was shorted to 5V? I mean,
given the relatively high max draw of the LEDs, vs whatever the
damaging level of current is when applied to the data line?


Thanks for continuing advice!
-Toby

tubular

unread,
Jan 29, 2014, 6:19:26 AM1/29/14
to connected-commu...@googlegroups.com
Toby, I've found them very reliable, but I've heard of others continually burning out the first led.  The 'B' version maybe a bit more robust as these add reverse polarity protection, but that's probably not the issue here.  You can always put a 'B' led first (on a 1 segment flex pcb) since the protocol is the same.  

I'd focus efforts on that initial data line.  Zeners at such a low voltage level have a pretty weak 'knee' and don't really clamp as hard or fast as anyone would like.  You could try doing what they do for ESD protection and put a reverse biased signal diode from data in to both power rails. plus terminate data in to ground (you've done this I believe).

How long is the cabling from your micro to the first led?  I've run 2m fine but not yet tried longer.  Also you should run two ground wires to the start of the ribbon - one for your incoming supply and one for your micro circuit (ie 'star' power topology with the node being the start of the ribbon

And you mention a dc/dc converter, what are you using?  Are you driving with relatively sudden light changes or would current draw be relatively constant (fades etc)? 


regards
Lachlan 

tubular

unread,
Feb 5, 2014, 10:51:24 PM2/5/14
to connected-commu...@googlegroups.com
Toby, the other thing I forgot to say, is I think we have spares to replace whatever went faulty - WS2812's, WS2812B's, WS2811 in SOIC, WS2811 in DIP... etc.  

Toby Corkindale

unread,
Feb 6, 2014, 1:30:32 AM2/6/14
to Hackerspace Melbourne
Hi Lachlan,
My apologies, I thought I'd replied to this email previously.

The version that went pop was running a 12-->5 volt DC-DC converter;
CPT brand from ebay.
I was actually running multiples of them - one per strip plus one for
the microcontroller. (All fed back to a common 12V power source
though)
I don't know if that was a bad thing to do or not? They all had a
common earth, but on the 12V side, not the 5V side.

The actual load was fairly constant; I don't have my notes in front of
me to check, but I think roughly 1.2amps, and varied by up to 20-30%
depending on the pattern, but with smooth/gradual increase and
decrease.

I was running two metres of cable from the microcontroller to the
start of the strip. It was just unshielded boring hook-up wire, but I
figured the voltage drop wouldn't be noticeable, and it didn't need to
carry more than 10mA.

On 29 January 2014 22:19, tubular <lac...@tubularcontrols.com> wrote:
> Toby, I've found them very reliable, but I've heard of others continually
> burning out the first led. The 'B' version maybe a bit more robust as these
> add reverse polarity protection, but that's probably not the issue here.
> You can always put a 'B' led first (on a 1 segment flex pcb) since the
> protocol is the same.
>
> I'd focus efforts on that initial data line. Zeners at such a low voltage
> level have a pretty weak 'knee' and don't really clamp as hard or fast as
> anyone would like. You could try doing what they do for ESD protection and
> put a reverse biased signal diode from data in to both power rails. plus
> terminate data in to ground (you've done this I believe).
>
> How long is the cabling from your micro to the first led? I've run 2m fine
> but not yet tried longer. Also you should run two ground wires to the start
> of the ribbon - one for your incoming supply and one for your micro circuit
> (ie 'star' power topology with the node being the start of the ribbon
>
> And you mention a dc/dc converter, what are you using? Are you driving with
> relatively sudden light changes or would current draw be relatively constant
> (fades etc)?

Thanks again for you advice.
At the moment I have cut off the dead neopixel and soldered the JST
plug onto the next one in line; I'll implement suggestions and then
leave it running for a few days to see if it dies again, or not.

I did purchase the strips from a cheap ebay seller, so it's entirely
plausible that they're just not very good! Hard to know though.

Toby

Stuart Young

unread,
Feb 6, 2014, 2:46:58 AM2/6/14
to CCHS
Do those converters have a common earth between the 12V and the 5V side?

I've seen some where the +12V on one side is common with the +5V on the other, so from the ground on one side to the ground on the other there is a difference of 7V.

If you're expecting the ground to be common between the input and output, this can be a real pain.

Note: I've run into this a few times with cheap converters going from 24V down to 12V (or 5V) before.




Toby

--
You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to connected-community-h...@googlegroups.com.
To post to this group, send an email to connected-commu...@googlegroups.com.




--
Stuart Young (aka Cefiar)
Reply all
Reply to author
Forward
0 new messages