Go Down

Topic: RGBW LED Strip with generic controller (f.e. SK6812RGBW) (Read 13879 times) previous topic - next topic

MegaFan

From my other RGBW LED strip post it seems that there is some need for RGBW sample sketches, so I splitted this into a new thread for generic RGBW types (my UCS2912-based is a very special one).

1st a note: RGBW LEDs might draw up to 80mA with all colors + white at full brightness! That means that a 60-pixel strip can draw up to 60x 80 = 4800mA, so you should use a 5A power supply; for a 144-pixel strip its max 11520mA = 12A power supply!

Unfortunately the tutorials for Neopixel and the Adafruit Neopixel library do not cover yet RGBW pixel strips, but basically they are worth to read ...
A commonly used RGBW chip type is the SK6812RGBW; I've googled for it and found the SK6812RGBW datasheet which suggests that this type is already fully supported by the recent Adafruit Neopixel library because each RGBW LED has its own chip onboard like the WS281x ones - its just a matter of correctly setting up the strip in the sketches ...; based on feedback and testing with my own SK6812RGBW-based strip it seems that SK6812RGBW-based strips work fine with the NEO_GRBW pixel type ...

Find attached 3 sample sketches ...
test_rgbw: just switches RED, GREEN, BLUE, WHITE_LED each for 5 sec. on (in this order)
simple_rgbw: derived from simple sketch which comes with the Neopixel library with some addons
strandtest_rgbw: derived from strandtest sketch which comes with the Neopixel library with some addons

BTW. the sketches are still small enough to also run on an ATtiny85 ...
These sketches also still run fine with RGB strips if you only change the NEO_PTYPE define.

Please give some feedback if the sketches work for you (probably also with other strip types) or not!

lohjianhui

hi,

Thank you for these sketches and library hack for the adafruit neopixel library. Unfortunately, as you mentioned, it was a blind attempt since you did not have the sk6812 to test it on. I tried using your sketches on the sk6812 and was not able to get the colours I wanted.

I used NEO_GRBW and when I tried doing a colorSet on the entire strip with a colour such as Color(127,0,0,0), I got red, blue, green pixels instead in a repetitive pattern. It is very puzzling. I tried all the combinations of NEO_RGBW, NEO_WGBR, etc and still wasn't able to get a single color.

I tried running all the sketches you made for the sk6812 and got random color results.

I am familiar with the ws2812b and have programmed on it successfully using the same adafruit library, so I am sure I got my connections and wiring correct.

I tried looking at the sk6812 spec sheet and they mentioned that the 32 bit color code is RGBW in that order of bits. So does it mean that the strip should be set to NEO_RGBW?

Also, I tried looking at the header file for the neopixel library and I don't understand the explanation on how the bits are shifted for various configurations.

The China shenzhen vendor says that the neopixel library should be able to support the sk6812 fully but he didn't give any further details on how to the adapt the library.

Any clues would be appreciated.


MegaFan

Unfortunately, as you mentioned, it was a blind attempt since you did not have the sk6812 to test it on.
While that was true at the time when I hacked the 1st versions of these sketches, I got already private feedback that they work properly with a strip from mikki1211 even before I wrote this post here, and some days later I got self a SK6812-based strip and the sketches work with this strip too unchanged.
I've just removed this misleading phrase since it was a c&p leftover.

I used NEO_GRBW and when I tried doing a colorSet on the entire strip with a colour such as Color(127,0,0,0), I got red, blue, green pixels instead in a repetitive pattern. It is very puzzling. I tried all the combinations of NEO_RGBW, NEO_WGBR, etc and still wasn't able to get a single color.
that sounds exactly like what I saw with my UCS2912-based strip, you can try the sketches attached to this post and see if they work better ...
I am familiar with the ws2812b and have programmed on it successfully using the same adafruit library, so I am sure I got my connections and wiring correct.
no doubt - if the pixels do something then the wiring should be correct since its only one pin  :)
But make sure that you use latest library version - older ones had errors with RGBW support.

I tried looking at the sk6812 spec sheet and they mentioned that the 32 bit color code is RGBW in that order of bits. So does it mean that the strip should be set to NEO_RGBW?
I thought that too when reading the datasheet (and indeed my 1st real blind hack used RGBW), but it quickly showed that at least for mikki1211's and my SK6812-based strips GRBW is the right setting - probably either the datasheet is wrong, or the library does handle this wrong, whatever ...

perhaps your strip is not SK6812-based; can you disconnect the strip after each single LED, or only after every 3rd? Do you have a picture of the strip? Can you see that it is really RGBW =  4 LED chips combined? Did you try to use it just as a RGB type (with GRB setting)?

Also SK6812 does not necessarily mean that it is a RGBW (32-bit) strip - if you search for SK6812 you will also find other SK6812 strip types which seem to be 24-bit like RGB-only, white-only (with 3 different white LEDs like cold white + warm white + amber), etc.; f.e.:
SK6812 RGBW (32-bit, looks very close to the one I got),  SK6812 RGB (24-bit is mentioned in description),  SK6812 RGB (another one, 24-bit is mentioned in description),  SK6812 WWA
these show that the SK6812 does not always control 32-bit strip types but also 24-bit types ...

Edit: just found that there exist both a SK6812RGBW 32-bit type and a SK6812RGB 24-bit type which now explains all ...

lohjianhui

It is working now. I forgot to connect the ground of my Arduino to the ground of my power supply for the LEDs, so the data signal had no common  ground reference with respect to the power, thats why my lights were flickering and displaying random colours. My bad.  :-[

And yes, the SK6812 I got are the RGB type, not RGBW. I used the NEO_GRB and it works perfectly.

josh38

The data sheet for the UCS2912 describes how the RGB pins are addressed within the data protocol which is a Return To Zero (RTZ) 3 bit pattern for each data bit.  The USC2912 can control 4 RGB LEDs.
Sent as RGB1 RGB2 RGB3 and RGB4 to the device makes sense if there aren't any white LEDs.  In reality the ordering of the LEDs on these tapes is quite different than just RGBW.  The LEDs are mixed around a bit.

MegaFan

The data sheet for the UCS2912 describes ....
From what I see the link you provide here is from a RGBW LED datasheet and not about the UCS2912 which I know only as external chip; see my other post for the real UCS2912 datasheet; also if you want to talk about the UCS2912 then I think your post would fit better to that thread.

geedon

Hi, thanks for this but I do seem to have an issue. I can't declare more than 460 LEDs otherwise the sketch does not work. I've got 2 x 5 meter strips running off a 30A 5V power supply. Works a treat if I use 460 or less. Any ideas?

geedon

Hi, thanks for this but I do seem to have an issue. I can't declare more than 460 LEDs otherwise the sketch does not work. I've got 2 x 5 meter strips running off a 30A 5V power supply. Works a treat if I use 460 or less. Any ideas?

My bad, its a memory limit on the arduino Unu each LED takes up a lot of memory! Check out this article for more info

https://learn.adafruit.com/memories-of-an-arduino/you-know-you-have-a-memory-problem-when-dot-dot-dot

mkjohnson1952

one note since its been a long time anyone posted on this topic.
Adafruit has a new neopixel library, last modified in 8/17. This library supports the RGBW sk6812's. First time connected and it worked great.

ChangchungLeds

Hi guys, I just get the library and everything, I first use a genuine one arduino with 30 sk6812 and work just perfect, then I try with a nano arduino, after select the correct board and com I have this message when try it to upload the same files that I use before:

Arduino: 1.6.6 (Windows 7), Board: "Arduino/Genuino Uno"

avr-g++: error: missing filename after '-o'

exit status 1
Error compiling.
avr-g++: error: missing filename after '-o'

exit status 1
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.


Can someone help me please???

Go Up