🎁📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Please place all UPS 2 Day orders by 11am Monday, December 16 📦❄️📬🎁
0

DotStar LED strip bright flashing
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DotStar LED strip bright flashing

by mgalgs on Tue Nov 26, 2019 4:33 pm

I recently purchased a one meter DotStar Digital LED Strip - Black 144 LED/m. I'm using a Pi 3 Model B to drive the SPI. I'm using this 5v, 10A switching power supply to power the strip.

Things are looking pretty good for the most part. However, I'm getting really bright flashes at random intervals on random LEDs throughout the strip (not localized to any particular set of LEDs), which kind of kills the mood.

Here's a video showing the problem. The code running in this video is:

Code: Select all | TOGGLE FULL SIZE
import time
import sys

import board
import adafruit_dotstar as dotstar


NUM_LEDS = 144


def rainbow_waves(dots, sleeptime):
    greenie = 0
    while True:
        dots.fill((0, 0, 100))
        dots[greenie] = (0, 255, 0)
        dots.show()
        greenie += 1
        greenie %= NUM_LEDS
        time.sleep(sleeptime)


def main(brightness, sleeptime):
    with dotstar.DotStar(board.SCK,
                         board.MOSI,
                         NUM_LEDS,
                         auto_write=False,
                         brightness=brightness) as dots:
        rainbow_waves(dots, sleeptime)


if __name__ == "__main__":
    brightness = float(sys.argv[1])
    sleeptime = float(sys.argv[2])
    main(brightness, sleeptime)


Any tips for troubleshooting this issue?

Thanks!

mgalgs
 
Posts: 5
Joined: Sat Oct 26, 2019 8:00 pm

Re: DotStar LED strip bright flashing

by dastels on Tue Nov 26, 2019 6:18 pm

Code looks ok. All that comes to mind is data corruption. Are you driving the strip directly from the SPI pins on the Pi's header? If so maybe some buffering on the data and clock lines? E.g. with a https://www.adafruit.com/product/1787. See https://learn.adafruit.com/adafruit-dotstar-leds/power-and-connections.

dastels
 
Posts: 931
Joined: Tue Oct 20, 2015 3:22 pm

Re: DotStar LED strip bright flashing

by oesterle on Tue Nov 26, 2019 6:37 pm

Hi, mgalgs!

Welcome to the Forums!

As dastels suggests, I'd try adding a level shifter, since you're sending 3.3V logic to DotStars running at 5V. Often, we can get away with this with NeoPixels, DotStars' cousins. (Datasheets for NeoPixel and DotStar LEDs often say logic high should be around 0.7 * Vcc or higher, meaning that a strip powered from 5.0V technically wants a 3.5V logic high. Often 3.3V works, even if it's just outside the spec. Is your DotStar strip power supply possibly a bit higher than 5.0V?)

The Connecting DotStar LEDs section of the primary guide shows how to add a level shifter, like the 74AHCT125 - Quad Level-Shifter (3V to 5V). While that example is for wiring Arduino, you'll use similar wiring to Pi, placing the level shifter between the Pi and the strip's DI and CI lines.

Cheers,

Eric

oesterle
 
Posts: 725
Joined: Tue Sep 17, 2013 11:32 pm

Re: DotStar LED strip bright flashing

by mgalgs on Tue Nov 26, 2019 7:02 pm

Thanks for the tips! Yes, driving the SPI lines directly from the pi. I think I even have a few level shifters kicking around in my parts bin... Will give it a shot and report back!

mgalgs
 
Posts: 5
Joined: Sat Oct 26, 2019 8:00 pm

Re: DotStar LED strip bright flashing

by mgalgs on Sun Dec 01, 2019 12:41 am

The level shifter did the trick! Totally should have installed that from the start...

Thanks again!

mgalgs
 
Posts: 5
Joined: Sat Oct 26, 2019 8:00 pm

Re: DotStar LED strip bright flashing

by dastels on Sun Dec 01, 2019 12:06 pm

Glad it did the trick!

Dave

dastels
 
Posts: 931
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.