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.
Small correction. Not the only ARM in a DIP package. I believe you guys have a previous post on this one: http://www.nxp.com/products/microcontrollers/cortex_m0_m0/lpc1100/LPC1114FN28.html
Corrected that with two keystrokes.
Amazing what you can do when you expand your world beyond digitalWrite()
Huh? What do you mean “world beyond digitalWrite()”? B^)
Yes true, but a 32 Bit uC @ 30MHz to drive leds!!!, Now please excuse me while I go install a V8 engine into the baby push stroller.
If you can get that V8 for the same price as an engine to a mower, then go on… ;)
If he can get that V8 for the same price as an engine for a mower, TELL ME WHERE! B^)
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).
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.
Cypress seems to be pretty aggressive at their PSoC4 pricing. M0 based, 1.7V – 5.5V. 1k pricing starting at $0.29. While it is not quite a V8, still a good V6 at a 2 stroke prices.
http://www.cypress.com/?app=search&searchType=part&keywords=CY8C4013SXI&submit-keywords.x=0&submit-keywords.y=0
Too bad the Cypress demo board for their M0 is so expensive. They need to learn from STM, Freescale, etc. and make it irresistible to hackers.
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.)
Really, who cares if it has 32 bits, or runs at 30 MHz ? Difference in price between ARM and 8 bit stuff is so small, it’s not worth it to make life harder with 8 bit.
I don’t think “minimal” is the right word. Now if it was a pic12f device running at 4MHz, I might call it minimal. “Small” would be a better description.
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. :-)
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.
I’ve done similar as well. Just an ATTiny 85 doing a simple sequence: https://hackaday.io/project/216-infinity-mirror-with-a-convex-mirror
I’ve likewise done a simple driver; just an ATTiny 85: https://hackaday.io/project/216-infinity-mirror-with-a-convex-mirror
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
This guy made an implementation using the SCT and SPI core in tandem and hooking those two up via the configurable switch matrix, pretty nifty!
http://www.lpcware.com/content/forum/controlling-ws2812-led-strips-lpc810#comment-1131398
Somebody already did this, coupling the SCT with SPI and using the pin matrix to connect these two up:
http://www.lpcware.com/content/forum/controlling-ws2812-led-strips-lpc810#comment-1131398
I’d you list 8 components (excluding the batteries / PSU and LEDs themselves) on the BoM, so I struggle to see how it’s a “one component build”.
Yes, I too was wondering about the crystal and caps. :-)
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.
So 2 or 3 components then.
LPC solution – 3 parts. LPC chip, 1 cap, 1 LED to drop 5V to 3.3V.
http://jeelabs.org/wp-content/uploads/2014/12/DSC_4859.jpg
How about a PIC12F1840 !!
https://dl.dropboxusercontent.com/u/74667085/TinkerMill/MicroDMX.JPG
As seen here at 0:48 :
https://dl.dropboxusercontent.com/u/74667085/TinkerMill/TinkerMill.MOV
I beg to differ.
Since when is a LPC810 smaller than a ATtiny10?
http://hackaday.com/2014/03/20/usb-on-the-attiny10/
This is a much smaller chip than the ARM. And it does USB in addition!
Well! With that knowledge, I am NOT going to buy an ATiny10 until it does USB in multiplication! B^)
I would argue this is the smallest micro I know driving those leds: https://cpldcpu.wordpress.com/2014/03/19/%C2%B5-wire-usb-on-an-attiny-10/
Too bad they were not that popular during the 555 contest…. that would have been fun :D
Hmmm, 555 …..
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.