The Most Minimal WS2812B Driver

Whether you call them individually controllable RGB LEDs, WS2812, or NeoPixels, there’s no denying they are extremely popular and a staple of every glowey and blinkey project. Fresh off the reel, they’re nearly useless – you need a controller, and that has led to many people coming up with many different solutions to the same problem. Here’s another solution, notable because it’s the most minimal WS2812 driver we’ve ever seen.

The critical component in this build is NXP’s LPC810, an ARM Cortex M0+ in an 8-pin DIP package. Yes, it’s the only ARM in a DIP-8, but still able to run at 30MHz, and hold a 4kB program.

JeeLabs is using the SPI bus on the LPC810 to clock out data at the rate required by the LEDs. The only hardware required is a small LED to drop the voltage from 5V to 3.3V and a decoupling capacitor. Yes, you could easily get away with this as a one-component build.

The build consists of a ring of sixty WS2812b RGB LEDs, and the chip dutifully clocking out bits at the correct rate. It’s the perfect start to an LED clock project, an Iron Man arc reactor (are we still doing those?), or just random blinkey LEDs stuffed into a wearable.

Thanks [Martyn] for sending this one in.

32 thoughts on “The Most Minimal WS2812B Driver

          1. I don’t know about the physical engines. I was able to confirm:
            · Newark has fourteen hundred of these MCUs in stock for $2.79 each (or $2.48 each when you get ten) with same-day shipping;
            · Mouser has nearly twelve thousand of them available for $2.41 each (or a buck ninnah-five each when you get ten).

          2. Over at Digikey, 50+ parts at or below $1.80
            Cypress CY8C4013SXI-400-ND $0.62 16MHz 8K/2K
            Freescale MKE04Z8VTG4-ND $0.95 48MHz 8K/1K

            They sell the LPC810 DIP8 package at $2.42. That’s a premium for wanting a DIP8 part when you are already dealing with SMT LED.

          3. They have a $4 board for their PSoC 4100 & 4200 (no debugger, only USB-serial). Hope they’ll make a break out board for these new parts.

            Still not too bad at $30 with onboard that handles SWD debugger/programmer in CY8CKIT-040 PSoC 4000 Pioneer Development Kit. (They use a PSoC5 for that.)

        1. I tried a 4MHZ PIC10 and I could not get it to work. Timing was too tight.

          But a PIC12F1840 has an 8uMhz internal osc with a 4x PLL.

          32Mhz / 4 = 8Mhz, and it works great !

          The routine to push 800Khz serial data to the WS2812B was written all in C.

          No, assembly required.

          See video below. :-)

  1. I’ve also done a one component build for driving ws2811 using an AVR at 8 MHz instead of an ARM at 30 MHz.

    My project is here: http://hackaday.io/project/1237-iris-clock
    The source code for the driver is here: http://git.digitalcave.ca/gitweb/?p=projects.git;a=blob;f=lib/avr/ws2811/ws2811_w.h

    There’s more to my project than just the ws2811 so my schematic is a bit more complicated but it boils down to just the AVR (and a capacitor) if all you do is drive the led strip. The smallest AVR I’ve tested this on is a AtMega48 but in theory you could use the smallest 6-pin AVR available and it should still work.

    Cool project though — I’m looking forward to getting into ARM as well and that looks like a sweet chip.

    1. If you read the link, you’ll see that the LPc is driven at 2.4MHz but I agree that an 8-bit can do the job, moreover because a SPI peripheral is used, with quite no relation with the core itself.

      One more original challenge with the LPC810 would be to use the SCT, that is specific to NXP MCUs

      1. They are for RTC and IR remote receiver – functionality in [Warren]’s project that outside of what’s needed to drive the LED. Not everyone just want blinking LEDs and nothing else.

        So when you strip all that stuff off, you just just left with the AVR, cap and may be the series resistor (needed if you have a long wire/uncontrolled impedance) to the LED.

  2. I use an ATTiny85 running at 5v (so I don’t need the drop LED), nor do I have a capacitor. One variant is loaded via SPI using the USI (it could have been I2C) – https://github.com/tz1/neospi – pin 2 or 3 goes to the LED.
    For Christmas I used something similar to illustrate various sorting algorithms on 256/300 on my long strip.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.