WS2812B LED strip controller circuit protection?  - Page 1
Forum section: electronics / general

author: DanHamer
author_rank: Contributor
timestamp: May 18, 2015, 01:10:12 pm
content: WS2812B LED strip controller circuit protection?Hi all,I'm developing a compact Arduino compatible WS2812b LED strip controller. Here is the schematic so far:One aspect I'm still agonising over is whether or not to include any circuit protection or voltage regulation.I need to keep the form factor minimal.The LED strips already run on a 5V supply.Each LED has its own capacitor.I need to supply the ATMega328P 5V so I can run it at 16MHz.I'm considering just connecting it straight to the 5V rail with no protection seeing as the PSU is likely to be a switch mode wall wart.I'd appreciate anyone's opinion and input.I used Ragworm to make the first prototype. Here's a review I did of there service that might also be of interest and shed more light on what I'm trying to achieve.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 18, 2015, 05:33:54 pm
content: The least you can do is fit ESD/clamping diodes to the in/outputs of the board.Maybe separate the power domain of the MCU from the LED's with a series diode and some caps to prevent glitches when changing the LED's to interfere with the mcu, a low drop diode should still give you 4.5V (worst case) as Vdd for the mcu, which should be enough.If you're running long strips, and you want short circuit protection you can use several options.Either use smart high side drivers. These are quite rare for 5V, but they exist. Nice thing is they often feature overload shutdown and feedback. And are difficult to destroy by (non-exorbitant) overcurrent. Such as (random few) BTS441, VN5050J, ITS428. Resonably expensive per chip, but safe because it is targeted for automotive since everything in a car is high side switched due to negative being chassis.Other solution is to use an high side sensing shunt and the comparator in the mcu. Maybe even use a sensing IC from allegro.You will need a high side switch with that to turn off when a fault occures. And I do not think this will fit your current formfactor and price.The most simple solution is an on-board fuse or polyfuse. The most appropriate solution depends on capabilities of the power supply.Mikeselectricstuff recently published a video about LED dimmers.

author: tom66
author_rank: Super Contributor
timestamp: May 18, 2015, 08:48:20 pm
content: I've been playing a lot with WS2812Bs.The only real problem with them is how sensitive the input is to noise. Especially from 3V3 logic. If you do a lot of cabling or use more than about 5.2V at the strip you will require a level shifter. Looks like you're using a 5V MCU so you should be OK. But...Also, while I found the LEDs would tend to frequency-lock with each other (a very useful oddity) they can sometimes drift between two frequencies, especially as they warm up. This won't be too much of a problem, but take into account that your power supply may have to deal with suddenly changing loads - potentially several amps. How will your MCU cope with the noise on the supply rail? If I were you I would run the MCU on a regulated rail, rather than directly off the LED supply.

author: Ribster
author_rank: Frequent Contributor
timestamp: May 20, 2015, 10:04:02 am
content: I can second the troubles the WS2812B has with 3V3 logic. Used a simple level shifter using a BSS138 logic level mosfet with intermittend results.Using 2 BSS138 mosfets as a split supply level shifter, this was much much better. When i dropped the supply voltage, it did make things better.Nasty little buggers they are, for sure.

author: DanHamer
author_rank: Contributor
timestamp: May 23, 2015, 04:43:47 pm
content: Thanks for your replies. I was trying to avoid using a regulator to keep the size and cost down and to avoid any voltage drop. However I found a regulator that might do the job. It has very low dropout and it comes in a SOT323 package. What do you guys think?http://www.st.com/web/en/resource/technical/document/datasheet/DM00109416.pdfThe data sheet says it has a drop out of 100mV but Ive tested one and in my application it seems to be even lower than that, even when the input starts to go below 5V.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 23, 2015, 08:48:05 pm
content: You shouldn't power the LED strips through a linear regulator. Especially not such a small one.Powering the control IC might prevent glitches in the chip. But you can use a simple diode and (10uF) capacitor to branch from the main rail to solve most issues if your supply rail is 5v regulated.Remember when using 5V, a logic high is >3.5 and a logic low is <1.5 Volts with 0.35 hysteresis. According to the WorldSemi datasheet.

author: tom66
author_rank: Super Contributor
timestamp: May 26, 2015, 07:11:13 pm
content: Quote from: DanHamer on May 23, 2015, 04:43:47 pmThat's a fine regulator.Personally I use MCP1703 myself - it's cheap and stable with 1uF - Farnell have them at £0.45 ea.

author: Ribster
author_rank: Frequent Contributor
timestamp: May 30, 2015, 01:25:46 pm
content: Quote from: Jeroen3 on May 23, 2015, 08:48:05 pmI saw an implementation once, where they added a diode between 5V0 and the VCC pin of the first WS2812 led.That way the voltage on the first led was 4V4, and made the high levels in the range of 3v3. Never tested it tho.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 30, 2015, 07:59:39 pm
content: I wouldn't use those led's at all. They have an "asbolute maximum" Vdd rating of "somewhere between" 3.5 and 5.3 Volts.Isn't that exactly the range you'd be putting it in?But that datasheet translation aside, using a diode can work. But remember the forward voltage of the diode varies with the forward current. That might have negative effects on the luminosity.Since you'll be using 1 wire, a logic level converter can be made using 1 resistor with open drain mode on a 5 volt tolerant gpio.

author: Ribster
author_rank: Frequent Contributor
timestamp: May 31, 2015, 09:30:10 am
content: haha, that's a shitty datasheet indeed.. Oh well, low cost comes with a price.I was thinking about that. But the luminosity is relative to the current flowing through them.I think they are constant current drivers, so it wouldn't make a difference?And that is actually not a bad idea.. That way you don't have issues with level shifting. Best way to do it, you are right. I'm going to test it out!

author: Kean
author_rank: Unknown
timestamp: May 31, 2015, 02:35:15 pm
content: Dropping the LED supply voltage with a diode may cause you problems with the blue LED intensity depending on how many WS2812B's you have, and the voltage drop between them.e.g. over a few metres of strip at full brightness you may lose enough voltage to have the far end LED's light up pink instead of white.In addition - a few suggestions having built and sold products around these LED's:a) if your mcu is running at 3.3V, use something like a MC74VHC1GT50 buffer to level shift the data signal up to 5V. You really want a push/pull driver (not an open drain & pullup) to get signal integrity at that data rate.b) include a series resistor between the mcu/buffer and input to the first LED (100R is good) to reduce signal ringing and ESD, and a small capacitor can help too depending on the output drive of yur mcu/buffer. In addition, an RC network between LED's is generally needed for FCC compliance. I used 75R & 200pF to increase the rise/fall times and thus decrease harmonics. Most cheap strips won't have this and will will radiate lots of RF when doing fast LED animations.c) extra ESD protection such as a GSOT05 on that first LED - if its input gets damaged, the whole string fails. WS2812's used to have good ESD protection until they became popular and they decreased the inbuilt ESD diode surface area so as to get more chips per wafer. I've met with WorldSemi engineers about this following increased failure rates in the factory.

author: Ribster
author_rank: Frequent Contributor
timestamp: May 31, 2015, 07:11:48 pm
content: Quote from: Kean on May 31, 2015, 02:35:15 pmI'm just talking about the first LED. The rest in the chain is just at 5V0.Nice insight into your experience! Very valuable! Thank you

author: Christopher
author_rank: Frequent Contributor
timestamp: June 01, 2015, 07:45:40 pm
content: Quote from: Kean on May 31, 2015, 02:35:15 pmVery useful advice.I am toying around with the following:MCU -> 8xLED Strip -> 8xLED Strip -> 8xLED Strip -> 8xLED StripOn each LED strip PCB, should I include the following in this order? :-Parallel TVS Diode -> Series Line Driver -> Series 75R Resistor -> Parallel 200pF CapOr just at the output of the MCU then have a parallel TVS diode on each PCB?--Also, I am looking for these LEDs on a tape & reel from china. Anyone know of any good suppliers ? A quick search on Aliexpress & ebay only gives me "reels" of these LEDs already on PCBs. Not so useful!

author: Jeroen3
author_rank: Super Contributor
timestamp: June 01, 2015, 08:10:33 pm
content: If you buy thousand they're not coming loose in a bag, right?Googling "1000pcs ws2812b" got me at least 5 sellers, some amazon, some ebay, some aliexpress.

author: Ribster
author_rank: Frequent Contributor
timestamp: June 01, 2015, 10:16:49 pm
content: Quote from: Jeroen3 on June 01, 2015, 08:10:33 pmThey will come on a reel / tray.I've ordered 200 from ali, and they where rolled up in a tray.A student at my school ordered 1000 and got them in a tray/reel too..Edit: You can have a look at APA102 chips too.. They are synchronous, with higher PWM freq. If this is an advantage for you, is up to the configuration of your project. But worth the look..

author: DanHamer
author_rank: Contributor
timestamp: June 05, 2015, 12:41:09 pm
content: Just to clarify I intend to have to regulator to just power the mcu board and any expansion board. The WS2812 strip would be powered direct from the PSU. So the onus is on the user to ensure that the PSU is suitable for the length of the strip. My main concern was whether to just power the mcu directly from the same 5V rail as the strip or to use a regulator. It seams that the atmega328p is more tolerant than the strip. However I need to stabilize the mcu and expiation boards supply to reduce noise especially for things that involve audio (i.e a VU meter). This isn't the first time I've found myself questioning whether to use a Voltage regulator with an mcu. The consensuses seams to be divided. Some say you absolutely must have a regulator some say that a switch mode PSU has good enough regulation to run an mcu directly off it.I'm must have look at those APA102 chips they sound interesting. May be for ChromaTab2.

author: Gavin Melville
author_rank: Contributor
timestamp: June 27, 2015, 06:19:11 am
content: World semi will supply the Ws2812b directly, very easy to deal with.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: June 27, 2015, 06:58:04 am
content: Quote from: Jeroen3 on June 01, 2015, 08:10:33 pmBe wary of buying these LEDs from Aliexpress - a while ago we bought a couple of reels from Ray Wu, and we saw a high DOA rate - about 2-3%, and many of them had slightly cloudy looking windows.

author: metri
author_rank: Contributor
timestamp: September 02, 2015, 03:11:42 pm
content: This is a bit of an older thread, but I just came across it now. I made a generic controller for WS2812B LEDs and made a nice PCB. Maybe this design would help you in your project. I use an arduino Leonardo compatible board so it's easy to program. It doesn't have circuit protection, but you can add some. I am only running strips of 20 LEDs and never found I needed it. I also didn't fuse the USB port, but it has 8 outputs, 4 inputs, and it's very small. Power it from any input/output pin or by USB (for small strips only). You can get all the design files on my website. It's completely free, like free beer.http://brianmakesit.com/bmi-mini-leonardo-open-source/Let me know if you need any more information. I currently adding it to Github, but for now all files are available on my site.

author: DanHamer
author_rank: Contributor
timestamp: February 06, 2016, 03:47:03 pm
content: Just an update to this project. I decided in the end to include a LDK220 regulator as the whole system (when its connected to a WS2812B strip) runs fine with it. I really like this regulator as in the SOT323-5L package it is absolutely tiny and can still provide 200mA. This is a really useful amount of power to have on the microcontroller part of a system as it easily powers the micro and a number of other devices. I have bags of 100mA regulators and I often find when designing a circuits that I end up needing just a little bit more juice which can be a pain. Anyway I have completed this design and had a small run of them manufactured by Seeedstudio.I'd love to here peoples opinion of it. To check it out head on over to the ChromaTab page of my website. There you can find lots of info (schematic, firmware etc) available for download.http://carbonfrog.com/Products/CT101V1.html