Shop OBEX P1 Docs P2 Docs Learn Events
Through-Hole "Smart" RGB LEDs (WS2811-compatible) - Page 2 — Parallax Forums

Through-Hole "Smart" RGB LEDs (WS2811-compatible)

2

Comments

  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-02 18:36
    OK. So my LED's just arrived today. Pretty quick shipping!!! Just a quick question. Which pins go where if I am using the jm_ws2812_demo code?

    EDIT: Also, Is a resistor required?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-07-03 15:10
    I used JonnyMac's code with five of the Pololu LEDs. It works great!

    These things are pretty bright - my camera adjusted for the brightness but the tops still look almost white.

    They look better in person...


    attachment.php?attachmentid=109468

    LEDs1.jpg
    1024 x 768 - 74K
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-03 15:34
    Ron, What pins go where? I am confused at that part.

    EDIT: And what resistor is it that you are using?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-07-03 16:19
    NWCCTV wrote: »
    Ron, What pins go where? I am confused at that part.

    EDIT: And what resistor is it that you are using?

    The Pololu product page explains it http://www.pololu.com/product/2536 - find the section "Using the LED" and pin outs.

    The DOUT pin is on the flat side of the LED, next is GND, 5V, and DIN.

    Using JonnyMacs code the Propeller pin 15 goes to the first LED's DIN. The DOUT goes to the DIN on the next LED, etc, etc, etc daisy chaining the LEDs.

    I am using a separate 5V supply for the LEDs and connect the prop's GND to LED supply's ground.

    I used a 10k resistor between the prop and the first LED's DIN and a 22uf cap across the 5V and GND.

    Click the picture I attached and view it full screen - it's easy to see the breadboard wiring.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-03 16:37
    I thank you sir. I will check it out when I return.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-03 19:20
    Will any other size Cap work? I seem to have a ton of pf but very few uf. I also have a ton of ceramic Caps.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-07-03 19:23
    NWCCTV wrote: »
    Will any other size Cap work? I seem to have a ton of pf but very few uf. I also have a ton of ceramic Caps.

    They recommend at least 10uf but if you are using a separate power supply, it may already have a capacitor.
    Make sure the voltage to the LEDS 5V or less.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-07-03 19:45
    This is the "rainbow-cycle" routine
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-03 20:15
    Got it. And I see where I was messing up at. Just in case others do the same: The SolderingSunday and Pololu LED's are not Identical. The pinouts are different. I was looking at the pic for the SolderingSunday LED's but using the Pololu LED's!!!!
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-03 20:20
    This is the "rainbow-cycle" routine
    Do you have the code for that?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-07-03 20:32
    NWCCTV wrote: »
    Do you have the code for that?

    It's a procedure in JonnyMac's demo pgm
    repeat
        rainbow_cycle(10)
    
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-03 20:41
    OK. I got it. Thanks for the help. Now I need to put together a string of these and add a Solar battery charger so the wife can put them on her new store bought gazebo!!!

    EDIT: Every now and then I have to put everything aside and make something for her to keep the balance. ( And the Peace!!! ) Happy Wife = Happy Life.:smile::smile::smile:
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-07-04 05:26
    NWCCTV wrote: »
    OK. I got it. Thanks for the help. Now I need to put together a string of these and add a Solar battery charger so the wife can put them on her new store bought gazebo!!!

    EDIT: Every now and then I have to put everything aside and make something for her to keep the balance. ( And the Peace!!! ) Happy Wife = Happy Life.:smile::smile::smile:

    One of the LED strips might have been a easier for the gazebo since they are waterproof...
    http://www.pololu.com/product/2546
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-07-04 17:08
    One of the LED strips might have been a easier for the gazebo since they are waterproof...
    Hey, Great idea. I happen to have a couple of them. Now I have to figure out what to do with the LED's I have!!!!
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-07-06 18:25
    Interesting situation.
    It turns out that the Pololu leds expect the 24bit color value to be GRB rather than RGB.

    Related info various products: http://forums.adafruit.com/viewtopic.php?f=47&t=41382#p225335

    I changed Jon's "Color" procedure
    pub color(r, g, b)
    '' Packs r-g-b bytes into long
      result.byte[2] := g                                           ' g << 16
      result.byte[1] := r                                           ' r << 8
      result.byte[0] := b                                           ' b << 0
    

    My demo code which revealed the difference
    pub main | pos, rval, gval, bval
    
      strip.start(LEDS, 10)                                               ' start led driver
      pause(10)
    
      color_wipe(0, 0)
      repeat rval from 0 to 255
        color_wipe(strip.color(rval,0,0), 5)
    
      color_wipe(0, 0)
      repeat gval from 0 to 255
        color_wipe(strip.color(0,gval,0), 5)
    
      color_wipe(0, 0)
      repeat bval from 0 to 255
        color_wipe(strip.color(0,0,bval), 5)
    
    
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-08-08 08:31
    Sparkfun now has a new clear version of WS2812 RGB LEDs https://www.sparkfun.com/products/12999 in addition to their diffused version https://www.sparkfun.com/products/12986
  • bte2bte2 Posts: 154
    edited 2014-08-11 12:34
    Sparkfun now has a new clear version of WS2812 RGB LEDs https://www.sparkfun.com/products/12999 in addition to their diffused version https://www.sparkfun.com/products/12986

    I bought a whole bunch of each just Friday, but I don't have them yet.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-09-23 19:07
    This is VERY strange. Using a Prop BOE Board and 2 of the Serial addressable RGB LED's I am able to get the code to work just fine when using the Prop BOE's 3.3V, However, when I try to use the 5V it does not work. I know there is an explanation for this but I just find it odd that it works at 3.3V and not at 5V. I would suspect it should be the other way around. I am going to attach a separate 5V supply to see what happens.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2014-09-23 20:16
    Recently, I've seen clones of these surfaced (PL9823) in the Google searches and Alibaba too.

    I've checked the datasheet for these and shouldn't it require a current limiting resistor in the +5V line? The example provided inside the datasheet showed a resistor but no value. :)
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-09-23 21:45
    shouldn't it require a current limiting resistor in the +5V line?
    You are correct. I just need to figure out the best one to get the brightest light possible. I started with a 10k Ohms. It is very dim but works as it is suppose to.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-09-24 12:57
    It turns out that the Pololu leds expect the 24bit color value to be GRB rather than RGB.

    My driver corrects for that in the PASM code (always has). I just updated both versions (auto-refresh and single-shot) with PASM code that is in Captain Obvious mode (versus a clever trick from Tony that was hard for others to follow).

    Update is here:
    -- http://obex.parallax.com/object/703
  • OldFartRadiomanOldFartRadioman Posts: 30
    edited 2014-09-24 13:02
    If driving DI with a 3V3 input I have found that I can't run the LEDs at much over 4 volt and get a reliable trigger.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-09-24 15:41
    JonnyMac wrote: »
    My driver corrects for that in the PASM code (always has).

    Jon,
    I had an older version zip file I got from one of your forum threads - the jm_ws2812 file was dated 9/9/2013. It was doing RGB rather than GRB.

    I'm glad the latest version is in the OBEX so we don't have to search the forum.

    Thanks,
    Ron
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-09-24 17:58
    I love this driver!!!! However, what do I need to do if all I want is for the rainbow of colors to continually cycle? I have decided to use these LED's and JM;s awesome driver for my Dog Collar project. I do not need anything fancy but I do want the colors to blink constantly rather than stopping the way it does after all colors have been cycled. In other words, when running the code I want what happens for the first 6 seconds to happen constantly. Thanks for the help.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-09-24 18:14
    If I could get the whole routine to repeat indefinitely I would be happy with that.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-09-25 06:21
    @Jon,

    I'm using the new version of the driver from the OBEX and I still believe the RGB vs GRB issue exists.

    My setup uses 10 LEDS and the attached code attempts to drive them all red then, green, then blue, then yellow, then purple.

    However they go from green to red to blue to yellow to cyan unless I modify the following routine in jm_ws2812.spin
    pub color(r, g, b) : rgb
    
    
    '' Packs r-g-b bytes into long
         
      rgb.byte[2] := r   ' r << 16
      rgb.byte[1] := g   ' g << 8
      rgb.byte[0] := b   ' b << 0
    


    When I swap the red and green values in the array (i.e. green in the 3rd byte and red in the 2nd),
    the colors are displayed correctly.
    pub color(r, g, b) : rgb
    
    
    '' Packs r-g-b bytes into long
    
    rgb.byte[2] := g   ' g << 8
    rgb.byte[1] := r   ' r << 16
    rgb.byte[0] := b   ' b << 0
    
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-09-25 22:37
    @Ron, How would I make your code repeat forever?
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-09-26 06:05
    NWCCTV wrote: »
    @Ron, How would I make your code repeat forever?

    I don't know Andy, forever is a long time :smile:

    Just insert a "repeat" after the pause(10) and indent all of the lines following it in the "main" routine.

    Pretty basic spin code...


    attachment.php?attachmentid=111157


    forever.jpg
    540 x 802 - 70K
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-09-26 10:42
    I had previously tried that and it repeats 3 times and then stops. That's why I thought I was doing something wrong.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-09-26 11:22
    NWCCTV wrote: »
    I had previously tried that and it repeats 3 times and then stops. That's why I thought I was doing something wrong.

    Maybe it is a power issue - how are you supplying power to the LEDs? I am using a separate supply/voltage regulator.

    Try putting some debug statements in there and use the serial terminal program to see what's happening...
Sign In or Register to comment.