WS2811 led strip

Hi guys, I am trying to make a led strip with 5mm RGB leds and WS2811 chips. I don't really know were to start. I have build this schematic:

But now what library should I use ? If anybody could give me some hint for where to start I would be very nice !

Thanks

If it is not too late, buy WS2812B leds and use them.

Any library for WS2812/2811 should work.

I've used FastLED, but there are many others, and I don't claim that FastLED is better than any others.

LarryD, the strip will be use to light up a plexiglass plate, the led strip that I have test (flat led) doesn't diffuse the light as well a 5mm leds. If I use the FastLED, where do I start ? My goal is to make a Vu meter with this led strip.

Some example libs :

A Couple Of Tutorials :

One of my projects:

Depending on the length of your strip you should run a external power supply to it. You may run into some lines you might need to comment out in libarys if you have ws2811 or Need to include the WS2811. The difference been the 2811 has 4 wire hookup ( GND VCC CLK DATA ) and the 2812 has 3 wire hookup (GND VCC DATA) there is still a lot of WS2811 stuff out there just google a few projects but like LarryD said WS2812 is a lot better. hope this sheds a bit of light on the subject for you.

Thanks guys, I was able to make it work on an arduino uno, but when I upload the same code on an arduino mega there is a bug. Maybe you could give me and idea of the problem. In the serial monitor, the audio value that I am reading is very slow, like if there was a delay...
Here is the code:

#include "FastLED.h"
#include <EEPROM.h>

#define NUM_LEDS 3
#define DATA_PIN 12
CRGB leds[NUM_LEDS];

int R[10] = {0, 0, 0, 0, 0, 255, 255, 255, 255, 255};
int G[10] = {0, 255, 255, 255, 255, 255, 255, 180, 50, 0};
int B[10] = {255, 180, 50, 0, 0, 0, 0, 0, 0, 0};

const int sensitivityPin = A2; // Analog input pin that the potentiometer is attached to
const int audioPin = A0; // Analog input pin that the audio channel is attached to
const int ledCount = 10; // The number of LEDs in the bar graph

int audioValue; // Analog value read from audio channel
int maxAudioValue = 0; // Maximum analog value read from audio channel
int sensitivityValue = 250;
int ledLevel; // Value to map to the output LEDs

void setup()
{
Serial.begin(9600);
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

}

void loop()
{
int ledPins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

audioValue = analogRead(audioPin);
Serial.println(audioValue);
if (audioValue > maxAudioValue)
maxAudioValue = audioValue;

ledLevel = map(audioValue, 0, 1023, 0, sensitivityValue/2);
if (ledLevel > ledCount) {
ledLevel = ledCount;
}

for (int thisLed = 0; thisLed < ledCount; thisLed++)
{
if (thisLed < ledLevel){
leds[ledPins[thisLed]].setRGB(R[ledPins[thisLed]],G[ledPins[thisLed]],B[ledPins[thisLed]]);
FastLED.show();
delay(10);
}
else{
leds[ledPins[thisLed]].setRGB(0,0,0);
FastLED.show();
delay(10);
}
}
delay(1);
}

Hi,

Can you amend your post above please and put the sketch in code tags instead of quote tags. As you can see, the quote tags have not saved you sketch from becoming partly garbled. You may need to re-post the sketch from the IDE.

Also can you post a schematic please so we can see what circuit is feeding the analog input.

Paul

Sorry my bad. My schematic is the same that the picture I posted in my first message.

Thanks !

#include "FastLED.h"

#define NUM_LEDS 3
#define DATA_PIN 12 
CRGB leds[NUM_LEDS];


int R[10] = {0, 0, 0, 0, 0, 255, 255, 255, 255, 255};
int G[10] = {0, 255, 255, 255, 255, 255, 255, 180, 50, 0};
int B[10] = {255, 180, 50, 0, 0, 0, 0, 0, 0, 0};


const int audioPin = A0;        // Analog input pin that the audio channel is attached to
const int ledCount = 10;        // The number of LEDs in the bar graph

int audioValue;                 // Analog value read from audio channel
int sensitivityValue = 250;          
int ledLevel;                   // Value to map to the output LEDs


void setup()
{
  Serial.begin(9600);
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);

}

void loop()
{
  int ledPins[]  = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
 
 audioValue = analogRead(audioPin);
  Serial.println(audioValue);

  ledLevel = map(audioValue, 0, 1023, 0, sensitivityValue/2);
  if (ledLevel > ledCount) {
    ledLevel = ledCount;
  }

  for (int thisLed = 0; thisLed < ledCount; thisLed++) 
  {
    if (thisLed < ledLevel){
      leds[ledPins[thisLed]].setRGB(R[ledPins[thisLed]],G[ledPins[thisLed]],B[ledPins[thisLed]]);
      FastLED.show(); 
       delay(10);
    }
    else{
    leds[ledPins[thisLed]].setRGB(0,0,0);
   FastLED.show(); 
     delay(10);
    }
  }
  delay(1);        
}

So where in that first schematic is the analogue input? where is the Arduino?

The Mega has a diffrent arrangement of timers and different pins for the SPI interface. How have you wired it up. That schematic shows no arduino so we don't know what pins you have used.

Why do you include the EEPROM libiary whe. YOu do not use it?

I have use the pin 12 as data pin, the 5v, the gnd and the audio pin is A0. For the EEPROM library this is a mistake, I isolated a part an other program were I was using EEPROM.

So you go to the doctors and he says "Open your mouth and say Arhh" and you say. " here is my urine sample"

Is that what you do?

Then why do you do this here?

Sometimes the pee sample gives more information. :grinning:

Paul__B:
Sometimes the pee sample gives more information. :grinning:

Yes especially when you have a sore throat. :o

Grumpy_Mike:
Yes especially when you have a sore throat. :o

Funny you should say that.

In diagnosing a sore throat, actually examining the throat generally plays a minimal part; the history is much more important and generally indicates the treatment.

WTF guys... ? Not sure to understand the metaphor...

tchinou1:
WTF guys... ? Not sure to understand the metaphor...

It means they are asking question A and you are answering question B. For instance you have still not given a schematic. You have given part of someone else's schematic, but we need the complete picture of your circuit to be able to advise properly. Like the circuit between the audio input and the analog input for instance.

Hi guys, sorry I was in vacation in the last days. So like you asked, here is a picture of my projet The audio cable is not plug, but I usually just plug the audio wire in the analog pin A0 and the other wire in the ground.

Thanks

If you plug an audio signal directly into an analogue input then the negitave voltage in time will fry the input pin!

tchinou1:
The audio cable is not plug, but I usually just plug the audio wire in the analog pin A0 and the other wire in the ground.

That won't work, an Arduino analog input cannot directly read an audio signal, and, as Mike says, it could damage the Arduino.

You could use one of these which would give you the ability to measure the audio volume over several frequency bands.

Kind of weird that your are saying this, I've been using this that way for more than a year now and everything is working find for that part. I would dig on this, but this is probably not the problem because that work on the Arduino uno and before when I was using shifts registrers to light up the led, I never had any issue like this on the Arduino Mega.