Ebay led strings basics

Hi All,

anyone coded for this type of LED string LED String on ebay

I have downloaded several examples for various places and can't get any response. the pinout is gold wire = +5v, then GND, then data. reversed from the supplied controller. I chopped 4 LED's of the string and wired it up, changed the data pin in each example I downloaded to be PIN 3 but nothing.

Steve

At a glance I'd say many ppl have.

Post the code you tried that didn't work.

Post the schematic diagram of how you wired it, with attention to where power is supplied to the LEDs and by what.

Did they function as intended originally? That is to say did it work when you got them?

a7

OK, Not my code but taken from web and only changed the output pin to 3 + LEDs to 4

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

#define PIN 3

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino 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)
//   NEO_RGBW    Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel.  Avoid connecting
// on a live circuit...if you must, connect GND first.

void setup() {
  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket

  // End of trinket special code

  strip.begin();
  strip.setBrightness(250);
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  // Some example procedures showing how to display to the pixels:
  colorWipe(strip.Color(255, 0, 0), 50); // Red
  colorWipe(strip.Color(0, 255, 0), 50); // Green
  colorWipe(strip.Color(0, 0, 255), 50); // Blue
//colorWipe(strip.Color(0, 0, 0, 255), 50); // White RGBW
  // Send a theater pixel chase in...
  theaterChase(strip.Color(127, 127, 127), 50); // White
  theaterChase(strip.Color(127, 0, 0), 50); // Red
  theaterChase(strip.Color(0, 0, 127), 50); // Blue

  rainbow(20);
  rainbowCycle(20);
  theaterChaseRainbow(50);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
    strip.show();
    delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
  for (int j=0; j<10; j++) {  //do 10 cycles of chasing
    for (int q=0; q < 3; q++) {
      for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, c);    //turn every third pixel on
      }
      strip.show();

      delay(wait);

      for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}

//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
  for (int j=0; j < 256; j++) {     // cycle all 256 colors in the wheel
    for (int q=0; q < 3; q++) {
      for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, Wheel( (i+j) % 255));    //turn every third pixel on
      }
      strip.show();

      delay(wait);

      for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

figured out the wires by opening up the supplied controller, Gold wire = +5v, next along is GND then DATA.

External +5v supply from PSU to breadboard power rail, a common GND from Nano to same power rail. I can see power and data going to the string 4 led string using scope.

Hope this helps

Also tried these settings:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_RGB + NEO_KHZ400);
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_RGB + NEO_KHZ800);
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_RGBW + NEO_KHZ400);
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_RGBW + NEO_KHZ800);

No joy.

P.S. is there a good package for doing schematics that I can post on here?

found this one recently

Thanks for the additional information. I got nothing just now.

I assume you have a 5 volt Arduino, and that you've seen

And with your snipped version you are getting into data IN.

As for schematic packages, I prefer pencil and paper: take a photo and post it. Easiest, cheapest and fastest and you would have to know at least as much about how to make a schematic as when using a piece of software anyway, so good learning practice.

Especially for dinky projects.

a7

1 Like

those are sk6812 RGBW, i think you have to tell the library that is what they are (i think neopixel.h supports them, but i am not 100% sure)

Are you sure the Neopixel library work with your SK6812 LEDs? (I would assume so but I don't know.)

//   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)
//   NEO_RGBW    Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800);

You have RGBW LEDs so that should be -

Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_RGBW + NEO_KHZ800);

I don't know about the KHZ (if that library works at all).

Makuna works for sure

I had checked.

This

SK6812 is a variant of WS2812, it is very similar to WS2812B, they have the same interface and color order, so SK6812 LED strips and WS2812B LED strips can be chained together and used as a replacement in most applications

was what I went on. If WRGB was supposed to be RGB or whatever, I did not notice that, the strip should have done something, at least that's what I have seen. Crazy colours on the wrong pixels kinda stuff.

a7

Yes, normally you see something, I'm getting nothing :frowning: I did try RGBW and others as it is a quick compile / test

Ok maybe a better question is does anyone have code or link to code they believe would work with these. that will give us more confidence.

Just tried the FastLed library, still no joy. I simply cut the last 4 led of the strip and connected these to the Arduino, there is nothing wrong with that is there?

Thanks

normally not, as long as the data pin of the arduino actually goes to Din (not Dout)

as before, scan through the examples that come with makuna neopixelbus, and you shoud find something.

You still haven't posted a schematic.

Are you sure the data/power/ground wires are correct?

Does the supplied controller still work with the trimmed/short strip?

Are you sure the LEDs are 5V? I would assume so, especially if they are USB powered. 12V LEDs are usually addressed in groups of 3 and if you cut the strip/string in the wrong place they won't work (and of course they require 12V power).

Also the data passes-through the LEDs in series and there is active circuitry so if the 1st LED is blown and not passing data, none of the following LEDs will work.

...If it was me I'd order a NeoPixel (WS2812) strip from Adafruit (or another reliable supplier). If that works you'll know your Arduino set-up is OK and you'll know there is something wrong or something "different" or "unknown" with the Fairy lights.

1 Like

Are you sure the data/power/ground wires are correct? Yes, treble checked

Does the supplied controller still work with the trimmed/short strip? Yes

Are you sure the LEDs are 5V? I would assume so, especially if they are USB powered. 12V LEDs are usually addressed in groups of 3 and if you cut the strip/string in the wrong place they won't work (and of course they require 12V power). Yes, I checked the end of the working strip with no LEDS on and it's +5v

Also the data passes-through the LEDs in series and there is active circuitry so if the 1st LED is blown and not passing data, none of the following LEDs will work. I understand this but I have chopped of a second set of 4 and tested them, they still don't work


Sorry for the really bad diagram, it's a Arduino Nano powered by USB with a second PSU powering the LED's, the GND's are connected. the PSU is set to supply 1.5amp

Thanks

yes well that is not the motivation i was hoping for after posting the link to a schematic web editor.

Anyway, looking at the sk6812 datasheet and the ws2812 datasheet and comparing the protocol, i see significant differences between the 2 in timing, which should mean that the library you are using should be instructed to modify the data signal to these chips specifically. neopixel.h does not allow for that, maybe FastLED does, but it needs to be specifically told to do so.

@Deva_Rishi I cannot install programs on this PC atm and as people wanted a circuit I had to throw something together. The advert says "WS2812B sk6812" how do I determine which one it is if they behave differently? I have tried FastLed examples but again no joy.

nothing to install, you can simply use the webeditor.

the link you send only has sk6812's for me as an option.

but not makune neopixelbus ?

Just connected the 4 I cut off back to the original string and the four LEDS work fine, just as a sanity test.

Thanks for all your help so far.

OK more digging, stuck a logic analyzer on. attached are the outputs, flash if the original controller and white is code I have downloaded using noepixel.

First bit
High - 320ns
Low - 1.12us

white

First bit
High - 320ns
Low - 960ns

so the original has a bit length of 1.44 us and the FastLED generated one has a bit-length of 1.28 us, which is clearly a difference in protocol, and then there may still be a difference in frame-reset time.
the datasheet specifies 1.25 us bit-length (300ns + 900ns for '0' and 600ns + 600ns for '1') and the tolerances are quite big, but the frame reset time never is 80 us is the absolute minimum, so can you show me what code you've used for generating the signal ? I know neopixel.h uses 60 us always but just adding a delay(1) in the code between every .show(); may already fix that, though in my experience, the leds should light up at least once, but in most code that is the time you switch all of the LED's 'off'
actually looking at you code there is a 50ms delay between every show() already, there is no reason for this not to work.

1 Like