Strange NeoPixel behavior on custom board

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
User avatar
nabelekt
 
Posts: 17
Joined: Mon Nov 06, 2017 11:15 pm

Strange NeoPixel behavior on custom board

Post by nabelekt »

Hello, all!

I am working with a single discrete NeoPixel, which doesn't seem to be sold directly by Adafruit any more, but this still seemed like the best place to post. I got my NeoPixels from https://www.digikey.com/en/products/det ... 58/6134706.

I have a board design that is fairly basic. It has an RF module, SMA antenna connector, a single NeoPixel, and a 40-pin female socket header mounted on the back side. The purpose of the socket header is to be able to mate the board directly onto a Raspberry Pi, like this:

Image

A ground plane fills the board on top and bottom.

The design looks like this:
Image

Image

Image

Here's my problem: The NeoPixel only updates when I am touching the tip of a multimeter probe to the net of the NeoPixel's Din pin. The other end of the probe doesn't need to be connected to anything. Touching the Din net with a different wire doesn't help. Additionally, I can touch the Din net at the Din pin on the NeoPixel, at the header pin on top of the board, or at the corresponding header pin on the bottom of the RPi. Same behavior in all cases. This is very weird to me because I am pretty sure that the issue isn't just a bad connection. Some things I've tried:
  • - two separate boards, one with the RF components and one without; same issue on both.
    - resoldering the NeoPixel connections on one of the boards twice.
Same result.

One thing that DOES work: If I remove my board from the RPi so that it is no longer mated directly to it, and I run jumper wires between the two, the NeoPixel works fine.

Any ideas here? I am at a bit of a loss, and any thoughts would be greatly appreciated. Thanks!

User avatar
blakebr
 
Posts: 957
Joined: Tue Apr 17, 2012 6:23 pm

Re: Strange NeoPixel behavior on custom board

Post by blakebr »

Hello,

Sounds like you have added some extra magic to your board. My old eyeballs tell me from looking at your pictures and diagrams:

NeoPixel:
Pin 1 +5 Volts
Pin 2 N/C (Dout)
Pin 3 Ground
Pin 4 Din

Ground is everywhere. Your data line is surrounded by it on three sides.
+5 comes from header pin 4
Din comes from header pin 12, GPIO-18

The NeoPixel receives +5 volts power. The Raspberry Pi data is at +3.3 volts.

It sounds like when you put your DVM on Din you put some kind of capacitive load that makes the NeoPixel work. Your hand is on the probe. You are a big capacitor to the world. That changes the wave shape of the data being sent to the NeoPixel.

You could start with a 3k to 10k pull up or pull down resistor on the Din line.

You could look at adding a small capacitor to the Din data line. I would start with 100pf, then go up or down. A bubble gum & bailing wire test would be to twist two insulated wires together. Leave one end of the pair open, connect the other ends of the wires to Din and GND. Twist and untwist to test various capacitances.

You could change the power to the NeoPixel to +3.3 volts. You should not need to do this.

You could look at changing NeoPixel data rate. This may not be an option.

I am very interested in the solution to this issue.

Good Luck,
Bruce

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Strange NeoPixel behavior on custom board

Post by adafruit_support_bill »

The reference circuit on the datasheet calls for a 0.1uf bypass cap per pixel. All of our neopixel board product include that. It may help here.
https://cdn-shop.adafruit.com/product-f ... sheet+.pdf

User avatar
nabelekt
 
Posts: 17
Joined: Mon Nov 06, 2017 11:15 pm

Re: Strange NeoPixel behavior on custom board

Post by nabelekt »

Thanks for the replies!
adafruit_support_bill wrote:The reference circuit on the datasheet calls for a 0.1uf bypass cap per pixel. All of our neopixel board product include that. It may help here.
https://cdn-shop.adafruit.com/product-f ... sheet+.pdf
I have tried holding a 0.1 uF cap to the +5V and GND pins. No luck.
blakebr wrote: It sounds like when you put your DVM on Din you put some kind of capacitive load that makes the NeoPixel work. Your hand is on the probe. You are a big capacitor to the world.
But I am insulated from the probe when holding it by the plastic handle, right? I do think some sort of capacitance issue is on the right track. I have found that if I touch any metal on the probe while holding it to the Din pin, the pixel update stops.
blakebr wrote: That changes the wave shape of the data being sent to the NeoPixel.
Except, I don't think that that is happening. I was able to use my fancy logic analyzer to look at the waves.
No probe to pin, pixel not updating:
Image

Probe to pin, pixel updating:
Image

They look identical to me. And Saleae's Logic 2 software is able to identify the correct colors in both cases.
blakebr wrote: You could start with a 3k to 10k pull up or pull down resistor on the Din line.

You could look at adding a small capacitor to the Din data line. I would start with 100pf, then go up or down.

You could change the power to the NeoPixel to +3.3 volts. You should not need to do this.
Unfortunately, the board design makes it kind of hard to test these things. Tomorrow, I may try breaking the PCB traces so that I can do that.
blakebr wrote: A bubble gum & bailing wire test would be to twist two insulated wires together. Leave one end of the pair open, connect the other ends of the wires to Din and GND. Twist and untwist to test various capacitances.
I tried this very crudely, no luck.
blakebr wrote: You could look at changing NeoPixel data rate. This may not be an option.
If this is possible, I imagine it'd be buried in the neopixel library, or some dependency. But given that it works fine when seemingly doing something with capacitance, I'd like to address it that way.

I'll plan to try the suggestions that involve adding a resistor or capacitor to the Din line, or changing the voltage supply from 5 to 3.3 V soon! Any other thoughts are welcome! Thanks!

User avatar
blakebr
 
Posts: 957
Joined: Tue Apr 17, 2012 6:23 pm

Re: Strange NeoPixel behavior on custom board

Post by blakebr »

You should not have to cut any traces for any of the suggestions I made. The 100pf capacitor or pull resistors would be data line to ground or +5.

User avatar
blakebr
 
Posts: 957
Joined: Tue Apr 17, 2012 6:23 pm

Re: Strange NeoPixel behavior on custom board

Post by blakebr »

Hello,

When you are holding the DVM probe, you and the DVM wires are picking up 60 Hz from your surroundings. That may be changing the sensitivity of the LED. When you touch the LED with your finger your 60Hz sounds like you are swamping the digital signal. That should not happen.

The wave shapes you show I am going to assume are upper at the CPU and the lower at the LED. The signal should not degrade that much over that short a distance. Can you touch your logic analyzer before and after each solder and contact joint along its path? I am thinking a bad solder joint that passes the signal through what simulates a very small capacitor. A test for this would be putting a 5k resistor between Din at the LED and ground and looking at the signal with your logic analyzer. I expect your logic analyzer has a very high input impedance and doesn’t load the signal enough to impact testing.

You are using one of four GPIO ports that have hardware PWM: GPIO 12, 13, 18, and 19. They are on pins 32, 33, 12, and 35. You could try one of the other pins. This would require cutting a trace.

Have you tried a different Raspberry Pi? What model are you using?

Bruce

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Strange NeoPixel behavior on custom board

Post by adafruit_support_bill »

It looks like you are powering the Neopixel with 5v. If powered with 5v, the 3.3v logic level for the signal is marginal at best. Neopixels like to have the signal level pretty close to VCC.

You can try powering it from 3.3v as we do on a number of our boards. Or you can add a level shifter to boost the signal up to 5v.

User avatar
nabelekt
 
Posts: 17
Joined: Mon Nov 06, 2017 11:15 pm

Re: Strange NeoPixel behavior on custom board

Post by nabelekt »

blakebr wrote: Have you tried a different Raspberry Pi? What model are you using?
I got a second one in today, and it had the same result.
blakebr wrote: The wave shapes you show I am going to assume are upper at the CPU and the lower at the LED.
Sorry, I should have been more clear. In each screenshot, there is only one signal channel shown. On bottom is the real analog signal. On top is the interpreted digital logic level (by the logic analyzer or the Logic 2 software).
blakebr wrote: The NeoPixel receives +5 volts power. The Raspberry Pi data is at +3.3 volts.

You could change the power to the NeoPixel to +3.3 volts. You should not need to do this.
adafruit_support_bill wrote:It looks like you are powering the Neopixel with 5v. If powered with 5v, the 3.3v logic level for the signal is marginal at best. Neopixels like to have the signal level pretty close to VCC.

You can try powering it from 3.3v as we do on a number of our boards.
It looks like this is the solution! I tested by breaking the 5V path and soldering (not holding) a short wire between RPi pin 1 and the NeoPixel Vin pin. The pixel now works as desired!

I previously ignored the level shifter stuff because of the statement: "if you're only powering a few pixels, you can power them from the Raspberry Pi 5V pin," from https://learn.adafruit.com/neopixels-on ... -pi-wiring.

I will order new boards that route the use the RPi's pin 1 instead of pin 4 for the pixel's Vin, and will add the 0.1 uF capacitor.

Thank you so much for your help!

User avatar
blakebr
 
Posts: 957
Joined: Tue Apr 17, 2012 6:23 pm

Re: Strange NeoPixel behavior on custom board

Post by blakebr »

I am glad to hear you have a solution.
I'll have to put this information in my kit of tricks.

Bruce

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

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