led pins

hi all,
I'm new PLC and LED, and was wondering if you people could help me
I was given a LED strip light. and was wondering what the pins data and cls do?

thanks for your time

Which Arduino do you have?

the Arduino uno V3.

the LEDs are Only one colour

I don't recognize the names "data" and "cls". SDA and SCK perhaps? Those are intended to interface with I2C devices, but are also connected to D18/D19 which are also A4/A5.

Any pin can be used to drive a transistor and sink current from an LED strip.

it not on the PLC but on the LED lighting strip.
there are 4 connection/pins that you connect the leds to the PLC and supply

  1. 5v (connected to the positive of the supply)
    2.0v (connected to the negative of the supply)
  2. dat (that you connect to the PLC)
  3. cls (that you connect to the PLC)

I was wondering what do pins 3 & 4 do on the LED strip.
I'm assuming that dat means data and I have also found that cls means Clock
but what do they do for the LED? and do I need to connect them up all the time?

sorry crossroad for the confustion

thanks for your time

Ah - that depends on the chip that is on the LED strip.
Most likely "data' will connect to SDA, and "cls" will connect to "SCK"

Then you will have to find a library that supports that chip.

hello Crossroads.
thanks for the help that you have given.
I know that I'm asking some Stupid questions. but I have little or no knowledge of PLC and electronics.
form the information that you have given me, I've been able to search the internet.
the DATA connector on the LED stripes receives the information to do what ever it meant to do (turn the LED on/off)
the CLK connector on the LED stripes sets frequency in a few MHz.

the problem is I have no idea how makes these LEDs. they were left in building that my friend bought.
I have tried searching on the internet. and have found nothing.
the closeted I have come to find some thing is the Adafruit-neopixel.
but that only has 3 connectors and my has a black chip about the size of the LED.

Post a clear, upclose picture of the LED strips.
They usually are setup as segments of 3 LEDs with a spot where you can cut the segments apart.
Just need to see 1 segment clearly.

here is a of the LEDs. the best that I can get I'm trying to get picture.

led strip light.jpg

hello all.

the idea that I have in using this LED strip. I think that it a good idea in terms of learning the program.

the plan.
1 have a 2 signal one for forwards and on for backwards
2 have the Arduino give a signal to say that it is healthy and as power.
3 and also to send a signal saying that the LEDs are working.
4 to have the LED strip spilt in to 10 groups of 8 LEDS.
when the forward signal is received to turn on the 1st group of LEDs(1-8) and after X amount of time (timeX) turn on the 2nd group of LED's (9-16) now having 1-16 LEDs on and after timeX to turn off the first group but at the same time to turn on the 3rd group. and so on, and so on until the it his where the 4th group is turn off and the 6th group is turn on I also what the first group again to turn on, so thus we have a 3 group gap between the LED running groups.
the backwards would just be the same but in reverse.
5 I also what the Aruino to send a signal saying that the lights are working taking a reading from the current passing thru the lights.
6. I also would like to send a signal out saying that the Arduino is healthy. every y time.

I have posted a schematic of the idea.

thanks for your time

Yes, that's all well & good - but you're not going to get the LEDs to light up until you figure what the chip is on that strip. You have to send it digital commands, the commands get passed down the strip to control the lighting of the LEDs. Might be I2C, might be SPI-ish (SPI clock & data, but no chip select).

They are almost certainly a WS2801.

Use the Adafruit library to test them, you need to figure out which end is the input, and match the clock and data to the pins specified in the library.

I found this coding on the internet - youtube.
It come from the adafruit-LPD8806-8a14896.
It works sort of if I connect the
dataPin to 13
clockPin to 11

not the pin that they say it shouldbe connected to.
plus my LED strip is only one colour Red.

#include "LPD8806.h"
#include "SPI.h"


int nLEDs = 32;

int dataPin  = 2;
int clockPin = 3;

LPD8806 strip = LPD8806(nLEDs, dataPin, clockPin);

//LPD8806 strip = LPD8806(nLEDs);

void setup() {
  
  strip.begin();

  strip.show();
}


void loop() {

  
  colorChase(strip.Color(127, 127, 127), 50); // White
  colorChase(strip.Color(127,   0,   0), 50); // Red
  colorChase(strip.Color(127, 127,   0), 50); // Yellow
  colorChase(strip.Color(  0, 127,   0), 50); // Green
  colorChase(strip.Color(  0, 127, 127), 50); // Cyan
  colorChase(strip.Color(  0,   0, 127), 50); // Blue
  colorChase(strip.Color(127,   0, 127), 50); // Violet

  theaterChase(strip.Color(127, 127, 127), 50); 
  theaterChase(strip.Color(127,   0,   0), 50); 
  theaterChase(strip.Color(127, 127,   0), 50); 
  theaterChase(strip.Color(  0, 127,   0), 50); 
  theaterChase(strip.Color(  0, 127, 127), 50); 
  theaterChase(strip.Color(  0,   0, 127), 50); 
  theaterChase(strip.Color(127,   0, 127), 50); 

  colorWipe(strip.Color(127,   0,   0), 50);  
  colorWipe(strip.Color(  0, 127,   0), 50);  
  colorWipe(strip.Color(  0,   0, 127), 50);  

  rainbow(10);
  rainbowCycle(0);  
  theaterChaseRainbow(50);
}

void rainbow(uint8_t wait) {
  int i, j;
   
  for (j=0; j < 384; j++) {     // 3 cycles of all 384 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel( (i + j) % 384));
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// Slightly different, this one makes the rainbow wheel equally distributed 
// along the chain
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;
  
  for (j=0; j < 384 * 5; j++) {     // 5 cycles of all 384 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      // tricky math! we use each pixel as a fraction of the full 384-color wheel
      // (thats the i / strip.numPixels() part)
      // Then add in j which makes the colors go around per pixel
      // the % 384 is to make the wheel cycle around
      strip.setPixelColor(i, Wheel( ((i * 384 / strip.numPixels()) + j) % 384) );
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}

// Fill the dots progressively along the strip.
void colorWipe(uint32_t c, uint8_t wait) {
  int i;

  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

// Chase one dot down the full strip.
void colorChase(uint32_t c, uint8_t wait) {
  int i;

  // Start by turning all pixels off:
  for(i=0; i<strip.numPixels(); i++) strip.setPixelColor(i, 0);

  // Then display one pixel at a time:
  for(i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c); // Set new pixel 'on'
    strip.show();              // Refresh LED states
    strip.setPixelColor(i, 0); // Erase pixel, but don't refresh!
    delay(wait);
  }

  strip.show(); // Refresh to turn off last pixel
}

//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 (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, c);    //turn every third pixel on
      }
      strip.show();
     
      delay(wait);
     
      for (int 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 < 384; j++) {     // cycle all 384 colors in the wheel
    for (int q=0; q < 3; q++) {
        for (int i=0; i < strip.numPixels(); i=i+3) {
          strip.setPixelColor(i+q, Wheel( (i+j) % 384));    //turn every third pixel on
        }
        strip.show();
       
        delay(wait);
       
        for (int i=0; i < strip.numPixels(); i=i+3) {
          strip.setPixelColor(i+q, 0);        //turn every third pixel off
        }
    }
  }
}
/* Helper functions */

//Input a value 0 to 384 to get a color value.
//The colours are a transition r - g -b - back to r

uint32_t Wheel(uint16_t WheelPos)
{
  byte r, g, b;
  switch(WheelPos / 128)
  {
    case 0:
      r = 127 - WheelPos % 128;   //Red down
      g = WheelPos % 128;      // Green up
      b = 0;                  //blue off
      break; 
    case 1:
      g = 127 - WheelPos % 128;  //green down
      b = WheelPos % 128;      //blue up
      r = 0;                  //red off
      break; 
    case 2:
      b = 127 - WheelPos % 128;  //blue down 
      r = WheelPos % 128;      //red up
      g = 0;                  //green off
      break; 
  }
  return(strip.Color(r,g,b));
}

I have been trying to understand this code in order to learn how to program the Arduino, but there is a lot of stuff in this code that I can't find in the reference.
like colourChase and theaterChase.

Those come from the LPD8806.h library.

WS2801 only drives 3 LEDs per its datasheet - each chip in the picture seems to be driving two tricolor LEDs.

@exue, can't you post a clear, close up picture of the strip?

Here the best that I can take of the LED strips.
I hope it can help you.

Crossroads, it black chip is driving a single red LED.
That is between the to cut lines. there also what looks like 3 resistors at the bottom of the strip. I can see them that well.
I hope that this help a little bit better.

Need a camera with a "macro" focus.

Nevertheless, one chip per LED.

Now, get a magnifying glass and read the numbers off the chip.

I'm still betting it is in fact, a WS2801

Paul__B.
Thanks I'll take the winning Lotto number, just kidding.
the chip is not a WS2081.
what on the chip is

DMS
D705B
1317

I had a look on the internet. it seem to be made in China.

here the Link:
http://www.chinadtc.com.cn/offer/1000996131.html.

exue:
the chip is not a WS2081.

Oh well, it seems you're screwed then. :astonished:

exue:
I had a look on the internet. it seem to be made in China.

How many chips do you know that are not made in China? Without real data, I regrettably can't suggest anything helpful.