Teensy 3.1 and Neopixels?

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
kennhwang
 
Posts: 3
Joined: Thu Apr 03, 2014 3:49 pm

Teensy 3.1 and Neopixels?

Post by kennhwang »

Hi,

What's the current word on Teensy 3.1 and Neopixel compatibility? I've successfully built 3-4 Neopixel projects running off Trinkets but am getting extremely odd behavior trying to replicate it on Teensy. All of the pixels do light up, but with random colors I never assign. I don't have a picture of it right now because it's an absolute rats' nest, but before starting to unsolder the whole house of cards, I was hoping someone could describe any common failure mode on Teensy. Is it the case that Teensy's 3.3v signal to the data wire isn't sufficient to trigger the pixels, whereas a 5V Trinket does fine? On the Teensy, does this mean the pixels don't light up at all, or can they light up randomly?

I've ordered a couple additional Trinkets (should have just stuck with what works) but am hoping to be able to intelligently troubleshoot over the weekend if it's something fixable...

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Teensy 3.1 and Neopixels?

Post by pburgess »

Trouble there is usually related to the Teensy's 3.3V logic, yes. PJRC recommends using a 74HCT245 buffer for level-shifting. A kludgey alternative is to run the NeoPixels at a slightly lower voltage (e.g. 3.7V from LiPo).

kennhwang
 
Posts: 3
Joined: Thu Apr 03, 2014 3:49 pm

Re: Teensy 3.1 and Neopixels?

Post by kennhwang »

Do you think this would also affect the 3.3v Trinket then? I'm glad I've been using 5v until this point...

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Teensy 3.1 and Neopixels?

Post by pburgess »

Absolutely. Usually when we're using the 3.3V Trinket it's for a portable or wearable project running off a LiPo battery, so the whole system voltage (including NeoPixel power) is 3.7V, so the two play nice.

NeoPixels require the signal voltage to be 70%-100% of the power voltage. If the pixels are running on 5V, then 5 * 0.7 = 3.5V. They'll intermittently respond to a 3.3V signal because that's getting close, in a sort of iffy gray area. Meanwhile, 3.7 * 0.7 = 2.59V, so the 3.3V signal is well in the reliable zone. The LEDs are a tad dimmer when operating at that voltage, but it's adequate for most small projects.

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: Teensy 3.1 and Neopixels?

Post by michaelmeissner »

This article talks about different level shifters with the Teensy and neopixels. If you are limited in space on your breadboard/perfboard, the TXS-0102 is smaller than the 74HCT245 (though not by much, as I've found it extends 0.1" on either side, which means it takes 6 rows instead of 4, while the 74HCT245 takes 10 rows): http://happyinmotion.com/?p=1247

kennhwang
 
Posts: 3
Joined: Thu Apr 03, 2014 3:49 pm

Re: Teensy 3.1 and Neopixels?

Post by kennhwang »

Thanks all, your advice was spot on. I tore out a 5V trinket from one of my other builds, and it worked perfectly! I'm still looking to get a Teensy setup working, so I may have to go the route of the TXS-0102 or 74HCT245 eventually.

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: Teensy 3.1 and Neopixels?

Post by michaelmeissner »

If you are going to be doing a lot of neopixels, Adafruit resells the OctoWS2811 adapter (shield), that has all of the appropriate wiring to support programming 8 independent strands of neopixels, including 74HCT245, and resistors, etc: https://www.adafruit.com/products/1779

Here is the PJRC page on the OctoWS2811: http://www.pjrc.com/store/octo28_adaptor.html, and the library: http://www.pjrc.com/teensy/td_libs_OctoWS2811.html. And then if you want to do 4,320 neopixels, look here: http://community.arm.com/groups/embedde ... faire-2014

User avatar
michaelmeissner
 
Posts: 1821
Joined: Wed Aug 29, 2012 12:40 am

Re: Teensy 3.1 and Neopixels?

Post by michaelmeissner »

By the way, Teensy's can be powered off of 3.7v li-pos, which would allow neopixels to run without level conversion. You would attach the li-po to the VIN and ground pins.

Since you will want to program the teensy occasionally, you have to either unplug the li-po when programming and live with the lights being inconsistant when Vin is 5v instead of 3.7v. Or you can cut the connection between VIN and VUSB (solder trace under the Teensy), and hook VUSB back to VIN when you don't have a battery attached. Or you can use a separate li-po power supply for the lights (taking care to cross connect the grounds), and just attach that to VIN when you aren't powering it via USB.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”