Simulator

A NeoPixel simulator running Adafruit_NeoPixel

Mokxi is a free online NeoPixel and WS2812B LED strip simulator that runs in your browser, with nothing to install and no account needed. An Arduino Uno runs a rainbow along a strip of 20 WS2812B LEDs and makes 4 more shimmer gold, with the Adafruit_NeoPixel library and a knob for the speed.

  • 455parts on the bench
  • 43boards running now
  • 1.00xreal time, on every board
Arduino Uno: a NeoPixel rainbowlive0.000 s 0.00x
Click to open it in the editor
Turn the knob to speed the rainbow up, or click anything else to open it in the editor.

What you can do here

In the circuit above, or in the editor it opens.

  • Run Adafruit_NeoPixel code: setPixelColor, ColorHSV, gamma32, show
  • Turn the knob and watch the rainbow speed change
  • Set the number of LEDs, up to 1024 on one strip
  • Lay the LEDs out as a strip, a ring or a matrix, serpentine or not
  • Try RGBW pixels, or move the strip to an ESP32-C3
  • Edit the animation and press Run again

What the running circuit shows

Two strips, two pins, one library.

The arch is 20 WS2812Bs with DIN on pin 6 through 330 ohm; the pot of gold is 4 more on pin 5. Every frame the sketch spreads one turn of the color wheel across the 20 LEDs with ColorHSV, corrects it with gamma32 and nudges the start, so the colors flow. The knob on A0 sets how far it moves: map(analogRead(A0), 0, 1023, 32, 1024). In the engine all 24 LEDs are lit within half a second and, with the knob in the middle, the serial monitor prints “Rainbow speed 528”.

How the WS2812B is simulated

The one-wire protocol, timed.

Each pixel decodes the WS2812B’s 800 kHz one-wire signal from its DIN pin: a long high is a 1, a short high is a 0, 24 bits in green, red, blue order, and a low longer than the reset time latches the frame. Each pixel keeps its own 24 bits and passes the rest on out of DOUT, so you can chain strips the way you would on a bench. Get the timing wrong in your own bit-banging and the colors come out wrong, as they would on a real strip.

What it leaves out: the strip draws no current from the supply, so a project that would need a 10 A power supply and injection points for 300 LEDs runs here from the Uno’s 5 V pin. Plan about 60 mA per LED at full white on a real one.

Questions

Is it free?

Yes. The circuit on this page, every part in it and the editor it opens in are on the free plan, with no card.

Do I need an account?

No. The circuit runs the moment the page does, and the editor opens without one. A free account is only for saving a project to the cloud and sharing it by link.

Does FastLED work?

The circuit on this page uses Adafruit_NeoPixel. The editor’s library list says which LED libraries compile for each board; the strip itself only cares that the signal on DIN has the right timing.

Can I simulate a NeoPixel ring or matrix?

Yes. Set the part’s layout to ring or matrix in the properties panel, and turn on serpentine for a matrix wired in a zigzag.

How many LEDs can a strip have?

Up to 1024 on one part, and parts can be chained from DOUT to DIN.

Make your own light show

Open the circuit, change the colors and press Run. Nothing to install, and no account needed.