7 ms·
Fun! It's amazing how ubiquitous WS2812Bs have become in such a short time. They're wonderful for everything from wearables to signage to room lighting, and the
by leggomylibro 7y ago
Fun! It's amazing how ubiquitous WS2812Bs have become in such a short time. They're wonderful for everything from wearables to signage to room lighting, and there are 12V versions available if you want to drive longer strings.
Some advice for people seeing this article in 2020: you might consider using a more modern microcontroller which supports DMA for new projects today. The ATMega328p which is used in Arduino Unos and Nanos is a reliable workhorse, but it's also slow and expensive compared to modern 32-bit MCUs.
Check out ESP8266/ESP32 or ARM Cortex-M cores. They're fast enough to make buttery-smooth animations, they have enough memory for thousands of LEDs, and DMA lets you set up a continuous data transfer to the LEDs which does not require CPU time. These days, there are plenty of ARM Cortex-M boards which work with the Arduino IDE while still being a hair cheaper than "Arduino" knock-offs, and ESP8266 boards let you control your patterns over WiFi.
If you're starting to learn about embedded development today, it's not a bad idea to start with more modern hardware; projects like MicroPython and Arduino support a wide variety of chips.
Also, if you use the Arduino IDE and appreciate their work, consider buying a genuine Arduino Nano. They cost a bit more than $3-5:
https://store.arduino.cc/usa/arduino-nano https://store.arduino.cc/usa/arduino-nano
- person_of_color 7y agoIm building a setup now. Any tips on libraries for esp8266 to control the maximum number of leds via i2s DMA?
- leggomylibro 7y agoWell, there's an ESP8266 board called the "PixelBlaze" which is designed for driving these LEDs, but I don't think the firmware is open source: https://www.bhencke.com/pixelblaze https://www.bhencke.com/pixelblaze This page seems to have more information about a couple of different methods - apparently it's also possible to use a UART peripheral: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethod...
- detaro 7y agoFastLED is quite popular: https://github.com/FastLED/FastLED/wiki/ESP8266-notes https://github.com/FastLED/FastLED/wiki/ESP8266-notes
- semi-extrinsic 7y agoIf you want maximum number of LEDs, I think you want the four-wire LED strips that are driven over SPI, like the APA102 and similar. Much faster than bit-banging on the three-wire strips.
- rowanG077 7y agoIf you want max number of LEDs you have to use HUB based LED panels. They are way cheaper. But harder to control.
- person_of_color 7y agoGot a link?
- rowanG077 7y agoFor instance: https://nl.aliexpress.com/item/32969045578.html?spm=a2g0o.productlist.0.0.61d746ccDp9BcO&algo_pvid=3b98d180-071a-4b30-bd2b-4e4a6a2c25c2&algo_expid=3b98d180-071a-4b30-bd2b-4e4a6a2c25c2-4&btsid=0b0a0ad815832683120521475e1e2f&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_ https://nl.aliexpress.com/item/32969045578.html?spm=a2g0o.pr... You can find how to control them if you search for HUB75. For a couple of dollars you got 2048 LEDS. You can get them in different sizes and LED pitches.
- armaizadenwala 7y agoThank you for this post! When I started, I didn't realize how low powered these nanos are. I spent forever getting the variables under 1.1kb but I just discovered the teensy 4.0 that supports 1000x as much memory and 30x the processor speed. I am still glad I started with the nano because it got me to refactor my code and make it memory efficient.
- leggomylibro 7y agoWell, congratulations - it's an impressive project! Putting things together in a sturdy way that looks nice is the hard part. Thanks to all of the free libraries and IDEs, the hardware and software are practically an afterthought these days :)
- pugworthy 7y agoTeensy line, especially the Teensy 4. Amazing power in that thing, and cheap.
- armaizadenwala 7y agoI have one laying around! Is it as easy as just soldering the wires on the pins just like the nano?
- sjburt 7y agoYes, at least in this application. You technically need a level shifter since the teensy has 3.3V output, but if you are running the strip at 4.5V, the output of the Teensy will just barely meet the spec. If you run the strip at a higher voltage you can run into problems.
- 0xff00ffee 7y agoTeensy is great, and the guy that makes it is super cool. Not enough IO on the breakouts for big projects tho, IMHO.
- pugworthy 7y agoPaul is. I didn't know what he was bound for years ago, but knew (of) him at Oregon State University a long time ago.
- 0xff00ffee 7y agoI'm a big fan of the STMicro nucleo L476RG. Multiple UARTS and SPIs, really low power, custom clocking and deep-sleep modes, 32x the flash of an Uno, and up to 80MHz. Comes in $13 arduino-like board, or a smaller $8 version like an Arduino micro.
- numlock86 7y agoThe "BluePill" (STM32F103) is also good, really small and pretty cheap if you don't need the Arduino compatibility. You will need a dedicated programming tool (ST-Link), though. At least that's what I use for more than half of my WS2812B related projects.
- nyx_ 7y agoI totally understand why one might want to buy "genuine Arduino" parts to support the company doing the work to shape that hardware/software ecosystem, but is there a point at which it's reasonable to acknowledge that the price increase over compatible Chinese knockoffs isn't worth paying? I mean, that Nano is $22 from them, which is like a 600% markup over the identically functional cheapo ones you can get on Chinese eBay.
- fit2rule 7y ago>ESP8266 boards let you control your patterns over WiFi. I helped make this: http://magicshifter.net/ http://magicshifter.net/