Go Down

Topic: Weird issues at controlling leds (Read 1 time) previous topic - next topic

anonymousse37

Hi,

I have noticed some issues by controlling leds

I have a matrix of leds 9*7, see the pic bellow



Here is the code i'm executing.
Code: [Select]

#include <FastLED.h>

//TEENSY 2.0 PINS
#define DATA_PIN 2
#define CLOCK_PIN 1

#define NUM_LEDS 63
CRGB leds[NUM_LEDS];

void led_set_color_strip( int Red, int Green, int Blue )
{
  int i;
  for ( i=0 ; i<NUM_LEDS ; i+=1)
  {
    leds[i] = CRGB( Red, Green, Blue), delay(100), FastLED.show();
    leds[i] = CRGB( Red, Green, Blue)            , FastLED.clear();
  }
}

void setup()
{
  // put your setup code here, to run once:
  FastLED.addLeds<WS2801, RBG>(leds, NUM_LEDS);
  led_set_color_strip(0,0,255);

}

void loop()
{
  // put your main code here, to run repeatedly:

}


I go throught all led, turning them on then off one by one. Working.

Now if i want all the led to be turned on at the same times, will not work. Colors are not respected, it flashes, and not all the leds are lighted up, it stops like half the way maybe less, depends in matter fact, its pretty random.

Code: [Select]

#include <FastLED.h>

//TEENSY 2.0 PINS
#define DATA_PIN 2
#define CLOCK_PIN 1

#define NUM_LEDS 63
CRGB leds[NUM_LEDS];

void led_set_color_strip( int Red, int Green, int Blue )
{
  int i;
  for ( i=0 ; i<NUM_LEDS ; i+=1)
  {
    leds[i] = CRGB( Red, Green, Blue), delay(100), FastLED.show();
    //leds[i] = CRGB( Red, Green, Blue)            , FastLED.clear();
  }
}

void setup()
{
  // put your setup code here, to run once:
  FastLED.addLeds<WS2801, RBG>(leds, NUM_LEDS);
  led_set_color_strip(0,0,255);

}

void loop()
{
  // put your main code here, to run repeatedly:

}


What do you think the problem could be ?
-The PSU is 5V 8A so should manage 63 LEDS easy.
-Wiring problem

Kind regards.


Grumpy_Mike

Have you got a large capacitor across the strip's supply?
Does it have a common ground to the Arduino?
Have you got a seriese resistor in the strip's data line?
Lack of one or more of these things can give you this trouble.

PaulRB

Try:
Code: [Select]
void led_set_color_strip( int Red, int Green, int Blue )
{
  int i;
  for ( i=0 ; i<NUM_LEDS ; i+=1)
  {
    leds[i] = CRGB( Red, Green, Blue);
  }
  FastLED.show();
}

anonymousse37

Only 18/63 LEDs are lighting up =(

larryd

As Mike mentioned:
is your cct. similar to this?

No technical PMs.
The last thing you did is where you should start looking.

PaulRB


anonymousse37

I mean the first 18/63 leds.

Yes except i do not have the resistance nor the capacitor.

It might be the problem ?

My ambilight was working with 150 Leds and i never had this issue. No resistance, no capacitor.



Does it feet ?
https://www.amazon.fr/gp/product/B00GONYALM/ref=ox_sc_act_title_1?smid=A368I6KXHKTBPA&psc=1
https://www.amazon.fr/gp/product/B01JU9T2NW/ref=ox_sc_act_title_2?smid=A2Q05A87W9HIAW&psc=1

Any idea what i require to fix properly the teensy 2.0 to a breadboard ?
https://www.amazon.fr/Neuftech%C2%AE-Breadboard-Solderless-Compatible-puissance/dp/B00QV7NXCS/ref=sr_1_5?ie=UTF8&qid=1494878124&sr=8-5&keywords=breadboard

Thank you for your help.

PaulRB

My ambilight was working with 150 Leds and i never had this issue. No resistance, no capacitor.
Maybe you were lucky before. There is no point wasting time trying find other causes of your problems until you have added the cap and resistor.

Does it feet ?
Feet?

Please read the "please read" post to find out how to post links correctly on this forum.

Any idea what i require to fix properly the teensy 2.0 to a breadboard ?
Solder some pcb header pins to the teensy.

anonymousse37

Meant fit not feet xD
I tried to solder once and i burnt the teensy's pcb =)
What tools should i use to do so ? Maybe my soldering tools were inapropriates.

PaulRB

#9
May 15, 2017, 10:27 pm Last Edit: May 15, 2017, 10:34 pm by PaulRB
Like this.


I use a 1mm tip on a temp controlled iron and 0.5mm solder wire.

anonymousse37

humm well done. Do you the "english name" for the "pin strips" i have to search for ? I dont have this anymore and i need to buy some more xD

PaulRB


anonymousse37


anonymousse37

Hi,

Where can i compute the right values for the resistance and the capacitor since its working on 5V DC, 63 Ws2801 LEDS in series = 2.709 A ?

Kind regards.

Grumpy_Mike

Quote
63 Ws2801 LEDS in series
Really?

If you had 63 LEDs in series each one taking 20mA the whole lot would take, well, 20mA.
However with 2.0 Volts across each LED then you would need 126 Volts at least. 

Go Up