Teensy 3.2 & Octows2811 - rotary encoder causes first LED in each channel to flicker


Well-known member
Teensy 3.2 & Octows2811 - rotary encoder causes first LED in each channel to flicker

I have a project with a Teensy 3.2 and Ocotows2811 that uses all 8 channels. Each channel contains between 72 and 86 WS2812B LEDs and my code uses FastLED v3.4.0 to control them. It has all been working well until I connected a rotary encoder to pins 24/25/32 underneath the Teensy. The encoder's clock pin is attached to Teensy pin 32, the data pin is attached to Teensy pin 25. The encoder also has a button attached to pin 24.

When the encoder is physically connected I've noticed that the first LED in each channel sometimes flickers green at what appears to be full brightness. Some of the LEDs at the start of the 8 channels flicker more often than others, but they all do it intermittently - anything from a few times a second, to every several seconds, with no discernable pattern. Each "flicker" is for the duration of one FastLED.show() call to the next (i.e. FastLED.show() sometimes makes the first LED turn bright green; that LED stays green until FastLED.show() is called again, at which point the LED behaves normally again for a while). It is always the first LED. Sometimes the problem affects all channels simultaneously but usually just one or some of them at a time. No other LEDs are affected, the rest all behave as I expect them to.

I have tried cutting my code down to a completely trival sketch (just light LEDs one at a time in order, no encoder-related code or anything else) but the green flickering still happens as long as the encoder is physically connected. If I physically unplug the encoder (but the connecting jumper wires are still attached to the Teensy pins 24, 25 and 32) the problem disappears.

I desoldered and resoldered the wires on pins 24/25/32 in case there was a bad connection but that made no difference. I checked the behaviour of the encoder with a multimeter and it seems to be fine. I've tried the encoder with both 3.3V and 5V but that made no difference.

As far as power goes, I have two battery packs each with dual 5V/3A USB-A outputs, so four power outputs in total that each power two channels of LEDs. The Teensy is powered separately, either by its micro USB port or via the Octows2811 5V input. The flickering happens regardless of which way the Teensy is receiving its power. The 8 channels connect to the Octows8211 via two Cat6 cables and the grounds from the USB cables are connected with the Cat6 grounds, as recommended on the octo28 web page. All cables are around 50cm to 1m long.

Before I go down too many rabbit holes trying to figure out what is causing this problem, does anyone have any pointers that could help me narrow it down? Is there some reason I should be using different pins?

Many thanks!
Yep that was the problem, it's working perfectly now on pin 33 :) Sorry for the noise, hopefully this at least helps anyone else down the line who hits the same issue.