[DIY] Selfmade AmbiLight using LED Strings | Page 17

Discussion in '[DIY] User Showcases' started by Lightning303, June 27, 2013.

  1. HomeY
    • Team MediaPortal

    HomeY Test Group

    Joined:
    February 23, 2008
    Messages:
    6,460
    Likes Received:
    2,627
    Gender:
    Male
    Occupation:
    Network Engineer
    Location:
    ::1
    Ratings:
    +4,737 / 16
    Home Country:
    Netherlands Netherlands
    Show System Specs
    Well.... I'm about to give up :(

    Started over again and tried multiple connections. First connection made 'normal' on the correct side:
    ConnectionsDefault.jpg
    That didn't work. When i connect the power, the LEDs blink shortly, that's it.
    After that i tried to connect the other end of the Data, which also didn't work.

    Then connected the power to the other end of the strip:
    ConnectionReversed.jpg
    Also no joy. Now when i connect the power, the LEDs also don't blink.
    The WS2812B have a Reversed Connection protection, so not sure if connecting the other end is useful, but i've tried it.



    I've copied all files from the FastLED 2.1 repo into my library folder and using the following FirstLight sketch:
    [hide]
    Code (Text):
    1.  
    2. // Use if you want to force the software SPI subsystem to be used for some reason (generally, you don't)
    3. // #define FORCE_SOFTWARE_SPI
    4. // Use if you want to force non-accelerated pin access (hint: you really don't, it breaks lots of things)
    5. // #define FORCE_SOFTWARE_SPI
    6. // #define FORCE_SOFTWARE_PINS
    7. #include "FastLED.h"
    8.  
    9. ///////////////////////////////////////////////////////////////////////////////////////////
    10. //
    11. // Move a white dot along the strip of leds.  This program simply shows how to configure the leds,
    12. // and then how to turn a single pixel white and then off, moving down the line of pixels.
    13. //
    14.  
    15. // How many leds are in the strip?
    16. #define NUM_LEDS 240
    17.  
    18. // Data pin that led data will be written out over
    19. #define DATA_PIN 6
    20.  
    21. // Clock pin only needed for SPI based chipsets when not using hardware SPI
    22. //#define CLOCK_PIN 8
    23.  
    24. // This is an array of leds.  One item for each led in your strip.
    25. CRGB leds[NUM_LEDS];
    26.  
    27. // This function sets up the ledsand tells the controller about them
    28. void setup() {
    29.     // sanity check delay - allows reprogramming if accidently blowing power w/leds
    30.       delay(2000);
    31.  
    32.       // Uncomment one of the following lines for your leds arrangement.
    33.       // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
    34.       // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
    35.       // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
    36.       // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
    37.       // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
    38.       FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
    39.       // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS);
    40.       // FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);
    41.       // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
    42.       // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
    43.       // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
    44.       // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
    45.  
    46.       // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
    47.       // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
    48.       // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
    49.       // FastLED.addLeds<P9813, RGB>(leds, NUM_LEDS);
    50.      
    51.       // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    52.       // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    53.       // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    54. }
    55.  
    56. // This function runs over and over, and is where you do the magic to light
    57. // your leds.
    58. void loop() {
    59.    // Move a single white led
    60.    for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
    61.       // Turn our current led on to white, then show the leds
    62.       leds[whiteLed] = CRGB::White;
    63.  
    64.       // Show the leds (only one of which is set to white, from above)
    65.       FastLED.show();
    66.  
    67.       // Wait a little bit
    68.       delay(100);
    69.  
    70.       // Turn our current led back to black for the next loop around
    71.       leds[whiteLed] = CRGB::Black;
    72.    }
    73. }
    74.  
    [/hide]

    I've tested the following 3 AddLeds options:
    Code (Text):
    1.       // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
    2.       FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
    3.       // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS);
    No joy :( I really have no clue what else to test.
    The most logical problem would be that the data simply isn't read or something. Since the LED strip blinks when i connect power, i assume that's still good.
    Assuming when the Arduino IDE says the code is uploaded, it should be good. During transfer is see the TX/RX LEDs light up, but never a response from the LEDs.
    It could be possible that i have a 'faulty' Arduino, but then i would suspect the Basis Led blink stuff to fail also. Since that works fine (with the onboard LED), i'm assuming the data transfer to the arduino is working properly.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Lightning303
    • Premium Supporter

    Lightning303 MP Donator

    Joined:
    September 12, 2009
    Messages:
    798
    Likes Received:
    384
    Gender:
    Male
    Ratings:
    +578 / 0
    Home Country:
    Germany Germany
    Show System Specs
    You could test if the arduino and pin 6 work in general, by running some test code like this

    Code (Text):
    1. int ledPin = 6;               // LED connected to digital pin 13
    2.  
    3. void setup()
    4. {
    5. pinMode(ledPin,OUTPUT);     // sets the digital pin as output
    6. }
    7.  
    8. void loop()
    9. {
    10. digitalWrite(ledPin,HIGH);// sets the LED on
    11. delay(1000);                 // waits for a second
    12. digitalWrite(ledPin,LOW);   // sets the LED off
    13. delay(1000);                 // waits for a second
    14. }
    found that here: http://arduino.cc/en/Reference/PinMode#.Uwdjz_T-vXx

    Then you run the code and use your mutlimeter to check that pin 6 outputs 5v for 1 second, then 0v for a second and so on. That way we can determain that the code is running and that pin 6 is outputing like it should. And we can rule out arduino malfunction.

    Atleast thats what i would do ;)
     
    • Like Like x 1
  4. HomeY
    • Team MediaPortal

    HomeY Test Group

    Joined:
    February 23, 2008
    Messages:
    6,460
    Likes Received:
    2,627
    Gender:
    Male
    Occupation:
    Network Engineer
    Location:
    ::1
    Ratings:
    +4,737 / 16
    Home Country:
    Netherlands Netherlands
    Show System Specs
    Like your idea :) i was just doing something similar and i'm wondering if i found the culprit:
    PinTest.PNG
    Ran the Pintest from the FastLED library, and the above output confirms that data transfer between PC <> Arduino is working fine.
    But look @ the results for PIN 23....

    Leonardo PinMapping can be found here, but i can tell you: PIN 23 = GND
    Will give your example a try also.

    Tried that with delay(2000); and that's working fine. 2 seconds +5V, then 0, and so on :D
    So, a good thing we can rule out the Arduino so far.

    The above 'mask invalid' message has me wondering...
     
    Last edited: February 21, 2014
  5. Lightning303
    • Premium Supporter

    Lightning303 MP Donator

    Joined:
    September 12, 2009
    Messages:
    798
    Likes Received:
    384
    Gender:
    Male
    Ratings:
    +578 / 0
    Home Country:
    Germany Germany
    Show System Specs
    Great to hear. So, an oscilloscope would be nice, to check if the output is also right when running the FirstLight code, but i guess you dont have one right? :p

    Yeah i have no clue about pin 23. Normally you mask pins to be in or output, but gnd schould be neither? No idea, never masked a pin that is predefined as gnd before ^^, or even tought about it. Also didnt find anything about it on google. So cant help you there :(.
     
  6. HomeY
    • Team MediaPortal

    HomeY Test Group

    Joined:
    February 23, 2008
    Messages:
    6,460
    Likes Received:
    2,627
    Gender:
    Male
    Occupation:
    Network Engineer
    Location:
    ::1
    Ratings:
    +4,737 / 16
    Home Country:
    Netherlands Netherlands
    Show System Specs
    Nope, don't have 1. :(

    I also can't find anything about that PIN 23, but since it's GND... Btw: i didn't do anything either, just ran the Pintest. Would be interesting to know the results of others with the same board.
    I noticed there are 3 GND pins on the Leonardo, tried them all without results.

    When i upload 'Atmoduino_by_Olli123', and then start AtmoWin, the RX LED lights up, so that would also suggest it's receiving something, but again, LEDstrip does nothing. Wish i had another strip to test with...

    ** EDIT **
    Email sent so supplier of the LEDs. Hopefully they can inform me how to test the strip or if the strip might be faulty, based on my experiences.
     
    Last edited: February 21, 2014
  7. kenwonders
    • Premium Supporter

    kenwonders MP Donator

    Joined:
    January 19, 2007
    Messages:
    788
    Likes Received:
    416
    Gender:
    Male
    Ratings:
    +766 / 0
    Home Country:
    England England
    I wish you luck, sadly it all looks like you should have had lights at some point.

    You know it's going to be something daft don't you ;)
     
  8. HomeY
    • Team MediaPortal

    HomeY Test Group

    Joined:
    February 23, 2008
    Messages:
    6,460
    Likes Received:
    2,627
    Gender:
    Male
    Occupation:
    Network Engineer
    Location:
    ::1
    Ratings:
    +4,737 / 16
    Home Country:
    Netherlands Netherlands
    Show System Specs
    I truly hope that, but if you have any clue what we missed ;)
    Gonna give it another try tomorrow. Maybe it's just the code of the sketch, not sure.
    Also really curious what the results of the Pintest for Azzuro will be, since he uses the same Leonardo.
     
  9. HomeY
    • Team MediaPortal

    HomeY Test Group

    Joined:
    February 23, 2008
    Messages:
    6,460
    Likes Received:
    2,627
    Gender:
    Male
    Occupation:
    Network Engineer
    Location:
    ::1
    Ratings:
    +4,737 / 16
    Home Country:
    Netherlands Netherlands
    Show System Specs
    OK, for those that have been following this topic, and might have gotten demotivated by my problems, look @ this:
    IMG_20140223_165816.jpg
    Now this REALLY puts a smile on my face!
    Long story short: the FIRST LED is damaged, which prevents the DATA to run through the strip!

    I found a website with exactly the same LEDs as i have (WS2812B), which explains really nice how to hook it up, etc. AND came with a hint about the strip not responding, often because the first LED is broken. Then you simply cut it of, and continue ;)
    I manually connected the DATA to LED 3 (and then also blew that probably, since they're really sensitive).
    The final setup will have 1000 uF capacitors on the power line & 470 Ohm resistor on the DATA line to prevent further damage.

    Now i only need to test of the other libraries (FastLED) work properly with this strip and then.... well ;) i think you can figure out what's next!
    Remove the TV from the wall, double check the math for the amount of LEDs and connect the strip to the TV.

    BIG TNX to @Lightning303 @kenwonders @azzuro and the rest that helped out ;)

    Will report back the finding with the FastLED library with this strip.
     
    • Like Like x 3
    • Thank You! Thank You! x 1
    • Add to Wiki! Add to Wiki! x 1
  10. HomeY
    • Team MediaPortal

    HomeY Test Group

    Joined:
    February 23, 2008
    Messages:
    6,460
    Likes Received:
    2,627
    Gender:
    Male
    Occupation:
    Network Engineer
    Location:
    ::1
    Ratings:
    +4,737 / 16
    Home Country:
    Netherlands Netherlands
    Show System Specs
    FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);

    after bypassing the first LED, using FastLED FirstLight example with the above addLeds parameter works fine ;)
     
    • Like Like x 4
  11. kenwonders
    • Premium Supporter

    kenwonders MP Donator

    Joined:
    January 19, 2007
    Messages:
    788
    Likes Received:
    416
    Gender:
    Male
    Ratings:
    +766 / 0
    Home Country:
    England England
    Yay! Well done for pushing on through :D
     
    • Thank You! Thank You! x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!