WS2812 addressable LEDs test

RGB 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.

To test controlling WS2812 RGB LEDs I bought a cheap addressable LED strip. An addressable RGB LED strip is a long flexible strand of LEDs each of which can be individually set to a certain color (hence: addressable). By varying the level of red, green and blue (RGB) per LED many color combinations can be made. Addressable LED promise is to be an easy way to add complex lighting effects to any project. WS2812 neopixels are addressable RGB LEDs. The integrated controller chip allows you to change the color of the LED and address each individual LED. ThoseWS2812 LEDs are powered with 5V – 7V power source (60 mA power consumption) and are controlled through a serial bus (one control signal).

I planned to use either Arduino or ESP8266 to control those LEDs. After some looking on vailable examples and technical data on the LEDs, I planned to use Arduino (Arduno Uno), because it’s 5V power and 5V logic level is directly suitable. And there are many Arduino tutorials for WS2812.

To get easy start, I planned to follow instructions fro Arduino Addressable LEDs & Splendid Projects page. That page had an example source code that looked to be useful and simple wiring instructions.

In the first test I fould out that in addition to the source code I also needed NeoPixel Arduno library. So I needed to get the library from https://github.com/adafruit/Adafruit_NeoPixel and install it according to instructions. After downloading, I had to rename folder to ‘Adafruit_NeoPixel’ and move it to Arduino Libraries folder. After restarting Arduino IDE , I opened File->Sketchbook->Library->Adafruit_NeoPixel->strandtest sketch example file.  This worked well. I also tried the original code fromArduino Addressable LEDs & Splendid Projects page which I modified to use 8 LEDs instead of one. Both examples made a “random” color light show on my LED strip. Enough for first testing.

image

 

image

image

285 Comments

  1. Tomi Engdahl says:

    1200 Addressable LEDs Make For The Perfect First Dance
    https://hackaday.com/2022/06/16/1200-addressable-leds-make-for-the-perfect-first-dance/

    The first dance of a newly married couple at the wedding reception is both a sentimental and memorable event, so why not make it even more so with something a bit special? Hackaday alumnus [Brett Haddoak] and his wife [Rachelle] certainly achieved that, with 1200 addressable LEDs turning her wedding dress into a real-life reproduction of Princess Aurora’s color changing dress from Disney’s Sleeping Beauty.

    Sleeping Beauty Wedding Dress – The Details
    https://bretthaddoak.com/2022/06/15/sleeping-beauty-wedding-dress-the-details/

    Princess Aurora, “Sleeping Beauty” Wedding Dress in Real Life
    https://www.youtube.com/watch?v=cWNK0DdVv0w

    Reply
  2. Tomi Engdahl says:

    Screen share ANYTHING to this matrix! (Pi Pico)
    https://www.youtube.com/watch?v=yzRHAdS9FLY

    My first take on MicroPython and the new Raspberry Pi Pico W. Had some struggle wit the lacking ram but at the end a simple screen share worked which allows you to project anything shown on your PC screen to a nice LED Matrix display wirelessly. The case with back projection screen is printed in one Piece. It’s a super simple project to make on a weekend. I have better Websocket versions coming so subscribe to not miss that.

    Reply
  3. Tomi Engdahl says:

    Inside an SP002E pixel controller (with schematic)
    https://www.youtube.com/watch?v=jOo5lf4tVT4

    This is a very minimalist controller for WS2811 and WS2812B style addressable LEDs.
    It lets you choose an effect and speed, and will then run that effect whenever powered. Basically a fit-and-forget LED controller that could be ideal for signage, effects and costumes.

    Although most of the dirty work is done by a microcontroller, the support circuitry is quite interesting, largely because of the use of a discrete voltage regulator. The module will run from 5V to 24V.

    Reply
  4. Tomi Engdahl says:

    Learning from other’s mistakes
    https://www.youtube.com/watch?v=fDP1OPlib2g

    This unit has a very perplexing design. It seems like the designer copied many protective elements from other designs, but then failed to apply the same concept to their own output.

    The PTC self-resetting overcurrent thermistor and clamp diode approach is common on better designed DMX devices, as it protects the data inputs from rogue voltages. The same sort of rogue voltage that might occur from a logic level data output that is in the direct vicinity of much higher voltage pads. All it took was someone accidentally bridging two pads with a whisker of wire or solder, to completely destroy the unit instantly. Specifically destroying a custom programmed microcontroller with no easy replacement.

    Inputs and outputs that interface with the real world should be protected from rogue external voltages. Even a simple resistor on the output of this unit could have limited fault current to a level where the output circuitry was protected.

    This looks like an Arduino project modified with mostly decent protection circitry. Besides protection on that output (you can use one output of an RS485 driver for this with diodes etc) I would also protect the power supply from being reverse connected with a couple of diodes.

    My guess is it was originally designed for the more common 5V LED tape, but they forgot to add protection when they modified it for 12-24V use.

    Most pixel controllers I’ve seen use a series resistor between 33R and 100R on each output. AFAIK, it’s mainly there for slew rate limiting.

    Looks like a textbook ‘Arduino’ type implementation of the 16Mhz Atmega chip, i just did something similar as a home project, admittedly not using DMX but oldschool beat detection using the analogue ADC inputs on the chip

    Reply
  5. Tomi Engdahl says:

    Learning from other’s mistakes
    https://www.youtube.com/watch?v=fDP1OPlib2g

    Thumbnail changed from “dead” to “fried” to respect the passing of Her Majesty the Queen.
    It may take a while to go through the system as it was released before the news.

    This unit has a very perplexing design. It seems like the designer copied many protective elements from other designs, but then failed to apply the same concept to their own output.

    The PTC self-resetting overcurrent thermistor and clamp diode approach is common on better designed DMX devices, as it protects the data inputs from rogue voltages. The same sort of rogue voltage that might occur from a logic level data output that is in the direct vicinity of much higher voltage pads. All it took was someone accidentally bridging two pads with a whisker of wire or solder, to completely destroy the unit instantly. Specifically destroying a custom programmed microcontroller with no easy replacement.

    Inputs and outputs that interface with the real world should be protected from rogue external voltages. Even a simple resistor on the output of this unit could have limited fault current to a level where the output circuitry was protected.

    Viewer comments:

    This is like the electronics equivalent of the Death Star weak point. Armoured and defended up the hilt, except for that one access port that allows a rebel to stroll in and blow the thing to smithereens. Or in this case a stray bit of conducting material.

    This looks like an Arduino project modified with mostly decent protection circitry. Besides protection on that output (you can use one output of an RS485 driver for this with diodes etc) I would also protect the power supply from being reverse connected with a couple of diodes.

    D2 on the input protects from reverse power supply connection, but the passthrough might not be.

    > you can use one output of an RS485 driver for this
    Thanks man, great idea!
    i spent so much time thinking about how to properly protect outputs. Never found a really satisfying method.
    Had some success with iC-DX from iC-Haus, but its only suitable for higher Voltages. Still lacking a solution for 5V and 3V3 outputs.
    My last attempt was using nMOS transsitors in a clamping configuration… wich lead to higher-than-expected currents in a fault situation. But still, better than blown circuit board.

    This is why I always buffer outputs. Protect the expensive, hard to replace chip with a 10c buffer/driver. The rest of the circuits are good too, but it’s a lot easier to replace a little SOT/TSOP package than a BGA or QFP.

    Not just buffered, but also TVS and Zener diodes for anything that will interact with the outside world.

    i liked the dmx protection part, there is ptc, then resistor, then there’s ambulance which is quite loud, and then it’s zener

    My guess is it was originally designed for the more common 5V LED tape, but they forgot to add protection when they modified it for 12-24V use.

    Yes. I’ve made similar things with the 5V LEDs so the output protection was never an issue. However, I have learned from this and will be more careful in future.

    given this unit and the wireless dmx unit is sewn into the actor’s clothes – i should think mike is thinking this could all be done in a tiny single unit

    That doesn’t explain the lack of ESD protection, so it’s really just the design that’s flawed no matter the original use case.

    This has my vote. Wearables with no ESD clamping? Hmm… not sure it was a short to a rail that did this one in.

    The 100Ω resistor in the cheap one is included more to absorb reflections that as a current limiter, but it would tend to help at least a little in that respect.

    Addressable pixels work by taking in a data stream on the Data In pin, using the first values for what it needs (for an RGB pixel, the first 3 values on the stream), dropping the data it used and then transmitting the remaining data down the Data Out pin. This repeats until there is no data left to send (each pixel “eats” it’s part of the data stream), so you can have over 4,000 pixels, though at lower frame rates. That’s how huge carnival rides run such complicated patterns that would require dozens of DMX universes to run.

    The DMX to LED controllers I’ve worked with have you set the DMX address and from there they convert inbound DMX channels into sequentially transmitted SPI data streams, completely agnostic of the pixels attached. If you have 50 pixels and send 160 channels of RGB, the last pixel takes it’s data (what would be DMX channels 148, 149 and 150) and relays the rest to … an empty wire. The DMX controller is responsible for knowing how many channels to send per pixel (fixture) and in what order (GRB for most WS2811-type LEDs). Some are capable of driving several different types of addressable LEDs sending data in something other than the WS281x format.

    The only ones I know of that care how many pixels are on the line are ones that create their own shows when they don’t have DMX data coming in… great for a bar that has a standard look until the DJ gets in and starts the DMX software… unlikely to be the case in the unit you’re looking at.

    Others have probably mentioned it – but the two sets of passives supporting the dmx chips don’t appear to be identical (to my inexperienced eyes). There are two 10k resistors (R21 & R28) in the set for the “top” chip. Interesting video, as always.. Stay safe out there.

    Most pixel controllers I’ve seen use a series resistor between 33R and 100R on each output. AFAIK, it’s mainly there for slew rate limiting.

    Even a 1k resistor on the data line would have sufficed. It’d limit the current below what would damage the chip just using the body diode. It’s not a great protection but it’s a lot better than nothing.

    Normally it’s to provide some approximate match to the impedance of the signal line. It helps to avoid signal overshoot at the receiving end by treating it as a serially terminated transmission line. It will also inevitably have some effect on slew rate if the signal line is long enough to have significant capacitance.

    Actually there are protection diodes in the micro. But yes, limiting the current is essential.

    That design is really, really strange.
    The DMX input is flat wrong (doesn’t pass through but no source or end termination), weird expensive protection instead of the dirt cheap TVS diode set that provides at least the same level of protection, and yet absolutely nothing on the output at all.

    It looks like cargo cult design, except that I’ve really no idea what they copied!

    It looks like it’s time for a little adapter board with a better input connector, protection, and a socket for the LED tape.

    Nothing wrong with Euroblock

    PCB can be a square as wide as the strip, with large well distanced pads for soldering on a 3 wire flex. Circuit could be a zener clamp, a single-FET level shifter or a powered single gate level shifting IC. Maybe screw a loose 5V1 zener into the clamp and put the rest of the adapter circuit on the termination board (8x8mm) at the strip.

    Reply
  6. Tomi Engdahl says:

    The Sensory Bridge Is Your Path To A Desktop Rave
    https://hackaday.com/2022/09/26/the-sensory-bridge-is-your-path-to-a-desktop-rave/

    [Lixie Labs] are no strangers to creating many projects with LEDs or other displays. Now they’ve created a low latency music visualizer, called the Sensory Bridge, that creates gorgeous light shows from music.

    The Sensory Bridge has the ability to update up to 128 RGB LEDs at 60 fps. The unit has an on-board MEMS microphone that picks up ambient music to produce the light show. The chip is an ESP32-S2 that does Fast Fourier Transform trickery to allow for real-time updates to the RGB array. The LED terminal supports the common WS2812B LED pinouts (5 V, GND, DATA). The Sensory Bridge also has an “accessory port” that can be used for hardware extensions, such as a base for their LED “Mini Mast”, a long RGB array PCB strip.

    The unit is powered by a 5 V 2 A USB-C connector. Different knobs on the device adjust the brightness, microphone sensitivity and reactivity of the LED strip

    https://sensorybridge.rocks/

    Reply
  7. Tomi Engdahl says:

    Animated LED Arrows Point The Way
    https://hackaday.com/2022/09/24/animated-led-arrows-point-the-way/

    Visitors at the Garden D’Lights in Bellevue, Washington had a problem. While touring the holiday lights show, they kept straying off the path. The event organizers tried some simple LED arrows, but they were just more points of light among a sea filled with them. This is when [Eric Gunnerson] was asked to help out. He’s apparently had some experience with LED animations, even cooking up a simple descriptor language for writing animations driven by an ESP32. To make the intended path obvious, he turned to a PVC board with 50 embedded WS2812 pixels –RGB controllable LEDs. The control box was a USB power adapter and an ESP8266, very carefully waterproofed and connected to the string of pixels. The backer board is painted black, to complete the hardware. Stick around after the inevitable break, to get a look at the final

    https://github.com/ericgu/Fade

    Reply
  8. Tomi Engdahl says:

    3D-Printed Hexagons, an Arduino Nano, and LEDs Aplenty Make for a Great Halloween FastLED Helmet
    Based on the FastLED library’s example sketch, this configurable helmet started life out as a paper-covered beach ball.
    https://www.hackster.io/news/3d-printed-hexagons-an-arduino-nano-and-leds-aplenty-make-for-a-great-halloween-fastled-helmet-9501c1dc9d96

    Reply
  9. Tomi Engdahl says:

    The NEW Kind of LED You Should Know About!
    https://www.youtube.com/watch?v=DCsjd79aUlc

    Dave takes you on a tour from the first LEDs to the latest in LED technology, the individually addressable LEDs such as Neopixels/WS2812B style. From the quantum effects to how to wire their data line, Dave covers it all!

    OK, OK… you’re right. WS2812B is not “new” in that it’s been around since 2013, but it’s “new” to most hobbyists, as evidenced by the responses below. But a small and dedicated group of hobbyists has indeed been using them for a number of years, so they’re not “new” in that sense.

    Reply
  10. Tomi Engdahl says:

    LED Christmas Lights Optimized For Max Twinkleage
    https://hackaday.com/2022/12/21/led-christmas-lights-optimized-for-max-twinkleage/

    Old-school filament-based Christmas lights used to be available in twinkling form. LEDs, with their hard-on and hard-off nature, aren’t naturally predisposed to such behavior. To rectify this, some time ago, [Mark Kriegsman] built an Arduino program that makes LEDs twinkle beautifully.

    The program is known as TwinkleFOX, and relies on the popular FastLED library for addressable LEDs. [Mark’s] demo setup is built around using WS2811 LEDs, put together in a string with plastic diffusers on each bulb. The Arduino is programmed to vary the brightness of each LED according to a triangle wave function. To create the twinkling effect, each LED has its own unique clock signal, so they vary in brightness at different times and at different rates.

    https://gist.github.com/kriegsman/756ea6dcae8e30845b5a

    Reply
  11. Tomi Engdahl says:

    Episode 583: Epic Neopixel Birthday Cake
    https://community.element14.com/challenges-projects/element14-presents/project-videos/w/documents/27934/episode-583-epic-neopixel-birthday-cake

    What’s better than birthday candles? LED animations of course! In this video we’ll tackle the age old question: can you embed LEDs into a birthday cake? Using flexible LED matrixes and an Arduino, Natasha explores how to incorporate the matrixes into a cake and drapes fondant icing over them to diffuse the light. It’s an exciting use case for LEDs and a spectacular birthday cake!

    Reply
  12. Tomi Engdahl says:

    LED Laser Cannon: From Power Supply to the C++ Code
    https://www.youtube.com/watch?v=1hYmpztMQe0

    Reply
  13. Tomi Engdahl says:

    Setup WLED in 45 Seconds! NO TOOLS NEEDED – WLED for Beginners – 2023
    https://www.youtube.com/watch?v=aBOEHfT8VY4

    Reply
  14. Tomi Engdahl says:

    Build Your Own Massive LED Wall on a Budget
    https://www.youtube.com/watch?v=PiaS8zfuBHo

    Who needs nano leaf tiles when you can DIY an entire wall of LEDs! In this episode of Tech Random, Chris Parker is teaching you how to build your own 7-foot wide LED matrix for under $500! With a focus on beginner-friendly steps, Chris will walk you through the entire process of building the panels, connecting the LEDs, and using WebSockets to control the display over WiFi. This video is a must-watch for anyone who wants to add a pop of color and life to their room, or for those who are looking for a unique visual experience for their music or video calls. So get ready to ignite your creative side, as Chris takes you through the exciting world of LED walls!

    Timestamps:
    0:00 Demo of the Display
    0:26 Introduction
    0:50 3D Printing the Tiles
    1:43 Materials and Supplies
    2:19 Like the Video
    2:35 Building the Panel
    4:10 Testing the LEDs
    5:27 Connecting the Power Supply
    6:54 Adding the Diffuser
    8:21 Fixing Broken Software
    9:08 WebSockets
    10:06 Single Panel Firmware
    11:23 Four Panel Firmware
    13:26 Final Thoughts

    Reply
  15. Tomi Engdahl says:

    LED Laser Cannon: From Power Supply to the C++ Code
    https://www.youtube.com/watch?v=1hYmpztMQe0

    Want to build your own LED-powered laser cannon effect? Dave takes you through a demo and then all of the steps needed to build it! Learn how to use the NightDriver open-source software to build dozens of effects!

    Reply
  16. Tomi Engdahl says:

    NEW LED Software and Hardware Platform that YOU need to know about!
    https://www.youtube.com/watch?v=X3V4gxd20FM

    Dave introduces the Mesermerizer, an amazing new LED module based on the ESP32 that includes over 30 built-in effects ranging from Music Visualizers to the current Weather. Join the project by visiting NightDriverLED.com for technical info.

    Reply
  17. Tomi Engdahl says:

    This diy DMX Light Rig will Change Your Live Shows
    https://www.youtube.com/watch?v=Me3-dcMfEtM

    Here’s how I built a Modular DMX Lighting Rig for quick and affordable custom light shows.

    Reply
  18. Tomi Engdahl says:

    6:33 / 15:54
    I made a 32×32 WLED MATRIX that’s SOUND REACTIVE!
    https://www.youtube.com/watch?v=toxMDCoVebI

    Reply
  19. Tomi Engdahl says:

    All you need for WLED Sound Reactive Matrix using a Digital MEMs I2C Microphone
    https://www.youtube.com/watch?v=I50bpmIgZgg

    Reply
  20. Tomi Engdahl says:

    Inside 12v fixed colour LED sign pixels
    https://www.youtube.com/watch?v=DB5pqBZVcII

    Although I’ve featured the 5V version of these before I have avoided the 12V version because I thought they might just be the same as the 5V version with a higher value resistor. But they’re not.

    They use special higher voltage LEDs so the current per pixel is much lower than the 5V version for a given number of pixels. I took one apart to explore and took a look at the LED arrangement inside one of the LEDs.

    Reply
  21. Tomi Engdahl says:

    Three things to consider in your design:
    1- the channel count goes up like cray cray, do the math before you max out your board!
    2- they get really angry at voltage drop and doing power injection every 50ft isn’t quite enough for every setup. There are three main types of pixels: unregulated 12v, regulated 12v and the 5v ones. I won’t go off on this topic on here, but go read on that, you’ll see what each one’s strengths are but mostly what their weaknesses are

    3- ws2811 and ws2812b are the same thing protocol-wise. Ws2812b is technically an SMD5050 LED chip with the ws2811 chip built in, but nowadays they get used interchangeably for anything so just fyi, one or the other most likely doesn’t matter. I will say however that ws2811 LED strips usually means they have three pixels per address. Usually not the case with pixel strings like this.

    Bonus topic: look at ws2813 and ws2815 too. They bring some quite incredible stuff including but not limited to increased PWM refresh rate and LED bypass (a thing that allows the string to continue working even if one LED goes bad. Pretty cool stuff!)

    Most of all, ignore ws2801. It’s outdated at this point unless you’re doing something awfully specific.

    Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

*

*