Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 17 of 17

Thread: Issues getting an SK6812 RGBW LED Stripe to work with Teensy 3.2

  1. #1
    Junior Member
    Join Date
    May 2018
    Posts
    12

    Issues getting an SK6812 RGBW LED Stripe to work with Teensy 3.2

    Hi,

    I've struggled in the past days to get a SK6812 RGBW LED Stripe to work with Teensy 3.2.

    My setup consists of a Leisure Battery (~12V) connected to a Daygreen 12/24V to 5V Converter and the attached circuit diagram.

    Everything works fine. Just the 2 LED Stripes do not work as expected.
    They LEDs do only glow white. No color change possible.
    Strange enough, I'm able to sometimes control the number of pixel that do glow using NUMPIXELS.

    I tested the stripes before and got the typical strandtest demo to work using the breadboard - so, yes they can change colors

    Adafruit Neopixel Library is used like described here: http://forum.arduino.cc/index.php?to...420#msg2510420
    As said I'm using the strandtest demo and just changed all occurrences of NEO_PIN to work with Teensy PIN 3.

    Thanks

    PS: There is only one Daygreen Converter, to not crossing to many wires and to make the picture easier to understand I was adding another one.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	sketch_bus_Steckplatine.jpg 
Views:	51 
Size:	98.9 KB 
ID:	14522  

  2. #2
    Junior Member
    Join Date
    May 2018
    Posts
    12
    Just a quick sidenote, I also tried the following wiring, with the same result.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	wiring2.png 
Views:	26 
Size:	68.7 KB 
ID:	14523  

  3. #3
    Junior Member
    Join Date
    May 2018
    Posts
    12
    bump ... sorry will only do this once!

    Any help appreciated!

  4. #4
    Junior Member
    Join Date
    May 2018
    Posts
    12
    I reduced it to the absolut minimum and still I get the same behavior.

    What I did:
    • Setted up the cirucit using only the minimum what is needed (see pictures)
    • Did that for Arduino Uno as well as Teensy 3.2


    Arduino Uno works:
    Everything is smooth and I get the effects nicely that are implemented in the sketch.
    Click image for larger version. 

Name:	arduino_strandtest_Steckplatine.jpg 
Views:	10 
Size:	77.8 KB 
ID:	14656

    Teensy 3.2 not :
    Somehow every LED is just very bright white, no matter what brightness setting is done. The LED Stripe gets very hot compared to Arduino, I think this is due to the LEDs glow in max brightness.
    The only thing I can control is the number of Pixel via NUMPIXELS. No effects, no colors.
    Click image for larger version. 

Name:	teensy_strandtest_Steckplatine.jpg 
Views:	15 
Size:	59.5 KB 
ID:	14657

    I tested different PINS for both, Arduino and Teensy. Sadly I got the same result no matter which PWM pin I was using.

    Attached is the typical strandtest sketch, I just modified it to make it a bit more chatty.
    strandtest_rgbw.ino
    Color_Definitions.h

    Anyone an idea why teensy is not able to show me the colors?
    Thanks for any help!!

  5. #5
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,844
    some LED strips require that the data control pin voltage be no less than 0.7*Vcc (LED voltage). I didn't see the datasheet for your SK6812, but you might try a levelshifter for the Teensy 3.2 to bring that data pin up to 5v. (The Teensy LC has a 2nd pin 17 that provides 5v for LED strip control)

    I looked at scope of Teensy pin 5 doing NEO_GRBW, and it looked ok. single pixel update is taking 40 us (32 bits/800khz). And the Adafruit library works for me on Teensy 3* with RGB neopixels (update 30 us, 24 bits/800khz).

    you could also try the FastLED (hacked) library examples
    http://www.partsnotincluded.com/neop...pixels-sk6812/
    (not all FastLED features work with RGBW hack)
    Last edited by manitou; 09-05-2018 at 03:09 PM.

  6. #6
    Junior Member
    Join Date
    May 2018
    Posts
    12
    Quote Originally Posted by manitou View Post
    some LED strips require that the data control pin voltage be no less than 0.7*Vcc (LED voltage). I didn't see the datasheet for your SK6812, but you might try a levelshifter for the Teensy 3.2 to bring that data pin up to 5v. (The Teensy LC has a 2nd pin 17 that provides 5v for LED strip control)

    I looked at scope of Teensy pin 5 doing NEO_GRBW, and it looked ok. single pixel update is taking 40 us (32 bits/800khz). And the Adafruit library works for me on Teensy 3* with RGB neopixels (update 30 us, 24 bits/800khz).

    you could also try the FastLED (hacked) library examples
    http://www.partsnotincluded.com/neop...pixels-sk6812/
    (not all FastLED features work with RGBW hack)
    Thank you very much for your help!!

    I played arround with some settings and finally think I found the issue.
    Arduino IDE was showing 24Mhz ... Setting it back to 72Mhz (48Mhz is also working) brought the colors back to the stripe - I have no clue way.

    Somehow setting Teensy 3.2 to 24Mhz impacts something that LED stripes just show brightest white instead of the colors.

  7. #7
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,844
    Quote Originally Posted by scratch View Post
    Thank you very much for your help!!

    I played arround with some settings and finally think I found the issue.
    Arduino IDE was showing 24Mhz ... Setting it back to 72Mhz (48Mhz is also working) brought the colors back to the stripe - I have no clue way.

    Somehow setting Teensy 3.2 to 24Mhz impacts something that LED stripes just show brightest white instead of the colors.
    the adafruit neopixel library uses the ARM cycle counter (calibrated by F_CPU) to produce delays for the 800Khz signal used to control the LEDs, I guess running the CPU too slow disrupts the 800khz signal ... glad it's working.

  8. #8
    Junior Member
    Join Date
    Dec 2018
    Posts
    16
    I might be having the same problem. I am trying to upgrade from a Mega 2560 and getting no output from my Teensy 3.6. Can anyone provide more details about this speed setting? Where can one modify that?

  9. #9
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,019
    There is a compiler option in the tools menu that allows you to choose which cpu speed to use.

    More likely issue with voltage as mentioned in #5 post

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,262
    To change the speed, in Arduino click Tools > CPU Speed.

    But for WS2812B LEDs, the speed should not matter. The software adapts to whatever speed you choose, because WS2812 always requires 800 kHz. Very slow speeds, like 24 MHz and lower, may have problems. All the higher speeds should work.

    There are 2 high performance WS2812 libraries for Teensy: OctoWS2811 and WS2812Serial. Look for their examples in Arduino's File > Examples menu. For a single long strip, WS2812Serial is best. Only certain pins are supported by WS2812Serial, so please pay attention to the comments in the code which explain the pins you can use. Both of these libraries are non-blocking, meaning your code gets to run while the LEDs are still updating. This is a huge advantage for fast animation or video, so you can get the next frame ready while the prior is still updating the LEDs. It also allows other libraries to work while the LEDs update.

    Some WS2812 strips are able to accept the 3.3V signal from Teensy 3.x. Others (usually older ones) require 5 volt signal. If you have that older type, a 3.3V to 5V level shifter is needed. 74HCT245 and 74AHCT125 are the best. DO NOT use the bidirectional shifters which have 1 mosfet transistor and 2 resistors. Those are terrible for WS2812 signals (and anything high speed). Some websites like Adafruit & Sparkfun have suggestions to use those cheap mosfet bidirectional shifter for almost any application. That advice is wrong. They do not work well for WS2812 or any other application requiring high speed data.

    If you use OctoWS2811, this board is recommended. It gives you the 3.3V to 5V level shifting and connectors for network cable, which is the best type of (economical) wire for the LED data.

    https://www.pjrc.com/store/octo28_adaptor.html

  11. #11
    Junior Member
    Join Date
    Dec 2018
    Posts
    16
    Quote Originally Posted by PaulStoffregen View Post
    To change the speed, in Arduino click Tools > CPU Speed.

    But for WS2812B LEDs, the speed should not matter. The software adapts to whatever speed you choose, because WS2812 always requires 800 kHz. Very slow speeds, like 24 MHz and lower, may have problems. All the higher speeds should work.

    There are 2 high performance WS2812 libraries for Teensy: OctoWS2811 and WS2812Serial. Look for their examples in Arduino's File > Examples menu. For a single long strip, WS2812Serial is best. Only certain pins are supported by WS2812Serial, so please pay attention to the comments in the code which explain the pins you can use. Both of these libraries are non-blocking, meaning your code gets to run while the LEDs are still updating. This is a huge advantage for fast animation or video, so you can get the next frame ready while the prior is still updating the LEDs. It also allows other libraries to work while the LEDs update.

    Some WS2812 strips are able to accept the 3.3V signal from Teensy 3.x. Others (usually older ones) require 5 volt signal. If you have that older type, a 3.3V to 5V level shifter is needed. 74HCT245 and 74AHCT125 are the best. DO NOT use the bidirectional shifters which have 1 mosfet transistor and 2 resistors. Those are terrible for WS2812 signals (and anything high speed). Some websites like Adafruit & Sparkfun have suggestions to use those cheap mosfet bidirectional shifter for almost any application. That advice is wrong. They do not work well for WS2812 or any other application requiring high speed data.

    If you use OctoWS2811, this board is recommended. It gives you the 3.3V to 5V level shifting and connectors for network cable, which is the best type of (economical) wire for the LED data.

    https://www.pjrc.com/store/octo28_adaptor.html
    As this thread is about SK6812 RGBW, what libraries would work best with a single strand of that? I had another thread but it got closed (sorry if duplicate, but my unique details are therein: https://forum.pjrc.com/threads/54709...-to-Teensy-3-6 )

    Maybe it would be easy to adapt the WS2812Serial library to handle the additional channel.

  12. #12
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,274
    In Post#1 the neopixel library was mentioned, in post#5 FastLED.

  13. #13
    Junior Member
    Join Date
    Dec 2018
    Posts
    16
    Quote Originally Posted by Frank B View Post
    In Post#1 the neopixel library was mentioned, in post#5 FastLED.
    As I mentioned in the other thread, I was trying the Adafruit_Neopixel library, but getting no output. If this was a voltage issue, would I get something? I have ordered one of the 8bit level shifters recommended, which may help. But the OP seemed to need it more so for fixing what was being seen, whereas I see nothing. Hopefully it will help! Will report back.

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,262
    Quote Originally Posted by GhostToast View Post
    If this was a voltage issue, would I get something?
    No, probably not. The strips that need a full 5V signal usually just "play dead" because they see the signal as always being logic low, even when it's 3.3V.

    But they will also "play dead" with all sorts of simple wiring mistakes where they're not getting the signal at all. Many of the cases we've heard on this forum (once we saw photos) turned out to be a mistake or misunderstanding about how to connect the wires.

  15. #15
    Junior Member
    Join Date
    Dec 2018
    Posts
    16
    Quote Originally Posted by PaulStoffregen View Post
    No, probably not. The strips that need a full 5V signal usually just "play dead" because they see the signal as always being logic low, even when it's 3.3V.

    But they will also "play dead" with all sorts of simple wiring mistakes where they're not getting the signal at all. Many of the cases we've heard on this forum (once we saw photos) turned out to be a mistake or misunderstanding about how to connect the wires.
    Thanks for the suggestion, followed this wiring diagram (mentally replace raspberry pi with teensy) and everything is working great - mega 2560 successfully replaced so far! https://learn.adafruit.com/assets/64121
    I paired it with a breadboard power supply for the 5 volts needed as reference point.

    Next I'm going to try to get my actual raspberry pi connected to act as the host and try to program though it, so I can remotely program the Teensy, as this is for an installation behind a wall.

  16. #16
    Junior Member
    Join Date
    Dec 2018
    Posts
    16
    I wanted to report back that things are moving along swimmingly! I got a 74AHCT125 chip and while that was great to run all 896 on one strand, I realized it was time to take advantage of the threading capabilities of the Teensy and that sweet OctoWS2811 library (well, in my case, the OctoSK6182 as I'm dealing w/ RGBW). So far I've got 4/7th of the work done, and awaiting another 74AHCT125 to arrive Sunday to finish the job (14 panels, each have 64 LED (8x8), so 2 panels each to their own strand (7) is as close to maxing out the capabilities of this library and not splitting hairs too much).

    Anyway, I'm super excited! I didn't try any serial monitoring yet to determine speed, but just a stop watch and simple math while I watch the Basic Test run, and pretty sure I'm getting ~145 frames per second! Thank you so much Paul for your excellent documentation and outstanding product!

    After I get this done, I'll have some work cut out converting my code to the new library (from NeoPixel-based), but it was high time to refactor anyway. And then of course moving away from breadboard prototype to a home built board.

  17. #17
    Junior Member
    Join Date
    Dec 2018
    Posts
    16
    Oh and I am successfully using the Raspberry Pi as a host for uploading code, works a treat. Hoping to write a Python or similar web server on it to act as a way to switch modes from devices on-network. The hobby that just keeps on giving!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •