Three Conceptual Approaches To Driving A WS2811 LED Pixel

driving-a-ws2811

[Cunning_Fellow] published a post with three proof-of-concept approaches to driving a WS2811 LED pixel. We looked at a project early in December that used an AVR microcontroller to drive the RGB package. [Cunning_Fellow] saw this, and even though he doesn’t have any of these parts on hand he still spent the time hammering out ways to overcome the timing issues involved with address the device. His motto is “put up or shut up” when it comes to criticizing projects featured on Hackaday. We love seeing someone pick up an idea and run with it.

The approach in all three cases aims to conserve clock cycles when timing the communications. This leaves the developer as many cycles as possible to perform other tasks than simply telling the lights what to do. One approach is an assembly routine that is just a shade slower but groups all 14 free cycles into one block. The next looks at using external 7400 series hardware. The final technique is good old-fashioned bit banging.

[Photo Credit]

Driving A WS2811 RGB LED Pixel

[Alan] has been working on driving this WS2811 LED module with an AVR microcontroller. It may look like a standard six-pin RGB LED but it actually contains both an LED module and a microcontroller to drive it. This makes it a very intriguing part. It’s not entirely simple to send commands to the module as the timing must be very precise. But once the communication has happened, the LED will remain the same color and intensity until you tell it otherwise. You can buy them attached to flexible strips, which can be cut down to as few as one module per segment. The one thing we haven’t figure out from our short look at the hardware is how each pixel is addressed. We think the color value cascades down the data line as new values are introduced, but we could be wrong. Feel free to discuss that in the comments.

The project focuses on whether or not it’s even possible to drive one of these pixels with a 16MHz AVR chip. They use single-wire communications at 800 kHz and this really puts a lot of demand on the microcontroller. He does manage to pull it off, but it requires careful crafting in assembly to achieve his timing constraints. You can see a quick clip of the LEDs fading between colors after the break.

Continue reading “Driving A WS2811 RGB LED Pixel”

LED Interior Lighting Could Compromise Human Visual Performance

LED lighting is now commonplace across homes, businesses, and industrial settings. It uses little energy and provides a great deal of light. However, a new study suggests it may come with a trade-off. New research suggests human vision may not perform at its peak under this particular form of illumination.

The study ran with a small number of subjects (n=22) aged between 23 to 65 years. They were tested prior to the study for normal visual function and good health. Participants worked exclusively under LED lighting, with a select group then later also given supplemental incandescent light (with all its attendant extra wavelengths) in their working area—which appears to have been a typical workshop environment.

Incandescent bulbs have a much broader spectrum of output than even the best LEDs. Credit: Research paper

Notably, once incandescent lighting was introduced, those experimental subjects showed significant increases in visual performance using ChromaTest color contrast testing. This was noted across both tritan (blue) and protan (red) axes of the test, which involves picking out characters against a noisy background. Interestingly, the positive effect of the incandescent lighting did not immediately diminish when those individuals returned to using purely LED lighting once again. At tests 4 and 6 weeks after the incandescent lighting was removed, the individuals continued to score higher on the color contrast tests. Similar long-lasting effects have been noted in other studies involving supplementing LED lights with infrared wavelengths, however the boost has only lasted for around 5 days.

The exact mechanism at play here is unknown. The study authors speculate as to a range of complex physical and biological mechanisms that could be at play, but more research will be needed to tease out exactly what’s going on. In any case, it suggests there may be a very real positive effect on vision from the wider range of wavelengths provided by good old incandescent bulbs. As an aside, if you’ve figured out how to get 40/40 vision with a few cheap WS2812Bs, don’t hesitate to notify the tip line.

Thanks to [Keith Olson] for the tip!

Different Algorithms Sort Christmas Lights

Sorting algorithms are a common exercise for new programmers, and for good reason: they introduce many programming fundamentals at once, including loops and conditionals, arrays and lists, comparisons, algorithmic complexity, and the tradeoff between correctness and performance. As a fun Christmas project, [Scripsi] set out to implement twelve different sorting algorithms over twelve days, using Christmas lights as the sorting medium.

The lights in use here are strings of WS2812 addressable LED strips, with the program set up to assign random hue values to each of the lights in the string. From there, an RP2040-based platform will step through the array of lights and implement the day’s sorting algorithm of choice. When operating on an element in the array the saturation is turned all the way up, helping to show exactly what it’s doing at any specific time. When the sorting algorithm has finished, the microcontroller randomizes the lights and starts the process all over again.

For each of the twelve days of Christmas [Scripsi] has chosen one of twelve of their favorite sorting algorithms. While there are a few oddballs like Bogosort which is a guess-and-check algorithm that might never sort the lights correctly before the next Christmas (although if you want to try to speed this up you can always try an FPGA), there are also a few favorites and some more esoteric ones as well. It’s a great way to get some visualization of how sorting algorithms work, learn a bit about programming fundamentals, and get in the holiday spirit as well.

Virtual Pet Responds To WiFi

When the Tamagotchi first launched all those decades ago, it took the world by storm. It was just a bunch of simple animations on a monochrome LCD, but it had heart, and people responded to that. Modern technology is capable of so much more, so [CiferTech] set out to build a virtual pet that can sniff out WiFi networks.

The build employs an ESP32-S3, perhaps the world’s favorite microcontroller that has WiFi baked right in from the factory. It’s paired with a 240×240 TFT LCD that delivers bright, vivid colors to show the digital pet living inside. Addressable WS2812B LEDs and a simple sound engine provide further feedback on the pet’s status.

The pet has various behaviors coded in, like hunting, exploring, and resting, and moods such as “happy,” “curious,” and “bored.” For a bit of environmental reactivity, [CiferTech] also made the local WiFi environment play a role. Nearby networks can influence the “hunger, happiness, and health” of the pet.

Incidentally, if you’ve ever wondered what made the Tamagotchi tick, we’ve explored that before, too.

Continue reading “Virtual Pet Responds To WiFi”

Giant Neopixel Is Just Like The Regular Kind, Only Bigger

Neopixels and other forms of addressable LEDs have taken the maker world by storm. They make it trivial to add a ton of controllable, glowing LEDs to any project. [Arnov Sharma] has made a great tribute to the WS2812B LED by building the NeoPixel Giant Edition.

The build is simply a recreation of the standard 5mm x 5mm WS2812B, only scaled up to 150 mm x 150 mm. It uses a WS2811 chip inside to make it behave in the same way from a logical perspective, and this controller is hooked up to nine standard RGB LEDs switched with MOSFETs to ensure they can deliver the requisite light output. The components are all assembled on a white PCB in much the same layout as the tiny parts of a WS2812B, which is then installed inside a 3D-printed housing made in white PLA. Large metal terminals were added to the housing, just like a WS2812B, and the lens was then created using a large dose of clear epoxy.

The result is a fully functional, addressable LED that is approximately 30 times larger than the original. You can even daisy-chain them, just like the real thing. We’ve covered all kinds of projects using addressable LEDs over the years, from glowing cubes to fancy nature installations. If you’ve got your own glowable project that the world needs to see, make sure you notify the tips line!