zarmory / doll-house-lights

Apache License 2.0
1 stars 1 forks source link

Can't control the strip #5

Closed haizaar closed 5 years ago

haizaar commented 5 years ago

Hi @jim-sokoloff ,

I finally got boards and the strip, but I fail to control it. Any ideas how can I further debug it? (I got BM235 multimter and that's all, no scope)

The wiring picture is below. I simplified the code down to the bare minimum, tried two different nano boards and it still no lights are coming up. Couple of things:

What have I tried:

Here is the minimal code that I use:

#include <Adafruit_DotStar.h>
#define NUMPIXELS 60 // Number of LEDs in strip

// Here's how to control the LEDs from any two pins:
#define DATAPIN    6
#define CLOCKPIN   7
Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println("Hello");

  strip.begin();
  strip.show();
  strip.setPixelColor(10, 255, 127, 0);
  strip.show();

}

void loop() {
  // put your main code here, to run repeatedly:
  strip.show();
  delay(50);
}

image

Here is the strip I use: https://www.aliexpress.com/item/32878004298.html, 60 leds/m, IP67 white PCB if that matter.

jim-sokoloff commented 5 years ago

It looks like you're maybe using pins D8 and D9 physically and D6 and D7 in the code. Hard to be sure with the picture...

jim-sokoloff commented 5 years ago

Sorry; zooming in more, it looks like it's a parallax thing.

jim-sokoloff commented 5 years ago

On the Aliexpress photo, it looks like maybe green is data in and yellow is clock in. Perhaps try switching those (or looking closely at the ones you have; I can't tell from your photo above which wires are going where).

jim-sokoloff commented 5 years ago

I also would not use two power supplies. Use just the computer power supply to drive the Nano, then pull power off the 5V and GND from there to the LED strips. You have two USB supplies in the mix and it's not clear if they're sharing a common ground potential (and even if they are, I don't like to see a USB supply "fighting" the output of the regulator on the Nano).

Edit: disconnect the braided USB supply.

jim-sokoloff commented 5 years ago

If none of that helps, post a clear shot of the flex PCB where the input power comes from (so I/we can see which color is going to which line on the APA segment).

haizaar commented 5 years ago

That's very interesting. I did all of what you suggest back on Sunday already. I figured out that common ground is a must. Then after your replies I checked everything again and still nothing helped.

Eventually, I decided to cut out a small strip of just 5 leds, solder 4-core wire to it and have a try. I thought maybe with my early tests something went wrong with the first LED and not it blocks traffic to the rest.

With the new stip it worked! I cut of the first led, resoldered the strip of 50 and they all worked! I reprogrammed nano it to drive just a single led and tried again with that originally-first led and it didn't work as assumed.

So here I have it. All good! I even managed to write some moving rainbow code. In action: https://www.youtube.com/watch?v=Dl4kCLGTWSw

Still, I wonder what could've gone wrong with that first led - I only plugged usb-sourced power, and my usb wart does not have quick-charge, so no way it could've zapped it with 9 volts or something. Do you have any ideas? Could have reverse polarity kill it?

Thanks again for your help!