Hi, I'm using a BeagleBone Black running LEDscape to control two NeoPixels cut from this reel. Because the BBB outputs a 3.3V data signal, I'm using this logic level converter to step the data signal up to 5V, as recommended on the Powering NeoPixels page. When I bypass the level shifter and simply run the two NeoPixels with a 3.3V data signal (with either 3.3V or 5V connected to the 5V input on the first NeoPixel), everything works great and I'm able to control the NeoPixels with no issues from a NodeJS app on the BBB. However, when I use the level shifter to increase the data signal from 3.3V to 5V, I get erratic results: one or both NeoPixels has the wrong color, fails to light, or flickers. I tried to debug it on the oscilloscope and data signal looks pretty clean and is at ~400kHz for both the LV and HV sides of the level shifter. What's weird is that as soon as I connect the probe to the HV side of the o'scope, the NeoPixels start working great again! I assume that this means that the capacitance of the probes is imparting an effect on the circuit, so I've been fiddling placing a few ceramic capacitors in the 1-100 pF range between the data line and ground with varying results, but even if I get it working consistently I'm not really sure what's going on or why I haven't seen any mention of adding additional capacitors beyond the 1000µF between 5V and GND as suggested. At the moment I'm powering the setup with a 5V 4A power supply through the barrel jack on the BBB.
Here's a Fritzing breadboard diagram of my current setup. Yellow is 3.3V power from the regulator on the board, red is 5V from the power supply, white is data, black is ground.
Thanks in advance for any suggestions!!
Mark
Neopixels unreliable when using level shifter
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- marcusaurelius
- Posts: 6
- Joined: Wed Oct 01, 2014 12:43 am
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Neopixels unreliable when using level shifter
That level shifter has pull-up resistors for I2C use, which tend to 'soften' the signal. Try the 74LVC245 instead:
https://www.adafruit.com/products/735
https://www.adafruit.com/products/735
- marcusaurelius
- Posts: 6
- Joined: Wed Oct 01, 2014 12:43 am
Re: Neopixels unreliable when using level shifter
Thank you very much for the helpful response! I will try the level shifter you recommended. Just out of curiosity, do you know why the level shifter I used is recommended on the Powering NeoPixels page? It sounds like it's not a great choice to use with NeoPixels. That specific level shifter was actually also recommended in the LEDscape docs, so it didn't even really occur to me that it might not be an appropriate level shifter for this task.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Neopixels unreliable when using level shifter
That's a good question...it might've been the closest thing we had at the time. If you bought the I2C shifter on our recommendation for NeoPixels, we could send out the replacement instead.
- marcusaurelius
- Posts: 6
- Joined: Wed Oct 01, 2014 12:43 am
Re: Neopixels unreliable when using level shifter
That would be awesome, thanks!!
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: Neopixels unreliable when using level shifter
Contact [email protected] with your order number and a link to this post. We'll replace it with product #735 (the 74LVC245 chip).
Guide has been updated with the correct information. Very sorry for the confusion.
Guide has been updated with the correct information. Very sorry for the confusion.
- happyinmotion
- Posts: 44
- Joined: Tue Nov 01, 2011 6:15 pm
Re: Neopixels unreliable when using level shifter
I've reviewed level shifters for this specific use: Testing level shifters for running Adafruit NeoPixel strips from a 3.3 Volt Teensy
In short, 74LVC245 is your friend.
In short, 74LVC245 is your friend.
- marcusaurelius
- Posts: 6
- Joined: Wed Oct 01, 2014 12:43 am
Re: Neopixels unreliable when using level shifter
So I received my replacement 74LVC245 level shifter (thank you!), and while looking at the datasheet to see how to wire it up I'm getting the feeling that this isn't what I need either. From what I can tell this chip will convert a 5V logic signal down to 3.3V, but not the other way around (the 74LVC245 datasheet says it operates between 1.65V - 3.6V.) I think what I actually need is a chip like this one, the 74AHCT125. I see that Powering NeoPixels guide is updated to reflect a link to the 74LVC245, but I don't think this chip will work to boost a signal from a 3.3V microcontroller. Am I reading something wrong? Thanks for any clarification you can provide!
- davidl13
- Posts: 187
- Joined: Fri Oct 25, 2013 10:51 pm
Re: Neopixels unreliable when using level shifter
For the #757 (the BSS138-based level converter) I use a 300 Ohm resistor from the HV-side signal (B1-4) to HV. This gets the HV-side leading edges sharpened up. Works for me! ;-)
- hiduino
- Posts: 862
- Joined: Sat Sep 01, 2012 7:05 pm
Re: Neopixels unreliable when using level shifter
The 74LVC245 can convert either way, you need to control the direction of conversion with the DIR pin.marcusaurelius wrote:So I received my replacement 74LVC245 level shifter (thank you!), and while looking at the datasheet to see how to wire it up I'm getting the feeling that this isn't what I need either. From what I can tell this chip will convert a 5V logic signal down to 3.3V, but not the other way around (the 74LVC245 datasheet says it operates between 1.65V - 3.6V.) I think what I actually need is a chip like this one, the 74AHCT125. I see that Powering NeoPixels guide is updated to reflect a link to the 74LVC245, but I don't think this chip will work to boost a signal from a 3.3V microcontroller. Am I reading something wrong? Thanks for any clarification you can provide!
- happyinmotion
- Posts: 44
- Joined: Tue Nov 01, 2011 6:15 pm
Re: Neopixels unreliable when using level shifter
With the 74LVC245, it can help to add a small capacitor (330 pf) on the 3.3V side, from the data pin to ground.
I've no idea why, looking at the data pulses with a scope there's not much change with the capacitor added, just slightly less ringing on the pulse corners, but I get pretty repeatable behaviour: flickering with no capacitance, rock solid with 330 pF, some flickering at 680 pF, more flickering at 1 nF, and lots at 3.3 nF.
I've no idea why, looking at the data pulses with a scope there's not much change with the capacitor added, just slightly less ringing on the pulse corners, but I get pretty repeatable behaviour: flickering with no capacitance, rock solid with 330 pF, some flickering at 680 pF, more flickering at 1 nF, and lots at 3.3 nF.
- davidl13
- Posts: 187
- Joined: Fri Oct 25, 2013 10:51 pm
Re: Neopixels unreliable when using level shifter
I'd love to see pictures of your layout and scope traces (preferably with a FET probe) of inbound and outbound with and without the cap.happyinmotion: I've no idea why, looking at the data pulses with a scope...
- marcusaurelius
- Posts: 6
- Joined: Wed Oct 01, 2014 12:43 am
Re: Neopixels unreliable when using level shifter
Thanks! I just tried this out and seems to be pretty reliable here as well.davidl13 wrote:For the #757 (the BSS138-based level converter) I use a 300 Ohm resistor from the HV-side signal (B1-4) to HV. This gets the HV-side leading edges sharpened up. Works for me! ;-)
- happyinmotion
- Posts: 44
- Joined: Tue Nov 01, 2011 6:15 pm
Re: Neopixels unreliable when using level shifter
Here's the output of the Teensy before the level shifter with no capacitor:
And here's the same spot with a 330 pF cap to ground:
The cap just takes the spikes off the pulse corners a bit, so no big change, but with it the strips work,without they flicker. Consider me confused by this.
And here's the same spot with a 330 pF cap to ground:
The cap just takes the spikes off the pulse corners a bit, so no big change, but with it the strips work,without they flicker. Consider me confused by this.
- davidl13
- Posts: 187
- Joined: Fri Oct 25, 2013 10:51 pm
Re: Neopixels unreliable when using level shifter
Good traces - I think that overshoot becomes important on the high side. So how does the high side of the level shifter look with and without the cap?
Sorry I can't remember the details of your layout, but is there a 300-470 Ohm resistor at the first pixel's DIN and a 10K to ground? (Or was that someone else that had good results with that? ;-)
Sorry I can't remember the details of your layout, but is there a 300-470 Ohm resistor at the first pixel's DIN and a 10K to ground? (Or was that someone else that had good results with that? ;-)
Please be positive and constructive with your questions and comments.