Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect color output - fixed by setting LED count to double what it actually is #319

Open
garrettrathbone opened this issue Aug 31, 2018 · 12 comments

Comments

@garrettrathbone
Copy link

garrettrathbone commented Aug 31, 2018

I've been having weird issues with the RGBW NeoPixel strip – LEDs flickering random colors, as well as having different intensities of colors that bring about reproducible-but-unexpected results - IE Color (0,0,0,127) makes LED 0 off, and LEDs 1 and 2 Green. When fading from Color(0,0,0,0) to Color(0,0,0,255), it starts fading white correctly up until around the 40% mark, then all shut off, then part of the LEDs go green (around the 127 mark), then all shut off again, then go back to all white and work correctly. Same with different intensities of different colors. It always seems that Green will be triggered every 3rd number or so.

Oddly, I fixed it by putting my LED_COUNT as double what it actually is. So if I have 3 LEDs, I state I have 6, and the problem goes away. Is there any rational explanation for this? I have them wired correctly with a 300 ohm resister in the data line, a 5v 15amp power supply with a 1000uh capacitor, and the grounds connected together.

Side note: I'd been having a hell of a time getting the LEDs to behave correctly before this. First they would flicker randomly and produce random results every other time I ran the script, they worked better when using the 5v directly from the pi, then once I started using a 5v 15amp power supply, it would immediately go bright white the second I even touched the data-line to connect it to the pi. Solved it by getting some insulating coating goop (Super Corona Dope), and coating the portion that I soldered on the back-side of the LEDs. I believe the amperage was so high that it was jumping to the data-line and faking a 1. So if this isn't a library issue, that's fine, I can keep playing with it. Just seems odd that it's continually reproducible and can be solved by tricking the library.

@penfold42
Copy link
Contributor

What level shifter are you using ?

@VictorioBerra
Copy link

I am having the exact same problem but i have not been able to fix it.

shifter.

LEDs.

@VictorioBerra
Copy link

Got it! I was NOT SUPPOSED TO GROUND THIS WIRE

image

I found this by consulting the ebay pinout and got lucky that I could understand it.

@VictorioBerra
Copy link

Still not perfect... I have one LED green for some reason and some LEDs are purple. I tried to set them all to one solid color.

image

@VictorioBerra
Copy link

I put the ground back because I think I actually do need it. No matter what I try I am not able to get a smooth animation with a uniform color.

@penfold42
Copy link
Contributor

Pins 4.5.13. 12. 10 and 9 should also be grounded. Unused inputs should always be tied high or low and not left floating.

Try changing the led frequency to 400khz instead of 800khz

@VictorioBerra
Copy link

To clairfy you mean those pins on the level shifter right?

@VictorioBerra
Copy link

Do I have to recompile after editing the main.c to adjust the frequency or can I just change it in the python test scripts?

@penfold42
Copy link
Contributor

Yes the pins on the 74hct125

Strandtest.py can just be edited and run.

If you are using the c example, you will need to recompile it

@garrettrathbone
Copy link
Author

@penfold42 I'm using the 8-channel bidirectional level shifter from Adafruit.

Like I had said before, it's odd but reproducible, which made me think it could somehow be library related (like maybe the library alters the signal or bits based on how many are listed as in the LED string?). I haven't had a chance to test the LED_COUNT issue since I solidified my layout on a chip and soldered it in yesterday. I ran a test to see if the LEDs lit correctly with the double-LED_COUNT-hack (they did) and then ended up leaving for a few days on vacation.

@penfold42
Copy link
Contributor

From memory, they don’t like driving long lines. I think they’re designed for chip to chip on a PCB.

Can you try a 74HCT series chip like a 74HCT125

@pwr33
Copy link

pwr33 commented Nov 26, 2018

I was having problems running on the spi pin, at 3.3v with 2 rgb leds, not working, was odd colour shifting, I set the number of pixels to 4 and an odd improvement, different colours, I set the number of pixels to 8 and it works! (with my two pixels)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants