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

Status
Not open for further replies.

scratch

Member
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?topic=364208.msg2510420#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.
 

Attachments

  • sketch_bus_Steckplatine.jpg
    sketch_bus_Steckplatine.jpg
    98.9 KB · Views: 428
Just a quick sidenote, I also tried the following wiring, with the same result.
 

Attachments

  • wiring2.png
    wiring2.png
    68.7 KB · Views: 262
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.
arduino_strandtest_Steckplatine.jpg

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.
teensy_strandtest_Steckplatine.jpg

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.
View attachment strandtest_rgbw.ino
View attachment Color_Definitions.h

Anyone an idea why teensy is not able to show me the colors?
Thanks for any help!!
 
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/neopixels/fastled-rgbw-neopixels-sk6812/
(not all FastLED features work with RGBW hack)
 
Last edited:
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/neopixels/fastled-rgbw-neopixels-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.
 
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.
 
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?
 
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
 
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
 
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-Migrating-from-Mega-2560-to-Teensy-3-6 )

Maybe it would be easy to adapt the WS2812Serial library to handle the additional channel.
 
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.
 
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.
 
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.
 
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.
 
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!
 
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)...

Did the OctoWS2811 library work out of the box or did you have to make code modifications? I'm looking to buy SK6182 LED's, but need to verify it will work with teensy
 
I've updated OctoWS2811 to support RGBW LEDs. Currently the new RGBW code is only on github. It will be included in the upcoming Teensyduino 1.54 release.
 
Status
Not open for further replies.
Back
Top