Breadboardable WS2812 LEDs

LED

Hackaday sees a ton of projects featuring the WS2812 series of digitally controllable RGB LEDs, in the form of bare chips, RGB LED strips, or some form of Adafruit’s NeoPixels. All these WS2812 LED products have one thing in common – they’re chip LEDs, making some projects difficult to realize. Now there’s a new member of the WS2812 family – a through-hole LED version - that should be available through the usual sources sometime later this year.

The key difference between these and the usual WS2812 LEDs is the packaging; these are 8mm LEDs with pins for power, ground, data in, and data out. With the preexisting libraries, this 8mm LED should work just the same as any other WS2812 LED.

Aside from a through-hole package, these new LEDs are very diffuse and aren’t as blinding as the normal chip LEDs. If you want to pick up a few of these LEDs, they’re available here, 13 LEDs for $15. There’s a lot of potential here for RGB LED cubes, something we hope to see sooner rather than later.

Driving RGB Pixel LEDs With CAT5 Cable

cable-test

[Teknynja] was working on a project where he needed to drive a few strips of Adafruit Neopixels – WS2812 LED strips – that were located several feet apart. These LED strips draw a lot of current, and are very timing sensitive; anything more than a few feet of wire between the microcontroller and the LED strip will probably result in missed data, voltage drops, dimming LEDs, and possibly a non-functional strip.

The solution, as in all matters concerning long distance transmission of data, was CAT5 cable. [Teknynja] used RS-422 drivers and receivers to pull this task off, with 75174 line drivers receiving signals from a Teensy 3.0, and 75176 bus transceivers reading everything at the other end of a 20 foot cable.

For the power drop issue, [Teknynja] is feeding 12V into a few of the wire pairs in the cable and using a cheap  LM2596 buck converter to step everything down to 5V at the strip.

With a fairly simple circuit, [Teknynja] was able to drive a few strips of WS2812 LEDs through 20-foot lengths of CAT5 cable with ease; it worked just the same as if the pixels were connected directly to the Teensy on a workbench.

IKEA LED Table Mod Doesn’t LACK Awesome

Ikea LED Table

Some people look at IKEA LACK tables as cheap furniture. Our readers look at them as a blank canvas. [Klaas] has turned a LACK Side table into an interactive LED table featuring 144 RGB LEDs. After attending a class on WS2801 pixel strings at his student IEEE chapter, [Klaas] was inspired to design something of his own. He settled on an IKEA LACK table and started sketching. He didn’t actually have a table on hand, so he had to deduce the size from the website images and dimensions. He calculated a usable size of around 45cm, which was pretty close to the mark. After running a few tests, [Klaas] determined that a 12×12 grid of squares 35mm on a side would provide that enough resolution to play simple games. The 35mm x 35mm grid would also be small enough for the LEDS to illuminate. He used a laser cutter to cut the an interlocking grid from 3mm MDF. A base plate with 144 12mm LED holes was also cut out, and the entire assembly was glued together.

For illumination, [Klaas] settled on WS2812B LEDs, as they were cheaper than their WS2801 couterparts. The WS2812B’s also snapped easily into his 12mm holes. At this point [Klaas] actually purchased his IKEA table and proceeded to cut a huge hole in it. The grid glued right in, and some aluminum L-profile cleaned up the top edge. Driving all those LEDs would need a bit of processing power, [Klaas] chose a Teensy 3, and the well-known OctoWS2811 library. He also added a USB host shield, which allowed him to use an Xbox 360 USB game pad as his controller. For software, he created a simple Tetris clone, and ported snake from the Arduino game shield. A menu and some scrolling text ties everything together. The only thing left to add is a glass top. [Klaas] hasn’t settled on clear or diffuse glass yet. We a suggest clear to avoid hiding any details of this great build.

[Read more...]

Rewriting WS2812 Driver Libraries for Optimization

ws2812_compared

We like [Tim's] drive for improvement. He wrote a WS2812 driver library that works with AVR and ARM Cortex-M0 microcontrollers, but he wasn’t satisfied with how much of the controller’s resources the library used to simply output the required timing signal for these LED modules. When he set out to build version 2.0, he dug much deeper than just optimizing his own code.

We remember [Tim] from his project reverse engineering a candle flicker LED. This time, he’s done more reverse engineering by comparing the actual timing performance of the WS2812(B) module with its published specs. He learned that although several timing aspects require precision, others can be fudged a little bit. To figure out which ones, [Tim] used an ATtiny85 as a signal-generator and monitored performance results with a Saleae logic analyzer. Of course, to even talk about these advances you need to know something about the timing scheme, so [Tim] provides a quick run-through of the protocol as part of his write-up.

Click the top link to read his findings and how he used them to write the new library, which is stored in his GitHub repository.

Controlling Ten Thousand RGB LEDs

LEDsRGB LEDs are awesome – especially the new, fancy ones with the WS2812 RGB LED driver. These LEDs can be individually controlled to display red, green, and blue, but interfacing them with a microcontroller or computer presents a problem: microcontrollers generally don’t have a whole lot of RAM to store an image, and devices with enough memory to do something really cool with these LEDs don’t have a real-time operating system or the ability to do the very precise timing these LEDs require.  [Sprite_tm] thought about this problem and came up with a great solution for controlling a whole lot of these WS2812 LEDs.

[Sprite] figured there was one device on the current lot of ARM/Linux boards that provides the extremely precise timing required to drive a large array of WS2812 LEDs: the video interface. Even though the video interface on these boards is digital, it’s possible to turn the 16-bit LCD interface on an oLinuXino Nano into something that simply spits out digital values very fast with a consistent timing. Just what a huge array of RGB pixels needs.

Using a Linux board to drive RGB pixels using the video output meant [Sprite_tm] needed video output. He’s running the latest Linux kernel, so he didn’t have the drivers to enable the video hardware. Not a problem for [Sprite], as he can just add a few files to define the 16-bit LCD interface and add the proper display mode.

[Sprite_tm] already taken an oscilloscope to his board while simulating 16 strips of 600 LEDs, and was able to get a frame rate of 30 fps. That’s nearly 10,000 LEDs controlled by a single €22/$30USD board.

Now the only obstacle for building a huge LED display is actually buying the RGB LED strips. A little back-of-the-envelope math tells us a 640×480 display would be about $50,000 in LEDs alone. Anyone know where we can get these LED strips cheap?

[Read more...]

Using DMA to Drive WS2812 LED Pixels

ws2812-dma-control

It’s pretty well known by now that the LED pixel hardware which is starting to be commonplace, both WS2811 and WS2812, needs pretty strict timing in order to address them. There are libraries out there which mean almost no work on your part, but that’s no fun. [Elia] started looking into what it takes to drive the hardware, trying out a few 8-bit micros before moving to 32-bit with the help of an STM32VL Discovery Board. The move to a beefier processor brings a lot of speed, but why bit bang everything? He came up with a way to use the PWM and DMA features of the chip to drive the LEDs.

DMA is the Direct Memory Access unit that allows you to change the values being sent to the pixel without interrupting the processor. This is done by pre-loading the data at a memory location. This buffer is automatically read by the DMA unit — its values are used to set the PWM timer compare trigger in order to send out logic values show in the diagram above.

If you do want to delve further into this topic here’s a collection of techniques for driving the WS2811.

[Read more...]