WS2812 LED RGB ADDRESSABLE STRIP

Hi there - this might be a very basic easy question and the answer is right under my nose, but please help me out!
I am using a WS2812 addressable rgb led strip and I have found and tried libraries, all work fine. However, all that I want it to do is light up all the LED’s the same colour and for some reason can not figure out how to do this!!
At the end what I would like it to do is when i push a button it does a sunrise cycle, all the same colour at the same time, then another button and its daytime balanced and the third button would be sunset.
So far I have been coding with a single RGB LED so I can at least show the concept (this is for a design thesis and need to do user-testing). Right now I have the sunrise cycle to work properly, no buttons yet or daylight or sunset.
I am using this RGB LED library: https://github.com/amthenia/LED which has been very straightforward to use and set up.

The code I have for the single RGB LED is below.

So to restate my question:
What I would like to know is how to make all the colours on the RGB LED addressable strip to be the same colour at the same time.
OR is there an alternative strip I can use? I went to my electronic engineering shop here in toronto (creatron) and she told me that the only led strips they have that work all together will change to red green or blue only and you can’t mix them, which is useless to me as i need a fade between colours.

#include <LED.h>

int LEDArray = {11,10,9}; // Red, Green, Blue
LED LED1(LEDArray);
int brightness = 0;

void setup() {
}

void loop() {
analogWrite (LEDArray, brightness);

//sunrise
byte start_color1 = {255, 129, 0}; //1850k
byte end_color1 = {255, 146, 38}; //2190k

byte start_color2 = {255, 146, 38}; //2190k
byte end_color2 = {255, 175, 104}; //2920

byte start_color3 = {255, 175, 104}; //2920
byte end_color3 = {255, 185, 127}; //3260

byte start_color4 = {255, 185, 127}; //3260
byte end_color4 = {255, 195, 146}; //3601

byte start_color5 = {255, 195, 146}; //3601
byte end_color5 = {255, 209, 171}; //4111

byte start_color6 = {255, 209, 171}; //4111
byte end_color6 = {255, 219, 190}; //4565

byte start_color7 = {255, 219, 190}; //4565
byte end_color7 = {255, 255, 201}; //4849

byte start_color8 = {255, 255, 201}; //4849
byte end_color8 = {255, 228, 207}; //5019

byte start_color9 = {255, 228, 207}; //5019
byte end_color9 = {255, 243, 232}; //5813

byte start_color10 = {255, 243, 232}; //5813
byte end_color10 = {255, 247, 238}; //6040

byte start_color11 = {255, 247, 238}; //6040
byte end_color11 = {255, 250, 244}; //6266

byte start_color12 = {255, 250, 244}; //6266
byte end_color12 = {255, 254, 250}; //6500

// Fade from start to end
LED1.Fade(LEDArray, start_color1 , end_color1, 5);
delay(1000);
LED1.Fade(LEDArray, start_color2 , end_color2, 5);
delay(1000);
LED1.Fade(LEDArray, start_color3 , end_color3, 5);
delay(1000);
LED1.Fade(LEDArray, start_color4 , end_color4, 5);
delay(1000);
LED1.Fade(LEDArray, start_color5 , end_color5, 5);
delay(1000);
LED1.Fade(LEDArray, start_color6 , end_color6, 5);
delay(5000);
LED1.Fade(LEDArray, start_color7 , end_color7, 5);
delay(5000);
LED1.Fade(LEDArray, start_color8 , end_color8, 5);
delay(5000);
LED1.Fade(LEDArray, start_color9 , end_color9, 5);
delay(5000);
LED1.Fade(LEDArray, start_color10 , end_color10, 5);
delay(5000);
LED1.Fade(LEDArray, start_color11 , end_color11, 5);
delay(5000);
LED1.Fade(LEDArray, start_color12 , end_color12, 5);
delay(5000);

}

Hi,

K_ELLE: I am using a WS2812 addressable rgb led strip and I have found and tried libraries, all work fine. However, all that I want it to do is light up all the LED's the same colour

This may be a dumb answer, but if you want to light them up all the same color, why use addressable leds in the first place ? I think the reason you don't find examples of such a use is because people who want the same color choose much cheaper, non addressable, led strips.

Search for "rgb 5050" on *bay and you'll find plenty of choices. Those strips can be controlled via 3 "analogWrite()" calls on 3 different PWM pins (one for each color).

HOWEVER: Please take care that contrary to the addressable strips where the power is fed via separate "GND+VCC" wires and a power supply, here all the leds are directly powered by the PWM wires, usually expecting 12V. As the Arduino is 5V, and cannot provide such a power anyway, you have to "buffer" the outputs so that the signal of the Arduino is converted into a high-power waveform sent to the leds.

To do so, the easiest is to use a "rgb led strip amplifier" as described here : http://www.instructables.com/id/LED-Strip-Controller-w-LED-Amp-Arduino/

You can also find some for less than 2 bucks on *bay...

Kind regards,

Vicne

However, all that I want it to do is light up all the LED’s the same colour and for some reason can not figure out how to do this!!

I would use the AdaFruit library. Here you have an array that defines each LED’s colour. Just fill that array with the same number.
To fill the buffer with the same value use:-

  for(int i=0;i<NUMPIXELS;i++){
       pixels.setPixelColor(i, pixels.Color(red,green,blue));
      }
      pixels.show(); // transfer buffer to the LEDs

Having first set up your constants and called:-

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

I went to my electronic engineering shop here in toronto (creatron) and she told me that the only led strips they have that work all together will change to red green or blue only and you can’t mix them,

That is just total rubbish, of course you can mix them.

Hi,

I would also like to use WS2812 addressable rgb led strips for an artistic project, but I need 50m at 30LED/m so 1500 LED are going to be used. Do you know what kind of Arduino have enough memory capacity to program so many LEDs ?

Thanks

Michael

Well that requires 4500 bytes so you need a Mega that has 8K of SRAM.

http://arduino.cc/en/Main/arduinoBoardMega2560

However more of a problem is the 90A power supply you will need. This is not an easy project because of this large power supply requirement.

Using several smaller supplies will also work. Maybe 3 30A supplies spread around the project: http://www.mpja.com/5-Volt-Power-Supply/products/534/

Thanks for your feedback !

About the power supply, it has to be powered by a chargeable battery as it is a transportable project. The guy working at the local electronic store told me it's possible with a 10A battery (for the whole led strips), as we are going to use it only for 5 minutes. Is this true ?

as we are going to use it only for 5 minutes. Is this true ?

It depends on what you mean by a 10A battery. Do you mean 10aH battery?

Anyway you need 5 V for those strips so you have to change the battery voltage down to that. For a 90A supply that is going to be a big problem unless you split it up into 10 or so voltage regulators.

WS2812B, yes, needs 3.5V to 5.3V source. A collection of 3.7V - 4.2V LiPo batteries would work. 90A for 5 minutes. Perhaps 6 15000mAH LiPo battery packs: https://www.google.com/search?q=lipo+battery#q=3.7v+lipo+battery+15000

Yes I meant a 10ah battery, sorry

I haven't found 3.V 15000mah LiPo batteries, but I have found these Li-Po 3.7V 10000mAh (2C) batteries : http://www.all-battery.com/polymerli-ionbattery37v10000mah30104.aspx

If I wire 5 of these batteries in parallel, that would normally deliver up to 5x20 = 100A, and that would be ok for my application am I right ?

Huge thanks for your advice !

If I wire 5 of these batteries in parallel,

Never never never wire batteries in parallel. They cross charge and can cause a fire. If you must connect them in parallel you have to put each one through a diode to prevent cross charging. This introduces a voltage drop and for heavy current there is some heat to be dissipated with those diodes.

There is no need anyway, just power each section of strip with its own battery. Remember to common only the -ve terminals.

OK thanks, I think I'll do it this way ! I'll let you know if I have other questions !

I've got my led strips and I've found how to solve my powering problem by using 10 18650 batteries which work just fine.

My next problem is : currently I've wired the Data pin of my 10 led strips (of 5m long each) in series, and the farther the led is from the arduino, the longer it takes to get the information... May I wire the Data pin of each led strip in parallel to avoid this problem?

no you can't wire data in parallel. The protocol is for a pixel to send the data to the next in series.

if the lag is too much, you may want to switch to apa102.

however i did the math once and if i recall right, the refresh for 5m, 60led/m was not dramatic.

if you need to send data in parallel, you will need to wire the data pin of each strip to a separate pin, and send separate data for each, interlaced. that would require to hack the library, and assumes it has idle cycles to spare when it writes out.

now, if the leds display the same pattern, that's different and you can wire in parallel, provided you don't go past a workable fanout. when past that, the signal will degrade and leds wont work.

beware LiPo Poly batteries are dangerous, they need a special charger and can catch fire. People has lost their homes due to fire caused by them. I keep mine in a fire proof ammo box.

LiFe batteries are much safer, the 18650 was a good choice.

It's getting better and better, I'll show you pictures of my project asap, it's almost done ! Thanks again to everyone !