Shop OBEX P1 Docs P2 Docs Learn Events
Driving a WS1228B LED Module(With Minimal Extra Parts) — Parallax Forums

Driving a WS1228B LED Module(With Minimal Extra Parts)

Hello all, I am trying out the aforementioned module on a PropBOE for the first time.

What circuits must I wire to achieve this? The guide says I can use a data buffer, a transistor, or a silicon diode to run this thing with the propeller. Can I use a simple 220 ohm resistor? Or do I need this at all?

Also, the source code is giving me confusion. Which program of the supplied code do I use(Code is obtained from the "Downloads and Documentation" tab of the product page.)

Thanks!
«1

Comments

  • Code is in Propeller1 Spin.
  • I'm assuming you are actually referring to a WS2812B LED module, which can be wired as shown in the attached image.

    If you have downloaded the "WS2812B RGB LED Module Propeller Spin Code" zip file, its Spin code defaults into using P14 as the I/O pin to be connected to the WS2812B LED Module.

    The Spin code is one of JonnyMac's excellent examples. Load the "jm_ws2812_ss_demo" file and change the contstant "STRIP_LEN" to be set to 1 "STRIP_LEN = 1", if you are only connecting a single WS2812 LED Module.

    You can connect a strip of these modules together by connecting the SO output of each module to the SI input of each additional module. Be sure to change the "STRIP_LEN" constant to match the number modules being used.
    963 x 524 - 120K
  • Thank you! Yes it is the LED module.
  • AwesomeCronk,

    According to the Propeller Board of Education guide, there are 5V supply pins on the right side of the header at the top of the breadboard (Page 2),
    https://www.parallax.com/sites/default/files/downloads/32900-Propeller-BOE-Documentation-v1.1_0.pdf

    You could use a Silicon diode such as a 1N4148 or 1N4007 to drop the voltage by approximately 0.7 volts as shown on page 2.
    Or use a 2N3904 transistor to act as a diode and drop the voltage as shown on page 4.
    https://www.parallax.com/sites/default/files/downloads/28085-WS2812B-with-Propeller-v1.0_0.pdf

    This is the Spin code for the module.
    https://www.parallax.com/downloads/ws2812b-rgb-led-module-propeller-spin-code

  • I have the spin code. I don't have diodes. I have generic resistors. The example images here show a prop driving four of these with no extra components.
  • @JonnyMac
    I need your help with your ws2812 spin code. I have found that the demo program turns the led on and sets it to red. I looks like it should be cycling the rainbow, judging by the code.(I'm really no genius with spin yet.)
  • Cronk, I just tried out the code in the zip file - it works fine for me.

    I tested using a Quickstart board and a short strip of WS2812 LEDs.

    The code repeats the color chase for 10 times, then goes to the next repeat loop and cycles all the LEDs through various colors endlessly.

    Check your connections - note that the data pin for the LEDs is 14 (in the con section labelled { io pins } ). This can be changed if needed.
  • Still stuck on red. Will try and solder up another unit, see if this one may be defective.
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-02-15 19:49
    What the!!!???
    I left it on for about 1 minute, then switched it off. When I switched it off again, it went to green. When I cycled power again, it turned red again.
  • The data sheet said something about lowering the power voltage slightly to allow signals to go through. Both units are giving the same problem.
  • Well, odd results. I daisy-chained the two units, Then set the STRIP_LEN constant to two. The first module was red, the second was orange.

    I predict that if I connect a third and try again, the third will be yellow.
  • STRIP_LEN sets how many LEDs are in the entire strip of WS2812s. The demo code is set for a strip of 6, so the effect will work across them all in sequence.

    If you only have one or two WS2812s, then set it to 1 or 2.

    So to understand this line:
    strip.start_b(LEDS, STRIP_LEN)                                ' start led driver
    

    LEDS sets which pin the strip of WS2812s is connected to - this sends the commands to them.
    STRIP_LEN is how many WS2812 LEDs are in the strip. (It's short for "strip length").
  • Thank you for help understanding. I have strange results coming from these guys. I now have to cycle power several times to get these guys to even turn on. once they do, the first turns red, the second orange, and the third stays blank, even though STRIP_LEN is set to 3. Or they turn varying patterns of white, green or blue.
  • Do you have WS2812 or WS2812B? Go to this page and scroll down to "hardware overview:"

    https://learn.sparkfun.com/tutorials/ws2812-breakout-hookup-guide/all

    Look at your module with a magnifier and see whether it's as WS2812 or WS2812B. If it's
    a B, just power it from 3.3V -- it will work and you need no additional components
    between the signal pin and the Propeller.
  • Also, depending on if you have WS2812 or WS2812B parts, the command will need to change...
    strip_start     ' WS2812 pixels
    
    strip.start_b  ' WS2812B pixels
    
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-02-15 21:06
    I have a B unit. The code is running strip.start_b.

    @localroger I have been running this module on 5v the whole time. I just tried 3.3v, and only got a brief burst of light from the second unit.
  • Here are my results.
    3024 x 4032 - 3M
    3024 x 4032 - 2M
  • I don't have those modules, but I think you want both the power and the ground to enter the module on the same side as the signal in. So look for the little arrow that points in towards the chip, and have your power and ground connect there. It looks like you're connecting on the output side. Then daisy chain from the power and signal out on the right side of the chip, to the signal in on the left side of the next chip, and so forth.
  • I was looking on the bottom of the chip, both grounds and powers are connected.
  • The datasheet says the WS2812 requires a minimum of 0.7Vdd for a logic high, so is not 3.3V
    compatible when powered at 5V. Any 74HCTxx family logic gate will translate 3.3V signals to 5V, but you
    can probably get away with a diode voltage shift, which is what I think you are talking about in the initial
    posting. Note HCT, not HC.

    Its worth having a few logic level shifters to hand when working with the Prop as quite a few things
    are 5V only.

    Popular and capable though the WS2812 is, its design missed several obvious tricks like 3.3V compatibility,
    and auto-baud-rate that would make it much more flexible.
  • You probably won't have much luck powering the LED modules from 3.3V. The reason is the high forward voltage of the blue LED. Power from 5V, and use a 3.3V->5V translator on the logic input.

    -Phil
  • OK.

    How the heck was it done in these pictures and video?

    It looks like it was wired the same way I am trying.
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-02-16 00:03
    Excerpted from this document:
    "For 3.3 volt microcontrollers, including the Propeller P8X32A, there are two typical approaches. Either boost the microcontroller's data signal to at least 70% of the supply voltage for the WS2812B module, or reduce the WS2812B module’s supply voltage so it is no more than 45% higher than the data signal. "


    It also says this unit takes 3.5 to 5.3v. I shall try using a 220ish ohm resistor to bring this to 4.5v.(that 45% being 4.78v)
  • There is one difference between the example and your setup...the GND in the example goes into the left side of the bottom module. Yours goes in the right side of the top module. I know it seems like it shouldn't matter, but see if matching the example exactly makes any difference - try moving your GND connection from the board to the left side of the top module.

    Also, the example picture is wired bottom to top, and yours is wired top to bottom.
  • AwesomeCronk,

    I think part of the problem is your soldering but you did bring up a good point about Parallax being contradictory in their use.

    This diagram shows the same setup as the picture.
    http://learn.parallax.com/tutorials/language/blocklyprop/light-it-ws2812-leds-and-blockly

    Same setup again.
    http://learn.parallax.com/tutorials/language/blocklyprop/halloween-flaming-pumpkin-display-project/pumpkin-assembly-and-coding
    http://learn.parallax.com/tutorials/language/blocklyprop/halloween-skull-window-display/skull-mounting-and-coding

    What solder did you use and what type of soldering iron?

    The 5V pin of the 1st module looks to be the best because the header pin is still visible and the joint has a volcano-like shape.

    Take a look at this:
    https://learn.adafruit.com/collins-lab-soldering
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-02-16 00:43
    @Jeff Haas
    The module in the example is upside-down on top. I have inverted the data, inverted the power, inverted the ground. No luck.

    @Genetix
    60/40 tin/lead solder, 1.8% flux. A $15 christmas gift soldering iron. Would using longer pins maybe help? I have the ones that Parallax included on them.


    I am testing voltages from different resistors, having little luck. None of them have changed the voltage at all.
  • GenetixGenetix Posts: 1,754
    edited 2019-02-16 02:22
    AwesomeCronk,

    Ugh, 60/40, well that explains the bad looking joints.
    60/40 has a 'pasty' range so as soon as you remove the iron you will notice it takes a moment before the joint solidifies.
    Do you know if it's Rosin-core or No-clean flux?

    Since you are using good old tin-lead solder then your joints should be 'smooth and shiny' but it's difficult to see with all that flux residue.

    Do you have what are known as 'acid brushes' or high strength alcohol which is above 90%?
    Clean connects are key to good solder joints.

    Also do you have a sponge or one of those brillo-pad looking tip cleaners?

    How big is the tip of that iron compared to the header pin and solder pad around it, and what is it's shape?

    The diagrams on the Parallax Learn website don't use anything so the problem must be the soldering.
  • AwesomeCronkAwesomeCronk Posts: 1,055
    edited 2019-02-16 02:30
    It is you chuang brand. I don’t know about rosin core. Amazon site. What would be a good choice for good solder? This roll is nearly gone.

    I do not have acid brushes, and I do not have alcohol. I do have a tip cleaner sponge.

    The iron tip is needle-shaped, about the same size as the pins. It’s the smallest tip I have that hasn’t been toasted by the iron.(these tips are cheap)
  • AwesomeCronk,

    First line in the description - Fine Rosin Core Solder

    Old school 63/37 eutectic solder (thicker than what you have though).
    https://www.amazon.com/Kester-24-6337-0027-Solder-Alloy-Diameter/dp/B07KWFLHBD/ref=sr_1_1?s=hi&ie=UTF8&qid=1550288592&sr=1-1&keywords=kester+44+rosin+core+solder+63/37

    Acid Brushes - Don't forget to use a 20% off and Free Multimeter coupon at Harbor Freight.
    https://www.harborfreight.com/36-pc-12-in-horsehair-bristle-acid-shop-brushes-61880.html
    You can never have too many multimeters especially when they're free.
    Cut down the tips of the brushes to make them stiff so you scrub off the solder flux.

    Alcohol dispenser.
    https://www.amazon.com/Portable-Plastic-Dispenser-Computer-Cleaning/dp/B07M7KQW58/ref=sr_1_2?s=hi&ie=UTF8&qid=1550289112&sr=1-2&keywords=alcohol+dispenser+push+down

    I don't see good prices on alcohol but I swear I've seen a bottle of 91% at the local Wal-Mart for $3.

    These are used to clean up the alcohol dissolved flux residue but any lint-free cleaning wipes will do.
    https://www.amazon.com/gp/product/B0013HT2QW/ref=ox_sc_act_title_1?smid=APZ6KY51K4CVC&psc=1
    You could use good quality paper towels or those blue disposable shop wipes.
    If you don't sop up the dissolved flux it will leave little white dots all over the place.


Sign In or Register to comment.