Go Down

Topic: LEDs will not light up on their own (Read 377 times) previous topic - next topic

DJSammit

Hello all,

I'm working on my first Arduino project trying to setup ambilight for my monitor. I've read countless forums here and elsewhere on google but have come to a point where I am completely out of ideas and looking for help sparking a new one!

Configuration
My project is setup using the following configuration.

Hardware:
Power Supply - https://www.amazon.com/gp/product/B0131ZJIPS/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
LEDs - https://www.amazon.com/gp/product/B01H04YAHW/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1
Arduino Uno - https://www.amazon.com/gp/product/B01AR7YJ3O/ref=oh_aui_detailpage_o07_s00?ie=UTF8&psc=1

Software:
Ambibox screen capturing software
Arduino IDE (I've tried countless sketchs that I've found through the internet that are supposed to work with ambibox, but have also tried a sketch that is just supposed to "rainbow" the LEDs)

Wiring:
I have closely followed the configuration as shown in the below wiring diagram except I am providing no resistor for the data cable, and am connecting on pin 3 instead of pin 6: https://www.tweaking4all.com/wp-content/uploads/2014/01/arduino_no_computer_power.jpg

You may be thinking the power supply is overkill but I got it from a friend cheap (also brand new) and I plan to expand my project to have LED's supplied in the entire room...


Troubleshooting
As for troubleshooting that I have already done... I have a multimeter that I have run many tests on.
  * A continuity test on the LED strip proving that my +5V, data, and GND connections are good through the entire strip. All were good except the data which failed the continuity test from one end to the other. I think this is expected as it passes when I test the data-in to an LED and then the LED to data-out. I assume this behavior is due to the LEDs are 'off' during a continuity test.
  * A continuity test from the Arduino to the start of the LED strip to ensure my data connection was solid through to the LEDs
  * A voltage test showing that my power supply is providing 5V at the source, all the way through the end of the LED strip, and to the Arduino uno.

Based on those tests, I can assume that all of my connections are solid and all are receiving the expect 5V of power (although wattage/amperage is unknown but I expect to be satisfactory considering the PSU is rated for 350W).


Results:
As stated earlier I have tried this with multiple different sketchs uploaded to my arduino. All provide the same result...

When I power up the unit, I can see the Arduino turn on and the power supply turn on as well. This is also the point when I can successfully get a 5V reading through my LED strip - so i assume they are also 'on'. However, none of the lights actually turn on. Initially, I thought my data connection on the first LED was bad so I experimented a bit and soldered a wire to the data-in and connected that to pin 3 on the arduino. When I do this, the LED behind it (in this case the very first LED on the strip) lights up with mostly blue, a little bit of green, and no red but is VERY dim. Noticing this, I moved my data cable to the 4th LED data-in. This time LED 3 lit up with the same pattern (also very dim). From this, I am assuming that my LEDs work, but there is a miscommunication on how they should be turned on - IE something is wrong with my data connection.

I don't know where to go from here or how else to even troubleshoot this. Has anyone run into a similar problem before? Any potential ideas will help and even if it doesn't fix the issue, might help me continue troubleshooting... But for now, I am completely stuck and don't know how to proceed. Thanks in advance :)

Grumpy_Mike

Work with just one code, the simplest you can write. Then post that code and please read this:-
How to use this forum so you post it correctly. Then we can work on something specific rather that the airy fairy "I've tried countless sketchs"

Quote
I am assuming that my LEDs work,
No you can not make that assumption from that test. I have a completely blown strip where some LEDs light up and others do not, but they are all screwed.

DJSammit

Thanks for the reply! I am very new to any sort of software for LEDs so I spent a bit of time looking into this. I know I may have "over-functioned" up this code but I was experimenting with a couple different things that I could do and just left the functions in. In this example, I'm basically just trying to get all the lights to turn white with FastLED.

Code: [Select]
#include "FastLED.h"
#define NUM_LEDS 300
CRGB leds[NUM_LEDS];
#define PIN 3

void setup()
{
  FastLED.addLeds<WS2811, PIN, GRB>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  setAll(256,256,256)
}

void loop() {
  //nothing to loop on
}

void showStrip() {
   FastLED.show();
}

void setAll(byte red, byte green, byte blue) {
  for(int i = 0; i < NUM_LEDS; i++ ) {
    setPixel(i, red, green, blue);
  }
  showStrip();
}


When I do this, I see a few lights flash on the arduino after the upload completes, but nothing changes on the LED strip. I have data connected to pin 3 on the arduino and touching the start of the LED strip. Because of this, I get the same behavior as before where the very first LED is lit up with mostly green and blue but is very dim. I have attached a screenshot to show what I have done - keeping the setup as simple as possible (which is why there are some additional wires attached but not connected to anything).


Also I should add, the only reason I assume the LEDs work is because I've tested the first ~10 and then randomly down the strip and never found one that didnt behave the exact same way. Even if it were broken half way down, wouldn't the ones 'before' it still light up? Also, I keep that assumption because of my continuity testing on all three cables.

PaulRB

#3
Sep 10, 2017, 08:44 am Last Edit: Sep 10, 2017, 09:11 am by PaulRB
You code above is incomplete. Please edit the post and fix that.

Also, your code appears to be specifying ws2811 but your strip is ws2812b.

Check the strip for arrow symbols printed on the strip near the data connections, possibly on the back. Which direction are they pointing? Towards the reel or towards the free end of the strip.


Grumpy_Mike

Well that link https://www.amazon.com/gp/product/B01H04YAHW/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1 does say it is a
Quote
Mokungit 16.4FT 5M WS2812B Individual Addressable WS2811 Built-in 5050 RGB Digital Dream color Flex 60Pixels/m 300Pixels White PCB Non-waterproof IP20 DC5V Programmable LED Strip Light
So the confusion is understandable. Reading the rest of the page it looks like the vendor is trying to leverage the popularity of the WS2812b strips to shift some old stock.

Not too sure I can see a common ground and capacitor.

Quote
because I've tested the first ~10 and then randomly down the strip and never found one that didnt behave the exact same way.
Stop doing that, I think you could very well be damaging them by this "testing". If you apply a signal to the input of an LED in the middle of the strip you are also applying that signal to the output of the previous LED. Two outputs connected together is a great way of destroying components.

PaulRB

Quote
Reading the rest of the page it looks like the vendor is trying to leverage the popularity of the WS2812b strips to shift some old stock.
I don't think so in this case, Mike. If you look at the next to last image on the ebay page, and the OP's pic, there is no sign of the separate ws2811 chips mounted on the strip.

Grumpy_Mike

Yes Paul I think you are right it does look like a WS2812b.

The timings are different between the two chips so selecting the correct driver may make things work.

DJSammit

Okay I made the modifications as you suggested above.

Quote
Also, your code appears to be specifying ws2811 but your strip is ws2812b.
I have made this change, please see my new code below. I also changed up the format and added an additional loop to "blink" the lights with the idea that maybe sending them different signals would help.

Code: [Select]
#include "FastLED.h"

// fast led constants
#define DATA_PIN    3
#define COLOR_ORDER GRB
#define NUM_LEDS    300

#define LED_TYPE    WS2812B

// this creates an LED array to hold the values for each led in the strip
CRGB leds[NUM_LEDS];

void setup()
{
  FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
}

void loop()
{
  for(int i = 0; i < NUM_LEDS; i++ ) {
    leds[0] = CRGB::Red;
    FastLED.show();
  }
  delay(500);
 
  for(int i = 0; i < NUM_LEDS; i++ ) {
    leds[0] = CRGB::Black;
    FastLED.show();
  }
  delay(500);
}



Quote
Check the strip for arrow symbols printed on the strip near the data connections, possibly on the back. Which direction are they pointing? Towards the reel or towards the free end of the strip.
I checked the arrows right when I got them. They are currently pointing away from the power source; aka towards the reel.

Quote
Not too sure I can see a common ground and capacitor.
I'm not 100% sure what I should do for this. But I have connected the ground of the power supply to the ground on the Arduino (as many places have said without this you could experience "blinking" unexpectedly) but when I add that, nothing changes.

Quote
Stop doing that, I think you could very well be damaging them by this "testing". If you apply a signal to the input of an LED in the middle of the strip you are also applying that signal to the output of the previous LED. Two outputs connected together is a great way of destroying components.
Thanks for the tip. I did not think of that and have stopped testing as such.


With all of this I am still getting the exact same result. I could send another picture but it would look identical to my last attachment. Thanks for being patient with me as I am so new and have been in and out on business for the last few weeks. Any other ideas?

Grumpy_Mike

OK this is very strange. Today I upgraded the IDE to version 1.8.4 and I could not get your code to work. I tried some previously written code and it did work. However this code was for driving two strips. When I took out the code to drive the second strip it would not work. I couldn't find out why, simply commenting out the unused strip stopped it from working. Anyway here is the code that works, just ignore the other strip.
Code: [Select]

#include "FastLED.h"

#define NUM_LEDS_PER_STRIP1 6
#define NUM_LEDS_PER_STRIP2 6
#define COLOR_ORDER GRB

// define the pins each strip will use
#define data1 3
#define data2 11
// set up the arrays for the strips
CRGB leds1[NUM_LEDS_PER_STRIP1];
CRGB leds2[NUM_LEDS_PER_STRIP2];


// For mirroring strips, all the "special" stuff happens just in setup.  We
// just addLeds multiple times, once for each strip
void setup() {
  // tell FastLED about strip 1
  FastLED.addLeds<NEOPIXEL, data1>(leds1, NUM_LEDS_PER_STRIP1);

  // tell FastLED about strip 2
  FastLED.addLeds<NEOPIXEL, data2>(leds2, 0, NUM_LEDS_PER_STRIP2);
}

void loop()
{
  for(int i = 0; i < NUM_LEDS_PER_STRIP1; i++ ) {
    leds1[i] = CRGB::Red;
  }
      FastLED.show();
  delay(500);
 
  for(int i = 0; i < NUM_LEDS_PER_STRIP1; i++ ) {
    leds1[i] = CRGB::Black;
  }
  FastLED.show();
  delay(500);
}


It should flash the first 6 LEDs on and off.

Grumpy_Mike

#9
Sep 17, 2017, 01:46 am Last Edit: Sep 17, 2017, 01:51 am by Grumpy_Mike
OK seems like I was running an old version of FastLED. I was running 3.0 not the latest 3.1. When I did run 3.1 then I did not need the second phantom strip. This now works, for a test see if it does with your setup:-
Code: [Select]

#include "FastLED.h"

#define NUM_LEDS_PER_STRIP1 6
#define COLOR_ORDER GRB

// define the pins each strip will use
#define data1 3

// set up the arrays for the strips
CRGB leds1[NUM_LEDS_PER_STRIP1];

// For mirroring strips, all the "special" stuff happens just in setup.  We
// just addLeds multiple times, once for each strip
void setup() {
  // tell FastLED about strip 1
  FastLED.addLeds<NEOPIXEL, data1>(leds1, NUM_LEDS_PER_STRIP1);

}

void loop()
{
  for(int i = 0; i < NUM_LEDS_PER_STRIP1; i++ ) {
    leds1[i] = CRGB::Red;
  }
      FastLED.show();
  delay(500);
 
  for(int i = 0; i < NUM_LEDS_PER_STRIP1; i++ ) {
    leds1[i] = CRGB::Black;
  }
  FastLED.show();
  delay(500);
}



EDIT - The code you posted if you change the two instances of:-
Code: [Select]
leds[0]
to
Code: [Select]
leds[i]
it should work if your hardware is OK.

DJSammit

Thanks again for the reply... However, unfortunately it is still not working. Just for clarification I'll add my code again here exactly as uploaded:

Code: [Select]
#include "FastLED.h"

// fast led constants
#define DATA_PIN    3
#define COLOR_ORDER GRB
#define NUM_LEDS    300

#define LED_TYPE    WS2812B

// this creates an LED array to hold the values for each led in the strip
CRGB leds[NUM_LEDS];

void setup()
{
  FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
}

void loop()
{
  for(int i = 0; i < NUM_LEDS; i++ ) {
    leds[i] = CRGB::Red;
    FastLED.show();
  }
  delay(500);
 
  for(int i = 0; i < NUM_LEDS; i++ ) {
    leds[i] = CRGB::Black;
    FastLED.show();
  }
  delay(500);
}


Also for clarification I'll add what the Arduino IDE outputs:

Code: [Select]
Build options changed, rebuilding all
In file included from C:\...\Arduino\sketch_sep16b\sketch_sep16b.ino:1:0:

C:\...\Arduino\libraries\FastLED/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.006

 #    pragma message "FastLED version 3.001.006"

                     ^

Sketch uses 3768 bytes (11%) of program storage space. Maximum is 32256 bytes.
Global variables use 997 bytes (48%) of dynamic memory, leaving 1051 bytes for local variables. Maximum is 2048 bytes.


My Arduino IDE is 1.8.4 as shown at the top of the sketch windows and when I click Help --> About Arduino

Something that seems more odd, in the above message it says "FastLED version 3.001.006" but when I go to Sketch --> Include Library --> Manage Libraries... and filter FastLED it says that version 3.1.6 is already installed. Not sure if this is an issue?

Either way, using your example as a guideline I tried the double strip code as well (changing my led type to WS2812B of course) and I still see no change.

Sounds to me then, that some hardware has gone bad... Any suggestions on how to know what it is/where it is/why it happened? Or just where to go from here

Grumpy_Mike

Quote
Not sure if this is an issue?
No it did that on my setup where he code worked.

If you tried the code as I posted it and it does not work then it is either your LEDs gone faulty or he way it is wired up.

DJSammit

Okay, thanks to Amazon's free same-day delivery these should be arriving sometime tonight: https://www.amazon.com/gp/product/B01CDTELBE/ref=ya_st_dp_summary?ie=UTF8&psc=1

I hope that these are a little less "sketch" lights and are WS2312b as the title and description say. They're the waterproof kind which I didn't need, but were actually cheaper  :-X

Ill post again once I have it all setup and see if I finally have light!

DJSammit

#13
Sep 20, 2017, 12:55 am Last Edit: Sep 20, 2017, 01:07 am by DJSammit
The LEDs have arrived and they turn on! Well... kind of.

About the first 75% of them have turned on. I have uploaded that sketch that I last posted here and the results are bizarre. Basically the lights look like they are about to start a rainbow effect but only about the first 25 LEDs actually rainbow. The rest of them just stay a solid color (or are just off). I also noticed that the very first LED stays white no matter what I do. Even when no data cable is connected, that first LED stays white and the rest stay off.

If I adjust my sketch to a lower LED count, lets use 6 as the example, it will reduce the amount that rainbow but it still wont rainbow the first 6 LEDs... It rainbow's about the first 4.

I have attached a picture to show what it looks like. Obviously since it's only a picture you can't see the rainbow effect but the only lights that are changing colors are the ones on the line coming out of the reel. By the time the reel starts curving back under itself, those lights are all stuck solid.

One more thing to add. I have tried both data pins 3 and 6 and they both have the same effect. Also, when everything gets all powered up, the lights don't all come on right away. It takes a few seconds before the LEDs closer to the middle of the reel start to turn on but they do eventually (minus the ones that are shown as black in my attachment).

Is there now something wrong with my Arduino?  :o



EDIT: I noticed that my sketch was still using GRB and these lights are RGB. I changed that and noticed no difference however, now when I change my number of LEDs to 500 (instead of 300 which is what is actually on the strip) all the lights at least rainbow that are turned on. However, they ones that were off before are still off and the lights are still rainbow'ing even though my code has them all just turn to a solid red...

PaulRB


Go Up