1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

RPi + OpenELEC APA102 + RPi2

Discussion in 'Hardware Support' started by scuppasteve, 18 April 2019.

  1. scuppasteve

    scuppasteve New Member

    Messages:
    3
    So i have connected my lights, i am not sure how it is supposed to look, but i know this is incorrect. But, i do not know where to start, and i don't want to un-solder every connection.



    I currently have it wired up like this, http://awesomepi.com/wp-content/upl...bilight_ws2801_raspberry_pi_howto_connect.png

    I am using 60 LED/m APA102 led's so, i have both V+ and Ground tied in at beginning, middle of strips and end.

    Thanks
     
  2. Arakon

    Arakon Member

    Messages:
    137
    Hardware:
    RPi1/Zero, RPi3, +Arduino
    You may need to use a level shifter on the data pin.
     
  3. scuppasteve

    scuppasteve New Member

    Messages:
    3
    If i used a raspberry pi 3 would i be ok? I believe that on RPi 3 the pins are 5V
     
  4. Arakon

    Arakon Member

    Messages:
    137
    Hardware:
    RPi1/Zero, RPi3, +Arduino
    They're not. The GPIO hasn't changed from what I can see (it'd make the Pi 3 incompatible with a lot of hardware).
     
  5. scuppasteve

    scuppasteve New Member

    Messages:
    3
    Ok, so is there anywhere i could start for troubleshooting purposes, or about level shifting? I just don't want to have to order a part from China and have it take 4 weeks to find out it was an LED connection. is there a more basic way to hook up to the led's to ensure they are working and soldered together correctly.
     
  6. Arakon

    Arakon Member

    Messages:
    137
    Hardware:
    RPi1/Zero, RPi3, +Arduino
    https://plasmadan.com/uploads/apa102-raspberry-pi-circuit-diagram.png that's likely the easiest way.
    Alternatively, you can use an arduino nano/uno with FastLED.
    Code:
    #include <FastLED.h>
    
    // How many leds in your strip?
    #define NUM_LEDS 1
    
    // For led chips like Neopixels, which have a data line, ground, and power, you just
    // need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
    // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
    #define DATA_PIN 3
    #define CLOCK_PIN 13
    
    // Define the array of leds
    CRGB leds[NUM_LEDS];
    
    void setup() {
          // Uncomment/edit 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, RGB>(leds, NUM_LEDS);
            //FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
          // FastLED.addLeds<APA104, 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<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
         
          // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<P9813, RGB>(leds, NUM_LEDS);
           FastLED.addLeds<APA102, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<DOTSTAR, 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);
          // FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
          // FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    }
    
    void loop() {
      // Turn the LED on, then pause
      leds[0] = CRGB::Red;
      FastLED.show();
      delay(500);
      // Now turn the LED off, then pause
      leds[0] = CRGB::Black;
      FastLED.show();
      delay(500);
    }
    This would flash the LED strip red on and off, with just an arduino nano, completely independant of the PI.. that would verify that the strip itself is working right.