Go Down

Topic: Why are these best practices for using LED strips/rings (WS2812) (Read 615 times) previous topic - next topic

mrbestdeni

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: https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices
I was using this WS2812 ring I bought off of eBay before it stopped working: https://ebay.to/3frVS8d

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.

mrbestdeni

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.

CrossRoads

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?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

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.
https://www.youtube.com/watch?v=CGOxbehyoM4
Camera struggled with the brightness and pulsed brakes lights.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

SteveMann

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.
Fritzing pictures are NOT schematics. I don't speak Fritzing.

Please do not ask for help by PM. I will not respond. If you need help, post a question on the appropriate forum.

Click on Add Karma if I helped you.

mrbestdeni

Hey, thanks so much for the extensive reply!

Quote
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!

Quote
4. 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.

Quote
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?

Quote
https://www.youtube.com/watch?v=CGOxbehyoM4
That's a really cool project!!

https://patrick.ble.si/wifi-touch-light
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?

Quote
You could try unsoldering the first one, and soldering in a replacement part.
I'll definitely try this, thanks!


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.  :smiley-lol: )

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.

mrbestdeni

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.  :smiley-lol: )

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?

SteveMann

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.
Fritzing pictures are NOT schematics. I don't speak Fritzing.

Please do not ask for help by PM. I will not respond. If you need help, post a question on the appropriate forum.

Click on Add Karma if I helped you.

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.
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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

mrbestdeni

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.

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.

SteveMann

"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.
Fritzing pictures are NOT schematics. I don't speak Fritzing.

Please do not ask for help by PM. I will not respond. If you need help, post a question on the appropriate forum.

Click on Add Karma if I helped you.

Grumpy_Mike

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.


Quote
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.

Go Up