Skip to content

Arduino WS2812b RGBLEDS Wiring Setup

Wotever edited this page Feb 11, 2021 · 25 revisions

Prerequisites

Simhub only offers one WS2812B output on the arduino. Leds can come in various form factors and can be wired together (single leds, 8x strand, circle ...)

Limitations

  • As the current state of the sketch, led types (PL9823, WS2812B, ...) can't be mixed on a single arduino
  • One arduino can have up to 150leds enabled, and Simhub can drive up to 512leds overall when driving multiple arduinos. Warning, the latency will raise with the number of leds, for a large setup an Arduino pro micro is a good option as it reduces the serial port latency.
  • RGBW leds are not supported

Caution for RGB encoding !

Some WS2812B modules may have a different RGB encoding and colors may be reversed. Simhub offers a way to configure the encoding at setup, but you can't mix encoding between multiple cascaded strands.

See #known-strands-which-have-a-different-encoding for a list of known models having this "difference"

Wiring

WS8212B -> Arduino
GND -> GND
DIN -> D6
4-7VDC -> 5V

LEDS have a direction ! Do not mix up DI/DIN with DO/DOUT ! DO/DOUT can be used to cascade another strand/leds, and can't be used as an input.

Please ensure that the solder connections are secure. Glitches in the LEDs (including randomly lit lights and out-of-order LEDs being lit or unlit) are usually caused by a bad connection between the Arduino to the LEDs, or from cascading LED strips together.

Please ensure that the GND is connected to all modules, with the same side pad (as there's two on a board) being connected.

Arduino Setup

See : https://github.com/zegreatclan/SimHub/wiki/Arduino--Setup

You must configure how many total leds are connected (not how many strands !)

Testing your Leds

During the setup you can configure the sketch in "testing" mode (see Arduino setup capture above), it will light up all the leds in red. This won't totally ensure you that your hardware is totally working but it's a first test to do in case of issues. If all leds are not lighting up, check your wiring and eventually change the first led strand showing issues.

WS2812B Leds works like a "chain", if one led is not working it may not send data to the next one and all the next leds would be dead.

Led editor guide

Led editor guide

Known strands which have a different encoding

Troubleshooting

If the LEDs are blinking crazily around in weird patterns (for example: leds shifting to left and right, blinking in different color, offsets seem to change) even if you programmed them differently try this:

  • change USB cable
  • re-solder all contact points
  • add at least a 470 Ohm resistor right before the Data In on the first LED board (recommendation from Adafruit Neopixel Uberguide)

If nothing helps, it might be because the LED board is a cheap alternative to the Adafruit Neopixel. Even if it says Neopixel on the back does not mean it can handle the very fast changes of the LEDs. The demos coming with the Arduino IDE could be perfectly fine. It is because of this:

Simhub refresh the LEDs really fast and only partially (it only sends changes) so a display error will be "sticky" while all the demos refreshes LEDs at every frame making display errors almost invisible.

So if nothing else it might be the LED board. Try changing it to a brand board, maybe from an official store, and you should be set. One indicator that you got a cheap copy is that the resistor within the LED is much smaller.

Clone this wiki locally