WS2812B Strip mit Arduino Nano oder Uno

Moin,

ich habe einen Arduino Nano und Uno.
Des weiteren habe ich einen 100er LED Strip WS2812b.
Und ich habe ein 5V 10A Netzteil für den Strip.

Ich habe GND vom LED-Strip mit GND vom Netzteil und Arduino verbunden.
Ich habe 5V vom LED-Strip mit 5V vom Netzteil verbunden.
Ich habe DI vom LED Strip mit Port 6 vom Arduino verbunden.

Ich habe Arduino 1.6.1 installiert und die FastLED Bibliothek importiert.
Ich habe nun diverse Beispiele von FastLED ausprobiert, aber an den LED's passiert nichts.
Es leuchten zwar alle (verschiedenfarbig ohne ein System dahinter zu erkennen), aber reagieren tut keine.

z.B. RGB Calibrate habe ich versucht.

habe
FastLED.addLeds<LPD8806, 9, 10, RGB>(leds, NUM_LEDS);
auskommentiert und dafür
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
aktiviert.

Habe aber auch diverse andere Beispiele getestet. An den LED's ändert sich nichts.

Habt Ihr ne Idee, was ich falsch mache?

Bin ich voll auf dem Holzweg?

Grüße

Der Knievel

evil_knievel:
Habt Ihr ne Idee, was ich falsch mache?

Bin ich voll auf dem Holzweg?

Poste den vollständigen Code!

Falls Du es nicht wußtest: Dies ist kein Hellseher-Forum!

Wie soll hier jemand sehen, ob und was Du ggf. falsch machst, wenn Du keinen vollständigen Code postest?

Also ich bin jedenfalls KEIN HELLSEHER!

Und wegen dem hier:

evil_knievel:
Ich habe DI vom LED Strip mit Port 6 vom Arduino verbunden.

würde ich Dir dringend empfehlen, da noch einen kleinen Widerstand in Reihe dazwischen zu schalten. Zum Beispiel 330 Ohm. Als Schutz für den Dateneingang des LED Strips.

Sonst riskierst Du nämlich, den Dateneingang der ersten LED zu killen, wenn Du folgendes machst:

  • erst die Stromversorgung vom Arduino Board herstellen und Daten am Pin liefern
  • danach erst die Stromversorgung des LED Strips einschalten
    In dem Fall riskierst Du, den WS2812 Controller der ersten LED im Stip zu killen und dann ist es Essig mit einer korrekten Funktion.

Im übrigen gibt es die WS2812 LED Streifen mit verschiedener Steuerreihenfolge für die Farben. Wenn bei Deinem Streifen "GRB" dazu führt, dass die LEDs zwar leuchten, aber nicht in den beabsichtigten Farben, dann ist bei Dir vielleicht auch RGB die richtige Reihenfolge.

Außerdem: Libraryversion und Arduinoversion beachten!
Manche Libraryversion, die für 1.0.5 Versionen der Arduino IDE programmiert worden sind, funktionieren auch nur mit den 1.0.x Versionen der Arduino IDE, aber nicht mehr mit Versionen ab 1.5.0 oder höher.

Hi,

Sorry, den Widerstand hab ich vergessen mit anzugeben, Steckt aber in meinem Breadboard.

Beim Code dachte ich, das es reicht, was ich geändert habe, da es die Standard-Beispiele von FastLED sind, aber hier nun der komplette Code, in diesem Fall das Beispiel RGBCalibrate

#include "FastLED.h"


////////////////////////////////////////////////////////////////////////////////////////////////////
//
// RGB Calibration code
//
// Use this sketch to determine what the RGB ordering for your chipset should be.  Steps for setting up to use:

// * Uncomment the line in setup that corresponds to the LED chipset that you are using.  (Note that they
//   all explicitly specify the RGB order as RGB)
// * Define DATA_PIN to the pin that data is connected to.
// * (Optional) if using software SPI for chipsets that are SPI based, define CLOCK_PIN to the clock pin
// * Compile/upload/run the sketch 

// You should see six leds on.  If the RGB ordering is correct, you should see 1 red led, 2 green 
// leds, and 3 blue leds.  If you see different colors, the count of each color tells you what the 
// position for that color in the rgb orering should be.  So, for example, if you see 1 Blue, and 2
// Red, and 3 Green leds then the rgb ordering should be BRG (Blue, Red, Green).  

// You can then test this ordering by setting the RGB ordering in the addLeds line below to the new ordering
// and it should come out correctly, 1 red, 2 green, and 3 blue.
//
//////////////////////////////////////////////////

#define NUM_LEDS 6

// Data pin that led data will be written out over
#define DATA_PIN 6
// Clock pin only needed for SPI based chipsets when not using hardware SPI
//#define CLOCK_PIN 8

CRGB leds[NUM_LEDS];

void setup() {
	// sanity check delay - allows reprogramming if accidently blowing power w/leds
   	delay(2000);

      // Uncomment one of the following lines for your leds arrangement.
      // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
      FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
      // FastLED.setBrightness(CRGB(255,255,255));
      // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);

      // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
      //FastLED.addLeds<LPD8806, 9, 10, RGB>(leds, NUM_LEDS);

      // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}

void loop() {
   leds[0] = CRGB(255,0,0); 
   leds[1] = CRGB(0,255,0);
   leds[2] = CRGB(0,255,0);
   leds[3] = CRGB(0,0,255);
   leds[4] = CRGB(0,0,255);
   leds[5] = CRGB(0,0,255);
   leds[random8()%NUM_LEDS] = CRGB(0,0,0);
   // leds[10] = CRGB(0,0,0);
   FastLED.show();
   // delay(1000);
   FastLED.showColor(CRGB::Black);
}

evil_knievel:

#include "FastLED.h"

Hast Du eigentlich das hier gelesen:

Mit Arduino Versionen 1.5.7 und höher ist es nachweislich zu Fehlern bei Verwendung dieser Library gekommen. Und der Anbieter der Library "glaubt" lediglich, dass es jetzt auch mit aktuelleren Arduinoversionen funktionieren sollte:

I believe I have fixed them

Wenn Du das nicht so richtig glaubst, dass die Library mit Deiner Arduino Version richtig funktioniert, solltest Du eine Arduinoversion verwenden, mit denen die Library nachweislich einwandfrei funktioniert.

Unter Windows kannst Du mehrere Arduinoversionen parallel gleichzeitig installiert haben.
Und die Arduinoversion sollte für diese IDE-Version NIEDRIGER als 1.5.7 sein.

Für Versionen ab 1.5.7 oder höher möchte nicht mal der Anbieter garantieren.

Bei PCs mit anderen Betriebssystemen als Windows kann es ggf. notwendig sein, auch den GCC compiler gesondert downzugraden, da dieser im System gesondert installiert ist, unabhängig von der Arduino-IDE, aber auf Windows-Betriebssystemen reicht es aus, die niedrigere Arduinoversion zu installieren, um kompatibel zu sein.

Ansonsten erkläre bitte mal was dieser Code machen soll:

... // Farben setzen
   FastLED.show();
   // delay(1000);
   FastLED.showColor(CRGB::Black);

Also Du setzt erst Farben und stellst diese auf dem LED-Streifen dar, aber ohne jegliche Verzögerung zeigst Du gleich danach den gesamten LED-Streifen in der Farbe "Black" (Schwarz, alles aus)?

Ich hab dann mal Arduino 1.5.6 r2 installiert und FastLED 3.1.

Habe auch nochmal vorsichtshalber die vorderste LED vom Stripe entfernt, falls die defekt ist.

Aber keine Änderung.

Hab jetzt mal das Beispiel Fire2012 versucht

#include <FastLED.h>

#define LED_PIN     6
#define COLOR_ORDER GRB
#define CHIPSET     WS2811
#define NUM_LEDS    100

#define BRIGHTNESS  200
#define FRAMES_PER_SECOND 60

CRGB leds[NUM_LEDS];

void setup() {
  delay(3000); // sanity delay
  FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  FastLED.setBrightness( BRIGHTNESS );
}

void loop()
{
  // Add entropy to random number generator; we use a lot of it.
  random16_add_entropy( random());

  Fire2012(); // run simulation frame
  
  FastLED.show(); // display this frame
  FastLED.delay(1000 / FRAMES_PER_SECOND);
}


// Fire2012 by Mark Kriegsman, July 2012
// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY
//// 
// This basic one-dimensional 'fire' simulation works roughly as follows:
// There's a underlying array of 'heat' cells, that model the temperature
// at each point along the line.  Every cycle through the simulation, 
// four steps are performed:
//  1) All cells cool down a little bit, losing heat to the air
//  2) The heat from each cell drifts 'up' and diffuses a little
//  3) Sometimes randomly new 'sparks' of heat are added at the bottom
//  4) The heat from each cell is rendered as a color into the leds array
//     The heat-to-color mapping uses a black-body radiation approximation.
//
// Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).
//
// This simulation scales it self a bit depending on NUM_LEDS; it should look
// "OK" on anywhere from 20 to 100 LEDs without too much tweaking. 
//
// I recommend running this simulation at anywhere from 30-100 frames per second,
// meaning an interframe delay of about 10-35 milliseconds.
//
// Looks best on a high-density LED setup (60+ pixels/meter).
//
//
// There are two main parameters you can play with to control the look and
// feel of your fire: COOLING (used in step 1 above), and SPARKING (used
// in step 3 above).
//
// COOLING: How much does the air cool as it rises?
// Less cooling = taller flames.  More cooling = shorter flames.
// Default 50, suggested range 20-100 
#define COOLING  55

// SPARKING: What chance (out of 255) is there that a new spark will be lit?
// Higher chance = more roaring fire.  Lower chance = more flickery fire.
// Default 120, suggested range 50-200.
#define SPARKING 120


void Fire2012()
{
// Array of temperature readings at each simulation cell
  static byte heat[NUM_LEDS];

  // Step 1.  Cool down every cell a little
    for( int i = 0; i < NUM_LEDS; i++) {
      heat[i] = qsub8( heat[i],  random8(0, ((COOLING * 10) / NUM_LEDS) + 2));
    }
  
    // Step 2.  Heat from each cell drifts 'up' and diffuses a little
    for( int k= NUM_LEDS - 1; k >= 2; k--) {
      heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;
    }
    
    // Step 3.  Randomly ignite new 'sparks' of heat near the bottom
    if( random8() < SPARKING ) {
      int y = random8(7);
      heat[y] = qadd8( heat[y], random8(160,255) );
    }

    // Step 4.  Map from heat cells to LED colors
    for( int j = 0; j < NUM_LEDS; j++) {
        leds[j] = HeatColor( heat[j]);
    }
}

evil_knievel:

#define CHIPSET     WS2811

Bist Du sicher, dass Du Deinen LED-Strip mit der richtigen Taktfrequenz ansteuerst?

WS2811 Controller gibt es für Ansteuerung mit 400 kHz und mit 800 kHz. WS2812 Controller werden immer mit 800 kHz angesteuert.

Welchen LED-Streifen verwendest Du denn genau?

Hast Du auch mal mit einem Multimeter im Voltbereich die genaue 5V Spannung Deines LED-Netzteils nachgemessen? Liegt die Spannung zwischen 4.5 und max. 5.5 Volt?

Hi,

die Spannung beträgt 5.2V,

ich habe jetzt mal die Adafruit Library installiert, weil in dem Beispiel auch die Ansteuerung mit Angegeben wird. Jetzt müsste es sicher 800KHz sein. Aber auch da passiert nichts.

Habe mir diesen Strip gekauft.
http://www.ebay.de/itm/261796689553

#include <Adafruit_NeoPixel.h>

#define PIN 6

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(100, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  // Some example procedures showing how to display to the pixels:
  colorWipe(strip.Color(255, 0, 0), 50); // Red
  colorWipe(strip.Color(0, 255, 0), 50); // Green
  colorWipe(strip.Color(0, 0, 255), 50); // Blue
  // Send a theater pixel chase in...
  theaterChase(strip.Color(127, 127, 127), 50); // White
  theaterChase(strip.Color(127,   0,   0), 50); // Red
  theaterChase(strip.Color(  0,   0, 127), 50); // Blue

  rainbow(20);
  rainbowCycle(20);
  theaterChaseRainbow(50);
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

//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 < 256; j++) {     // cycle all 256 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) % 255));    //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
        }
    }
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}

Ich hab's.

War aber nicht meine Schuld. Hab gerade Antwort vom Verkäufer des LED-Strips bekommen, und der meinte, ich soll es mal an die andere Seite des LED Strip anschließen, weil die Beschriftung ggf. falsch sein kann. Und tatsächlich, die haben DI und DO vertauscht. nun läuft alles.
Danke für die Unterstützung.

Das ist natürlich etwas was wir beim besten Willen nicht wissen können. Außer jurs wäre Hellseher :wink:
Der Pfeil ist in die richtige Richtung; die Beschriftung DI-DO aber vertauscht.
Gut, daß es jetzt funktioniert.
Grüße Uwe