APA 102 60 LED white-Problems with set up/operation

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
wael_mohammed
 
Posts: 2
Joined: Tue Feb 02, 2016 6:12 am

APA 102 60 LED white-Problems with set up/operation

Post by wael_mohammed »

[img]Hello,

I have bought 19 dot star strips (each 4 meters x 60 LED/Meter) to be installed in manufacturing workstations to show the status of operations. I am setting it up with the Python module and Raspberry Pi 2 model B. The power supply I am using is "JYH0501000B" which 5V/10A, which is powering both the RaPi and LED's at the same time. I have installed quad level shifter (3 to 5). after preparing the raspberry pi (os installation, updating and upgrading. enabling SPI).

I am facing the following problems:

* As mentioned in strandtest.py, pin 23 is used for CLK and pin 24 for data. But in real life these pins are always set to 3.3 v while pins 16 and 18 are the ones that have PWM signals. I have connected to these pins and lights started to blink or turn on/OFF randomly. please can you explain that?
* When running the strandtest.py, when I set the number of of LED's in the strip to a specific number (lets say less than 30) and run the test, many more LED's turn on within the rest of the strip. Sometimes it seems the majority of them are on at the same time.
* There is a lot of noise present in the LED's visible through the constant change in intensity of the lights.
* In the code (strandtest.py), the brightness and color are not changing at all.

I would really appreciate it if you could help me out.
Attachments
IMG_20160202_142939462_HDR.jpg
IMG_20160202_142939462_HDR.jpg (1010.56 KiB) Viewed 562 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: APA 102 60 LED white-Problems with set up/operation

Post by adafruit_support_rick »

The DotStars don't run on PWM. Each pixel has a built-in chip that handles the PWM. Color settings are clocked out bit by bit to the chips using the data and clock lines.

Are you connected to the input end of the DotStar strip?

You changed the pin numbers in strandtest.py to the correct pins?

Do you have a common ground between the strip and the Pi?

User avatar
wael_mohammed
 
Posts: 2
Joined: Tue Feb 02, 2016 6:12 am

Re: APA 102 60 LED white-Problems with set up/operation

Post by wael_mohammed »

Thank you for your reply. We managed to run the lights strips now after adjusting the configuration and the code but still there seems to be some problems in it. I will attach the code we are running and would appreciate it if you could have a look at it.

The code is supposed to turn on the following color combinations on all LED's throughout the strips in the same order : GREEN, RED and BLUE with a delay between them. (Maybe the color order is different but this is what we got most of the time. The code is attached).

* Half of our strips execute the code properly and show the same color in all LED's
* The other half exhibit different behaviors as follows:
- Some of them can't execute the proper order of colors/color-representation in the first run. Meaning the first color is ok, in the second color red changes to Violet and blue turns on correctly. Then again sometimes the last LED has a color of its own, different than the rest.
- In case I run the script multiple times they behave more stable. Even in this case, sometimes the last LED's have different colors.
- And finally sometimes, the colors are divided almost 50/50 throughout the strip with half of them showing the right color and half showing the wrong.

Thank you.


Code:

Code: Select all

#!/usr/bin/python

# Simple strand test for Adafruit Dot Star RGB LED strip.
# This is a basic diagnostic tool, NOT a graphics demo...helps confirm
# correct wiring and tests each pixel's ability to display red, green
# and blue and to forward data down the line.  By limiting the number
# and color of LEDs, it's reasonably safe to power a couple meters off
# USB.  DON'T try that with other code!

import time
from dotstar import Adafruit_DotStar

numpixels = 240 # Number of LEDs in strip

# Here's how to control the strip from any two GPIO pins:
datapin   = 23
clockpin  = 24
strip = Adafruit_DotStar(numpixels, datapin, clockpin)

# Alternate ways of declaring strip:
# strip   = Adafruit_DotStar(numpixels)           # Use SPI (pins 10=MOSI, 11=SCLK)
# strip   = Adafruit_DotStar(numpixels, 32000000) # SPI @ ~32 MHz
# strip   = Adafruit_DotStar()                    # SPI, No pixel buffer
# strip   = Adafruit_DotStar(32000000)            # 32 MHz SPI, no pixel buf
# See image-pov.py for explanation of no-pixel-buffer use.
# Append "order='gbr'" to declaration for proper colors w/older DotStar strips)

strip.begin()
strip.clear()
time.sleep(2)
strip.show()
time.sleep(2)
# Initialize pins for output
strip.setBrightness(255) # Limit brightness to ~1/4 duty cycle

# Runs 10 LEDs at a time along strip, cycling through red, green and blue.
# This requires about 200 mA for all the 'on' pixels + 1 mA per 'off' pixel.
Q = True
QQ = True
x = 0
xx = 0
color = 0xFF0000
while QQ:
        while Q:
                strip.setPixelColor(x,color) # Turn on 'head' pixel
                time.sleep(0.01)
                x+=1
                if x==numpixels:
                        Q = False
        x = 0
        xx +=1
        Q = True
        strip.show()
        time.sleep(3)
        strip.clear()
        time.sleep(2)
        print(color)
        color >>= 8             # Red->green->blue->black
	if(color == 0): color = 0x00FF0000 # If black, reset to redco
	if(xx == 3): QQ = False

strip.clear()
time.sleep(2)
strip.show()
time.sleep(2)
Last edited by adafruit_support_rick on Tue Feb 09, 2016 2:22 pm, edited 1 time in total.
Reason: please use Code tags when posting code (</> button)

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: APA 102 60 LED white-Problems with set up/operation

Post by adafruit_support_rick »

Please post some clear, detailed pictures of your connections to the DotStar strips - the ones that don't work.

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

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