Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: lmal on Jan 11, 2019, 07:55 am

Title: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: lmal on Jan 11, 2019, 07:55 am
Hi all!

First time poster so please feel free to give me feedback on the clarity of my question.

I have purchased 2 sets of SK6812 Mini LEDs from 2 different suppliers for a project that I am working on. Unfortunately, both sets of LEDs are behaving in a manner that seems to contradict the datasheets that I have been provided.

This is a screenshot from a datasheet that I have been using:
(https://i.imgur.com/Vg12Leb.png)

This is the code I have been using (tried on both a Arduino Uno "Freetronics" knock-off and a Arduino Mega 2560)
Code: [Select]
#include <Adafruit_NeoPixel.h>

#define PIN 8

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  // put your setup code here, to run once:
  strip.begin();
  strip.setBrightness(10);
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  // put your main code here, to run repeatedly:
  strip.setPixelColor(1, strip.Color(255, 0, 0));
  strip.setPixelColor(0, strip.Color(255, 0, 0));
  strip.show();
  delay(1000);
 
  strip.setPixelColor(1, strip.Color(0, 255, 0));
  strip.setPixelColor(0, strip.Color(0, 255, 0));
  strip.show();
  delay(1000);
}


I wired up a test LED according to the datasheet:
(https://i.imgur.com/7ttrlPI.jpg)

And connected it to the Uno using the guidelines given on this website for NeoPixels (https://learn.adafruit.com/adafruit-neopixel-uberguide/powering-neopixels) i.e. capacitor between the voltage and ground connections, resistor in series on the data signal and got nothing.

I then tried seeing if I had perhaps mixed up the pins while soldering and noticed something odd. If I connected the "DOUT" pin to the 5V and left the "VDD" pin unconnected, the LED behaved exactly how I expected (correct colour and delays as per the above code). Setup below (apologies for wires going everywhere):
(https://i.imgur.com/CzYrUfT.jpg)

So I then thought that maybe the "DOUT" and "VDD" pins have been mixed up and that I would just have to wire in accordance to this pinout:
(https://i.imgur.com/lyBXaqh.png)

But I did this to no avail. The 2nd LED in series does not respond to any commands issued from the "DOUT" pin (originally VDD) if I assume the above pinout is correct.

I'm at a loss now as to what the problem could be. I have already received my custom PCBs that I was hoping to wire the LEDs onto but if the pinouts aren't matching what I thought they would be the PCBs are more or less useless. As I stated earlier, this is the second order of LEDs that are behaving like this so I'm almost certain it is something I am doing rather than a problem with the datasheet but I can't figure out what.

Please let me know if you think you can help or need anymore information! Thanks  :)
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: Grumpy_Mike on Jan 11, 2019, 10:59 am
Sorry but the pictures have insufficient resolution for be to check you have it right. But one thing puzzles me, why is the Dout connected to anything? For just one LED it should be not connected to anything.

Also each LED requires a 0.1uF ceramic across it does it not?
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: lmal on Jan 11, 2019, 11:12 am
Hi Mike,

Thank-you for your response. Sorry I should've made myself clearer, once I decided that the pins may be a different pinout to what I was expecting I tested the possible "DOUT" pin (actually VDD on the datasheet) with a LED that I have already soldered onto my PCB (with the 0.1uF ceramic capacitor across the VDD and GND terminals). LED2 did not work in this configuration (i.e. the data signal did not seem to go from Uno -> LED1_DIN -> LED1_DOUT -> LED2_DIN), but both the LEDs work if I just give them data direct from the Uno.

Does this make sense? I can take some more photos if that would be helpful?
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: Grumpy_Mike on Jan 11, 2019, 06:24 pm
Quote
the data signal did not seem to go from Uno -> LED1_DIN -> LED1_DOUT -> LED2_DIN), but both the LEDs work if I just give them data direct from the Uno.
That suggests you are doing something wrong. You need to look at the Dout on an oscilloscope to see what sort of waveform you are getting, but I guess you haven't got access to one.

Quote
So I then thought that maybe the "DOUT" and "VDD" pins have been mixed up and that I would just have to wire in accordance to this pinout:
Din and Dout are at opposite corners as are 5V and ground. They have to be like that to make connecting them on a strip work.
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: lmal on Jan 11, 2019, 09:57 pm
I have tried to substitute an oscilloscope by using regular "breadboard" (for want of a better term) LEDs connected at the +ve pin to data and -ve pin to ground.

The LED that is connected to the data out from the Uno is flickering at intervals consistent with the colour changes written in the code (so I think this is what I want from a DOUT pin?). The second LED that is wired up after DOUT (VDD originally) is not flickering but is just on?
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: Grumpy_Mike on Jan 11, 2019, 11:15 pm
Quote
the data out from the Uno is flickering at intervals consistent with the colour changes written in the code
Sorry but there is no way you can tell that from looking at a flickering LED. The data is going at 800KHz, anything above 60Hz just looks like it is on all the time.

Sorry but I don't know what else to advise.
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: lmal on Jan 11, 2019, 11:29 pm
Sorry I should've been clearer - the LED was flickering on/off at 1000ms intevals (everytime the colours on the SK6812s changed).

That is okay, thankyou very much for your help thus far. I will update if I come to a solution.
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: lmal on Jan 13, 2019, 07:57 am
Update: found the problem! The solder had not actually created a connection between the VDD pin and the pad. Should've checked my soldering more thoroughly before posting - thanks for the help regardless Mike :)
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: Grumpy_Mike on Jan 13, 2019, 08:07 am
OK glad you got it going.

That sort of thing might have been spotted with a photograph but is trick to spot with just words.
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: lmal on Jan 13, 2019, 09:17 pm
Will keep that in mind for next time! Cheers
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: shubham90 on Jan 14, 2019, 02:06 pm
The SK6812 is a set smart control circuit and one of the controlled LED source. The LED has a low driving voltage which allows for environmental protection and energy saving, high brightness, good consistency, low power, and long life.
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: Paul__B on Jan 14, 2019, 03:56 pm
The SK6812 is a set smart control circuit and one of the controlled LED source. The LED has a low driving voltage which allows for environmental protection and energy saving, high brightness, good consistency, low power, and long life.
And - your point is?  :smiley-eek:

Update: found the problem! The solder had not actually created a connection between the VDD pin and the pad.
Compared to the WS2812 devices that seem to burn out at "the drop of a hat", you seem to have demonstrated a most impressive robustness of this particular device!  :smiley-cool:
Title: Re: Trouble with SK6812 Mini LEDs (Datasheet pinout not matching behaviour)
Post by: Grumpy_Mike on Jan 14, 2019, 04:44 pm
Quote
And - your point is?
Well I thought it was a poor attempt at spam.