help regarding LED matrix project

Totally perplexed! :confused:

I just told you.

it sends it so fast that it exceeds the refresh rate of the strip.

Add a delay after the ledstrip.show call. A value of 100mS will be enough.

Hi Mike

Did that right now, adding delay....no use...only the first led is responding to the code....the 2nd, 3rd and the 14th led are constant blue....was just trying FastLED library now...

Used this code using FastLED library:

#include<FastLED.h>

#define numled 3

#define datapin 2

#define clockpin 3

CRGB leds[numled];

void setup() {

  FastLED.addLeds <APA102, datapin, clockpin>(leds,numled);
}

void loop() {
  for(int dot=0;dot<numled;dot++){
    leds[dot]=CRGB::Yellow;
    FastLED.show();

    leds[dot]=CRGB::Red;
    delay(1000);
  }
}

The result: Only the first led keeps blinking from Red to Yellow.....no effect on others.

I am inclined to conclude that the strip is defective.......can't see anything else.....Any other views?

Thanks

Any other views?

Check the connections between the first and second LEDs.
Add a capacitor across the LED's power supply. About 100uF should do.
Add a 470R resistor in line with the data and clock signal.

Check the data and clock signal with an oscilloscope both on the input to the first LED and the second.

I also powered the strip through a Digital Power supply (5v limit) and in both of the cases,

Do not connect the two +5V supplies together, power the LEDs with the external supply and do not connect the +5V to the +5V on the Arduino. However the ground of the Arduino and the ground of the external power supply must be connected together.

Hellooooooo Mike (lol very happy......and relieved)

Found the error - The strip was defective....I ordered another APA102 led strip (this time 60led/meter) and it worked like a charm!!!! Tested all the libraries (Adafruit, polulu and FastLED)....everything works after 4 days of frustration!!!!...... :slight_smile: :slight_smile: :slight_smile:

Thanks for the help...Arduino and this Forum Rocks! Would post again when I face any difficulty :stuck_out_tongue: :smiley: :slight_smile:

@Mike

Can you tell me something - I just observed something - I was working with a small led apa102 strip consisting of 10 leds using Arduino Uno and an external power supply. When I started with close to 0 V and then slowly increased the voltage upto the max of 5 volts, it worked perfectly.

However, I switched the power supply off and went off for some work but the voltage was set at 5 volt when I switched it off. When I came back and I just switched it on, there was a transient bright flickering and from then onwards, the leds are behaving randomly? the strip gone or the first led gone? Wanted to know if the sudden burst of current blew them off or not? How to avoid it.....capacitor??

Thanks! (learning the hard way.....)

When I came back and I just switched it on, there was a transient bright flickering and from then onwards, the leds are behaving randomly?

Doesn't sound good. It sounds like a poor quality power supply to me allowing the voltage on the output to drift up due to leakage. If that is right then it would be the whole strip because the power is applied to all the LEDs at the same time.

What was the switch that you turned on? Some low quality power supplies can give transient outputs on switch on, the way to protect against this is to have a zenner diode across the supply.

So it is now sounding as if your power supply has toasted two LED arrays including the one you described in #24.

@ Mike

There is an "output on" switch on the power supply, which I turn off and on to vary the settings I chose initially for my led strip. The Leds are lighting but haphazardly. Just for info, if it helps - the rating for the power supply is like - (0-20V, max 10 Amps)...I am wondering if this power supply on switching on regulates the current from max to the setting, thereby (dont know) damaging the strip with the initial burst of current.

@Paul..thanks for chipping in.

After this observation yesterday, even i thought the same....I am now trying to get another "good" quality power supply with low ratings and see if this problem occurs or not. In the first case, that might have happened and I must have not observed.

Thankfully, I got just 1 meter to try out, phew!!!

When I had specialist power supply engineeres working for me one of the things they tested for was turn on transients. They sometimes found power supplies that produced these and so those designs had to be rejected. It is not as uncommon as you might think. As I said a good beefy 5V Zeners across your LED strip will help protect them.

@Grumpy

I checked with the power supply with other strips and some other expert guys on power supply came for my help. Unfortunately, the supply was useless as per what they said. Told me stuff...which I mostly could not understand but they said to change the power supply....and the bad thing was ...lol...the other strips that I tested with that supply also got destroyed.... :stuck_out_tongue: And the strip that i had ordered earlier had some defective leds...or maybe they got burnt..no idea....but I managed to make a new led strip from a 30 leds/meter and 60 leds/meter by extracting the good leds and throwing the destroyed ones......so...not exactly a good first experience...sort of glad that its sorted out in the end.

Can I suggest that you look at a Teensy together with the FastLED library for your project. The Teensy is very fast and has a lot of memory and the FastLED library is great and there are existing examples for running sprites on LED matrices for it.

@dillonradio

Thanks for the suggestion and I gladly accept my mistake. Actually before the start of the project, based on the funds allotted to me, I ended up going for Arduino ( I had not even heard of Teensy before, to be honest) since i thought its quite popular and cheap. After 2 months, I came across this ( :Facepalm) Teensy....but it was too late since I ended up ordering an Uno, mega and a due..(we thought they could be used after the project also)and other stuff. And now I destroyed couple of strips.....and the next money would be from my pocket (hehe...)

But yes, i am using FastLED and its damn good and far better than the adafruit lib. I started directly with this only. And now after learning about Teensy, I will definitely lay my hands on it sometime or the other in the near future.

Appreciate the help :slight_smile:

@Mike or anybody who can provide some help

I have gone through numerous posts which deal with displaying bitmaps on led matrix, and now I was trying to display some patterns on the matrix I formed using the led strips (serpent style..?). I wanted to know is it possible to display bitmaps on led matrix formed using led strips or not? I am using FastLED library...I can control individual leds and do most of the stuff with the matrix I formed using the strips but its sort of manual...

I also referred to this guy's post (thanks to him)...

https://forum.arduino.cc/index.php?topic=346356.0

As far as i could understand, I have to convert the bmp to a byte array, display etc. I am doing this using FastLED library on my matrix (which is not a panel unlike what this guy did), however the code seems not to work. Any suggestions?

And yes, one doubt - converting a bitmap to an array is done for one to one mapping from a bitmap to the led matrix? If yes, then how do you decide which one - binary, hex....or you can do in any type of array...bit confused here....not a solid programming background..... please be cool :stuck_out_tongue:

Thanks

however the code seems not to work.

In what way did it not work? No output or all jumbled up?

converting a bitmap to an array is done for one to one mapping from a bitmap to the led matrix?

Yes.

or you can do in any type of array.

Yes, the form you enter data is irrelevant at the end of the day what ever number you enter, the computer converts it and stores it in binary.

Note you will need different software for a serpentine and non serpentine raster.

Hello Mike

I could not understand the last line of your comment - software? which software is required for displaying bitmaps on led strip based matrix?

Regarding the code. here it is. I know its wrong....but as mentioned I was trying to write on my code based on the link I gave earlier.

#include<FastLED.h>

#define numled 36
#define datapin 7
#define clockpin 8
#define row 4
#define col 6

CRGB leds[4][6];

const unsigned int PROGMEM img [] = 

{0xfe, 0x18, 0x7f};

void setup() {

FastLED.addLeds <APA102, datapin, clockpin>(leds, numled);
 
}
  
void loop(){

FastLED.show(img);
delay(100);  
 }

I do not know how to pass the array of bitmap to the led matrix using this FastLED and thus my loop part or setup part is wrong...the error is - "no matching function for call to 'CFastLED::addLeds(CRGB [4][6], int)'
Although I have written many codes to do random stuff with leds using loops etc. but I cannot understand how to proceed after the conversion of bitmap to array...

and i hope, its possible to display on such matrices using strips, to display bitmaps???

Thanks.

I do not know how to pass the array of bitmap to the led matrix

Have you got your bit map data from that site?
When you have you paste it into the section on step 5 where it says
// Add the Byte Array here!
You don't seem to have done that on the code you have written.

which software is required for displaying bitmaps on led strip based matrix?

The software you are trying to write now. have you looked at the XYMatrix example in the FastLED library examples? That tells you about how to specify if you have a serpentine raster or not.

Hello @Mike

I did go through what you had written. Some success, but here is the problem

I used the LCD assistant software for converting bitmap to an array. Depending on the pixels/byte option, I get the array. However I could only work with 1 pixel/byte option when i had a matrix of 6X2 ( i know its small..just experimenting). The following code ran successfully and I got the "bitmap".

#include <FastLED.h>

#define datapin 7
#define clockpin 8
#define numled 36

CRGB leds[numled];

const unsigned char i1 [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 
};

void setup() {
  FastLED.addLeds<APA102, datapin, clockpin>(leds,numled);

}

void loop() {
 for(int i=0;i<12; i++){
    if(i1[i]==1){
      leds[i]=CRGB::Cyan;
      FastLED.show();
      delay(100);
    }
    else if (i1[i]==0){
      leds[i]=CRGB::Black;
      FastLED.show();
      delay(100);
    }
    }
    for(int z=12;z<numled;z++){
      leds[z]=CRGB::Black;
      FastLED.show();
      delay(100);
    }
}

Can you tell how to read the bitmap if the pixels/byte were different (for the same bitmap). Like if I have {0X21, 0X21} in place of the above hex array, how to proceed since I cannot see any other option apart from converting hex to binary and then doing a for and if stuff. Just for info before someone gets confused...the last for loop is for some leds which I didnt want....they arent part of the matrix under consideration.

Hi, see your PM in box.

Grumpy_Mike:
Hi, see your PM in box.

Wow! This is getting serious!