Why are these best practices for using LED strips/rings (WS2812)

Hi,

I'm new to using the Adafruit Neopixel library and I can't seem to wrap my head around a few things that are written as best practices.

  • Add 1000 uF CAPACITOR between NeoPixel strip's + and - connections.
  • MINIMIZE WIRING LENGTH between microcontroller board and first pixel.
  • NeoPixel strip's DATA-IN should pass through a 300-500 OHM RESISTOR.
  • AVOID connecting NeoPixels on a LIVE CIRCUIT. If you must, ALWAYS connect GROUND (-) first, then +, then data.
  • When using a 3.3V microcontroller with a 5V-powered NeoPixel strip, a LOGIC-LEVEL CONVERTER on the data line is STRONGLY RECOMMENDED

I'm curious if anyone here knows why these are recommended. I'm also curious if not following these recommendations is the reason why my WS2812 24 bit stopped working all of a sudden. I was connecting it without a resistor or a capacitor to a live circuit (at least I think a live circuit means that my microcontroller is receiving power) with ground, plus and data connecting at the same time (since I haven't soldered it yet).

If my microcontroller is connected to my computer with a USB cord, and my LED's are connected to VIN, GND, and D13, are the LEDs getting the necessary 5V they need to operate, or do I need a logic-level converter?

The best practices can be seen here: Best Practices | Adafruit NeoPixel Überguide | Adafruit Learning System
I was using this WS2812 ring I bought off of eBay before it stopped working: https://ebay.to/3frVS8d

You may have killed only the first pixel. Cut that one away, resolder power, ground and data and connect the strip, as recommended. Use a proper power supply. The Vin pin is not a power output.

groundFungus:
You may have killed only the first pixel. Cut that one away, resolder power, ground and data and connect the strip, as recommended. Use a proper power supply. The Vin pin is not a power output.

I can't really cut these LEDs. You can check them out here: https://ebay.to/3frVS8d
They're soldered onto a hard material. Can't really cut it without breaking everything. If you check the eBay pictures, there are multiple Ground, Vin, and Data pins, do you know why that is?
Also due to project restrictions, it's pretty hard using a constant power supply, is there any way I can still power them only through my microcontroller's Vin pin? Because it works through that.

The back of the ring has Ground, Volts, Din on one side, and Ground, Volts Dout on the other.

If it has 24 LEDs, that's potentially 60mA each at full brightness, thats 1.56A, a normal Arduino can't support that.

You could try unsoldering the first one, and soldering in a replacement part.

Are you sure the IO pin on the microcontroller is still good?

  1. This helps prevent voltage loss along the length of the power supply line and prevents the signal line from picking up noise.

  2. This prevents any signal reflections on the line from corrupting the signal.

  3. You seem to have demonstrated that one yourself. Also power down before making wiring changes.

  4. Neopixel are 5V devices, 3.0V to 3.3V signals may not be read correctly.

Your ring appears to have a 0.1uF cap with every LED, so the 1000uF cap wouldn't seem as critical.
I did a project with 44 WS2182Bs, 0.1uF caps. No 1000uF cap, no resistors, 3 foot wires from Arduino to 4 rings, (data line for each), no problems.

Camera struggled with the brightness and pulsed brakes lights.

CrossRoads:
4. Neopixel are 5V devices, 3.0V to 3.3V signals may not be read correctly.

The datasheet for the WS2812 chip says a logic 1 minimum is 2.7V, so a 3.3v logic should (and does here) work just fine.

Hey, thanks so much for the extensive reply!

I did a project with 44 WS2182Bs, 0.1uF caps. No 1000uF cap, no resistors, 3 foot wires from Arduino to 4 rings, (data line for each), no problems.

So is it safe to assume from your comments that I don't have to connect a resistor to the DIN or a capacitor between VIN and GND?

I'm sure the IO on the microcontroller still works because I tested it with another LED that is exactly the same as this one!

  1. Neopixel are 5V devices, 3.0V to 3.3V signals may not be read correctly.

Does this mean that I should add a logic-level converter for DIN? Even though as SteveMann said, it works just fine, so I don't see a reason for adding it.

If it has 24 LEDs, that's potentially 60mA each at full brightness, thats 1.56A, a normal Arduino can't support that.

So is it still possible to power the LEDs with an ESP32 even though an ESP32 can't support those Amps? WIll it mean it'll kill the microcontroller or does it mean that it'll just shine less bright?

https://www.youtube.com/watch?v=CGOxbehyoM4

That's a really cool project!!

This is the project I'm attempting.
Do I have to power the LEDs with a 5V battery? And if yes, how would I go about charging the battery if the only hole in the lamp I have is intended for the micro USB?

You could try unsoldering the first one, and soldering in a replacement part.

I'll definitely try this, thanks!

When people say "Arduino can't support that" or similar, the point is that Arduinox or the WeMOS D1 Mini that you have - are not power supplies.

In particular, the on-board regulator has negligible heatsinking, so while it can support the microcontroller itself, it cannot support additional components powered through I/O pins or from the regulator output pin - "5V" for an Arduino, 3.3V for the WeMOS. (Note that more recent Arduino designs actually do have proper switchmode regulators capable of significant output. :grinning: )

Now the consideration of the relationship of the USB connector and the "5V" pin. On the Nano and WeMOS D1 Mini, this is a diode which is generally rated at 500 mA, so drawing double that current is asking for trouble. While it might be a convenience to use this because the 5 V supply has a mini or micro USB connector, the proper way is to use an adapter board to break out the 5 V power and connect that both to the board via its "5V" pin and the LED strip.

Paul__B:
When people say "Arduino can't support that" or similar, the point is that Arduinox or the WeMOS D1 Mini that you have - are not power supplies.

In particular, the on-board regulator has negligible heatsinking, so while it can support the microcontroller itself, it cannot support additional components powered through I/O pins or from the regulator output pin - "5V" for an Arduino, 3.3V for the WeMOS. (Note that more recent Arduino designs actually do have proper switchmode regulators capable of significant output. :grinning: )

Now the consideration of the relationship of the USB connector and the "5V" pin. On the Nano and WeMOS D1 Mini, this is a diode which is generally rated at 500 mA, so drawing double that current is asking for trouble. While it might be a convenience to use this because the 5 V supply has a mini or micro USB connector, the proper way is to use an adapter board to break out the 5 V power and connect that both to the board via its "5V" pin and the LED strip.

I didn't really specify which microcontroller I have. I have an ESP32-WROOM-32 chip on a DOIT ESP32 DEVKIT V1. I'm not sure if this changes your answer since that is not a WeMOS D1 or an Arduino for that matter.

So is it safe to assume that If I buy an adapter board and put a USB connected to a computer in it, then solder the connections to my ESP32 microcontroller and my LED strips, that it should work as it should?
Also, do I need a logic-level converter between the LEDs DIN and my microcontroller's IO pins?

mrbestdeni:
I didn't really specify which microcontroller I have. I have an ESP32-WROOM-32 chip on a DOIT ESP32 DEVKIT V1. I'm not sure if this changes your answer since that is not a WeMOS D1 or an Arduino for that matter.

So is it safe to assume that If I buy an adapter board and put a USB connected to a computer in it, then solder the connections to my ESP32 microcontroller and my LED strips, that it should work as it should?
Also, do I need a logic-level converter between the LEDs DIN and my microcontroller's IO pins?

I drive 5V and 12V LED strips with my Wemos D1 Mini, 3.3V boards. I only need a level shift if the first LED is more than a couple of meters from the ESP. (Each LED regenerates the signal for the next LED in the string). In fact, you can cut out a sacrificial LED and use that closer to the ESP to condition the digital signal for the next LED.

The series resistor is there to reduce noise, AKA ringing, on the data line. It will probably work fine without it, but if you get flickering or strange response, the series resistor is the first thing I would check.

As Paul and others said, the Arduino or Wemos or NodeMCU boards are not power supplies. You never power an LED string or servo or motor from the Vin pin. If the board and the LED string are both 5V, then just wire them in parallel. A capacitor is optional- I have never needed one because I have well regulated power supplies for my LED displays. But if I were using a cheap wall-wart, I would definitely use the capacitor on the +5V wire.

I don't think USB from the computer can/will supply the needed current for 24 WS2812Bs.
You could check yours, see what the ports are rated for.
Supposedly there is some negotiation between the device you plug in and the port as to how much current will be provided. If you plug in a power only cable, I don't know what that results in. I've never tried to load down a port to see what it will support.

CrossRoads:
I don't think USB from the computer can/will supply the needed current for 24 WS2812Bs.
You could check yours, see what the ports are rated for.

My laptop has a Thunderbolt 3 USB 3.1 charging port, so I'm guessing it can provide the necessary 1.44 Amps needed to power the LEDs on full brightness when on white. Caveat: Even though it says the drawn power of each pixel might be up to 60mA, in reality, the drawn power will be much lower due to not all pixels being on full brightness all the time, and I could always set the maximum brightness to be 80% of max.

SteveMann:
You never power an LED string or servo or motor from the Vin pin. If the board and the LED string are both 5V, then just wire them in parallel.

I'm just curious why y'all are recommending putting in a separate power supply (Rechargeable battery? How would I charge it?) when the person that was doing this DIY project managed to get it fully working using only the VIN pin on his Particle Photon board (Step 3.3) and providing data through a 3.3V IO pin (without using a logic-level converter).

By "wire them in parallel", what would be the input? Would it be an adapter board? Would that adapter board be capable of providing the necessary current to power the LEDs on full brightness?

Please also put in context my project restrictions. I'm using only 24 LEDs (28 cm in length) that are a couple of cm (or less than 1 inch) away from the microcontroller. I'm also tight on space, so not using a separate battery to power the LEDs would be a good thing.

"I'm just curious why y'all are recommending putting in a separate power supply"
Again, and for clarity, I will speak slowly...

THE ARDUINO IS NOT A POWER SUPPLY.

Read this thread.

SteveMann:
The datasheet for the WS2812 chip says a logic 1 minimum is 2.7V, so a 3.3v logic should (and does here) work just fine.

I have told you before the data sheet says no such thing. If you disagree post the bit of the data sheet to prove your statement.

My laptop has a Thunderbolt 3 USB 3.1 charging port, so I'm guessing it can provide the necessary 1.44 Amps needed to power the LEDs on full brightness when on white.

Stop guessing and start learning. The Arduino has a limit in how much current it can take from the 5V USB line because of the filter components in the circuit.

The reason you blew your strip is that you messed about wiring them while it was powered up. Don’t do, the signal line tries to power the LEDs, the power is interrupted and the ground can cause problems by not being solid. This applies to all electronics not just LED strips. You will damage stuff if you do this.

Paul__B:
While it might be a convenience to use this because the 5 V supply has a mini or micro USB connector, the proper way is to use an adapter board to break out the 5 V power and connect that both to the board via its "5V" pin and the LED strip.

Alright, so I have this adapter board now. And I read all your guys' concerns about me using a microcontroller as a power supply. I understand now and I did understand that. I was just curious (as I said) how a person In another project (that I linked to in my last post) was able to use his as a power supply...
Anyways, I'm now curious, having this adapter board, can I now directly connect things as seen in the picture. The red thing is my WS2812 24bit LED ring.
The images

The green wire is connected to an aluminum touchpad and yes, I know that I don't have a 3.3V to 5V LLC, but that's not my question right now. I'm interested to know if this setup is good now, and whether or not I can program my ESP32 by connecting the D+ and D- to something on the board? Like RX and TX? I read it can't be connected because I would need for the Data to pass through the CP2102. So can I unsolder the current female microUSB port and maybe solder the D+ and D- directly? What's a better solution.

Thank you for all your help so far.

Grumpy_Mike:
I have told you before the data sheet says no such thing. If you disagree post the bit of the data sheet to prove your statement.

I am wondering also where I got the 2.7V figure. The input voltage is 0.7*Vdd, or 3.5V.

But it works fine here on 3.3V logic.

SteveMann:
I am wondering also where I got the 2.7V figure. The input voltage is 0.7*Vdd, or 3.5V.

But it works fine here on 3.3V logic.

Did you get it from driving the LEDs at a lower voltage than 5V? I agree it normally works, but plenty of threads here show a level shifter is often a cure as to why it doesn’t work.

Actually, looking at what you have, if you wish to program the ESP in situ, rather than connecting D+ and D- to the matching points on the ESP board, it would really be simpler just to forget the breakout board and bridge out D1 so that the USB socket connects directly to "Vin". I presume for a relatively small number of LEDs, the traces on the ESP board would be sufficient to carry the current, the diode was the major concern (and it actually looks like a rather large one!)

I liked this video on the imgur page. :grinning:

Grumpy_Mike:
Did you get it from driving the LEDs at a lower voltage than 5V? I agree it normally works, but plenty of threads here show a level shifter is often a cure as to why it doesn’t work.

I am using 12V strings with a built-in voltage divider, but the WS chip is still a 5V device. As I said before, if the first LED is more than a couple of meters from the ESP, then I use an LS244 driver.