Black Lives Matter - Action and Equality. ... Adafruit joins the Stop Hate for Profit campaign.
0

DotStar Disk wire colors and plugs
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DotStar Disk wire colors and plugs

by RumiTheIsotope on Mon Jan 13, 2020 8:10 pm

Hello,

I'm simply looking for information on the wiring of the DotStar disk. So far the only datasheet I have found is this one: https://cdn-shop.adafruit.com/product-f ... 7/2477.pdf

But there is no word as to the color coding of the wires and what they do.

I'm assuming black is ground and red is +5volts.

Then there is a green and a yellow. One must be clock and one must be data but I can't seem to determine which is which.

Then there is an old thread about these disks where there is discussion regarding the "plug" and the "receptacle" used for input/output possibly being backwards from what is shown on the datasheet.

So....can someone please clarify these things for me? I'm sure the answer to this exists somewhere here but I sure can't seem to find it.

Thanks!

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: DotStar Disk wire colors and plugs

by bcochran1 on Mon Jan 13, 2020 9:09 pm

Hi!

I have a Dotstar strip and it does have similar wire colors to the Dotstar Disk. In the case of the disk, I believe the red wire is +5v, the black wire is ground (GND), the yellow wire is clock, and the green wire is data. I could have this wrong. The green wire might be clock and the yellow data.

In my case, I am using an ItsyBitsy M4 Express and the output pins for clock and data are 3.3v logic level. The Dotstars need 5v logic. So I use a level shifter to boost the logic level for both the clock pin and data pin output to 5v.

Thanks so much

Bob

I have

bcochran1
 
Posts: 474
Joined: Mon Jan 21, 2013 10:46 pm

Re: DotStar Disk wire colors and plugs

by RumiTheIsotope on Tue Jan 14, 2020 6:50 pm

OK thanks I finally figured it out.

The plug/receptacle as shown in the pdf IS BACKWARDS. The wire colors and in/out directions are silkscreened onto the disk itself correctly. I didn't initially see the silkscreened letters at first but they are printed right where the wires connect to the disk. So yes yellow is clock and green is data. Problem solved.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: DotStar Disk wire colors and plugs

by RumiTheIsotope on Tue Jan 14, 2020 7:34 pm

Addendum: Forgot to ask a question.

Compared to the 8X8 matrix, the response of the DotStar disk is very very slow. I'm using a Trinket m0 and have ordered a Metro M4, which is supposed to be much faster. But I don't understand why the simple turning on/off of individual elements on the disk is so much slower than the 8X8 matrix. Is this normal?

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: DotStar Disk wire colors and plugs

by adafruit_support_mike on Wed Jan 15, 2020 5:35 am

Post the code you're using between CODE tags please. DotStars are generally fast, but there are some common code errors that slow things down (like calling .show() after changing the color of every pixel).

adafruit_support_mike
 
Posts: 61107
Joined: Thu Feb 11, 2010 2:51 pm

Re: DotStar Disk wire colors and plugs

by RumiTheIsotope on Wed Jan 15, 2020 7:08 pm

Thank you for your reply. I'm very new to this and in general have no idea what I am doing. Right now I am running something very small and simple as a test:

Code: Select all | TOGGLE FULL SIZE
import board
import adafruit_dotstar as dotstar
dots = dotstar.DotStar(board.D2, board.D0, 255, brightness=0.1)   # clock=D2, data=D0

dots.fill((0, 0, 0))

a=0
while a<255:
    dots[a]=(100,0,0)
    dots[a]=(0,0,0)
    a += 1



All this does is turn on the first LED to red, immediately turn it back off, and then advance to the next one. It takes a full minute and 17 seconds for to cycle through all 255 LEDs. To me that seems really slow compared to some of the dotstar animations I have seen online, so it seems that I'm not doing something right. I am using 3v-5v level shifter and a 5v10A power supply.

The end goal here is to have a series of buttons. When a user presses a button, a certain static pattern will flash up on the disk for a second or so and then disappear. If you can think of a CircuitPython resource that would be helpful in this regards, please let me know.

Thanks!

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: DotStar Disk wire colors and plugs

by bcochran1 on Wed Jan 15, 2020 10:02 pm

Hi,

Can you also post closeup photos of your wiring connections between the Trinket M0 and the disk? How are you supplying power...show a photo of the power supply connections too. I would also like to see a really good closeup of the level shifter circuit.

Also of interest: what is your CircuitPython version on the Trinket M0? Did you update it to the latest version?

Thanks so much

Bob

bcochran1
 
Posts: 474
Joined: Mon Jan 21, 2013 10:46 pm

Re: DotStar Disk wire colors and plugs

by bcochran1 on Wed Jan 15, 2020 11:05 pm

Hi,

I think you should be sure you are running CircuitPython 4.1.2 on your Trinket M0. I recently did purchase that board, and the first thing I did after breaking it out of the package, even before soldering on the headers, was to check the CircuitPython version. It turned out to be version 3.x -- I think 3.3.1. I updated it to 4.1.2 and then instead of doing my project in CircuitPython, I decided to use Arduino. (Okay, so I'm inconsistent sometimes. Smile.)

I have an additional Trinket M0 which is now on order, and also a Dotstar 144-LED strip is available to me. I will wire these up, including the level shifter, when they arrive and will try out your CircuitPython code.

Thanks so much

Bob

bcochran1
 
Posts: 474
Joined: Mon Jan 21, 2013 10:46 pm

Re: DotStar Disk wire colors and plugs

by RumiTheIsotope on Thu Jan 16, 2020 6:15 pm

I am indeed running the latest version of Python - the Trinket came with a pretty old version but I installed the latest right away.

I experimented with using the SPI interface as I read it is much faster. So I initialized my disk this way:

Code: Select all | TOGGLE FULL SIZE
dots = dotstar.DotStar(board.SCK, board.MOSI, 255, brightness=0.1, auto_write=False) # SCK=D3, MOSI=D4


It works, but there is no speed increase from my previously posted script.

I think that I am not using the disk in the way it was intended. I have discovered that it takes just as much time to change the entire disk of LEDs as it does to change one. So in other words, if I define a color for every single LED on the disk and then use the dots.show() to implement the changes, all LEDs immediately change in the same time it took my previously posted script to change one single LED. So I believe the way the disk is intended to be used is to first define the colors for all pixels, then use show(). Then redefine, then show() again. The speed then would be limited by the controller and CircuitPython interpreter.

For my purposes, I need to figure out a clever way to store the images that I want to produce in some type of lookup table or something like that - then assign those numbers to the LEDs as needed to create the images. If it was a square matrix, then that would be pretty easy, but with a disk it is not obvious to me how to do that. But I can't even find information on the LED numbering scheme on the disk itself (for example which LED is dots[123]?)....I thought surely I would be able to find that but so far not. I checked with SoyaLED and they have nothing either. I can determine them experimentally of course, but just don't want to reinvent the wheel. Right now I'm thinking I'm going to have to take a picture of the disk, import it into a drawing program, and then label each LED. Then from there figure out with of the LEDs should be lit up to make the image I want. Seems like such a chart should already exist though.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: DotStar Disk wire colors and plugs

by RumiTheIsotope on Fri Jan 17, 2020 3:45 pm

OK - made an accidental discovery that really sped things up.

In the code I previously posted, I initialized the disk with a brightness of 0.1, then used dots[n]=(100,0,0) to achieve the level of red that I wanted.

However, if I instead initialize the disk with a brightness of 1, then use dots[n]=(5,0,0), I get about the same level of red, but the code runs about 25X faster. No idea why that would be, but glad I discovered it. In the code I initially posted, the red LED took 77 seconds to circle through all the LEDs on the disk. Now it takes about 3 seconds.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Re: DotStar Disk wire colors and plugs

by bcochran1 on Fri Jan 17, 2020 11:09 pm

Hi,

I received my new Trinket M0 today, and also a "Dotstar HD 8x8 Grid" which is product #3444. I've done all the soldering and most of the breadboard wiring needed. I need to update the library folder on my CIRCUITPY drive, then see if I can get one (1) DotStar LED to light up using hardware SPI. I'll report more tomorrow, and post photos of the circuit.

Thanks so much

Bob

bcochran1
 
Posts: 474
Joined: Mon Jan 21, 2013 10:46 pm

Re: DotStar Disk wire colors and plugs

by bcochran1 on Sun Jan 19, 2020 10:59 am

Hi,

Here is the 8X8 Dotstar grid that I'm using to help me reproduce your issue. The main reason for using this grid is because of it's small size.

dotstar_8x8_matrix_small.jpg
dotstar_8x8_matrix_small.jpg (272.64 KiB) Viewed 85 times


Here is the circuit I'm using.

circuit_detail_dotstar_using_SPI_small.jpg
circuit_detail_dotstar_using_SPI_small.jpg (245.02 KiB) Viewed 85 times


As you can see from the wiring, this is set up for hardware SPI. I made a wiring mistake yesterday -- I connected the SPI data signal to the matrix clock input pin, and SPI clock to the matrix data pin. I couldn't understand why my CircuitPython code was not working, so I tried an Arduino-based 'strandtest'. That did not work either, and I looked over my wiring more carefully and found my mistake. Later today I will reinstall CircuitPython on the Trinket.

Notice the connections to the level shifter. I'm only using two (2) of the four available shifter "ports". I've disabled outputs on the unused shifters by connecting the respective OE pins to VCC. The datasheet for the 74AHCT125N doesn't say you need to do that, but I disable them anyhow.

I'm using Wago 221-413 distribution busses to route power. The screw terminal has a 4700 uF, 10V electrolytic capacitor in it.

wago_connectors_routing_power_small.jpg
wago_connectors_routing_power_small.jpg (216.29 KiB) Viewed 85 times


Speaking of capacitors, the DotStar matrix came with a small 220 uF electrolytic capacitor that can be soldered to the 5v and GND pads on the back of the circuit board. I'm not sure I need to do that yet since I'm providing a big capacitor right on the power distribution pins.

I'll go back to the drawing board with CircuitPython now....I'm not experienced with Python....

Thanks so much

Bob

bcochran1
 
Posts: 474
Joined: Mon Jan 21, 2013 10:46 pm

Re: DotStar Disk wire colors and plugs

by bcochran1 on Sun Jan 19, 2020 10:49 pm

Hi!

I have my circuit working correctly now and I'm able to program the DotStar matrix in CircuitPython. I have not yet tested your code: I will do that tomorrow, finally, and report results. I did however use the example code given on the "Learning" part of the website for DotStars and CircuitPython. I simply changed the example code to use SPI instead of bit banging off non-SPI pins, and stayed with the 30-pixel count given in the example code. That worked fine and it was quite fast, at least to my eyes.

I also discovered it is extremely helpful to have a second Trinket M0 device. With two Trinket devices I can set up one of them entirely off the breadboard with a new iteration of code.py (meaning new code). I don't have to worry about frying my laptop's USB port with a sudden, heavy power draw by the LED matrix. After code.py has written to the Trinket M0 that is off the breadboard, I disconnect it from the USB cable, gently remove the other Trinket from the breadboard, and plug the freshly programmed device in its place. Only then do I plug in my power supply brick to see what results from the coding change.

Of course, working with two Trinket devices is easy because each one only has 10 header pins.

Thanks so much

Bob

bcochran1
 
Posts: 474
Joined: Mon Jan 21, 2013 10:46 pm

Re: DotStar Disk wire colors and plugs

by bcochran1 on Mon Jan 20, 2020 10:43 pm

RumiTheIsotope wrote:Thank you for your reply. I'm very new to this and in general have no idea what I am doing. Right now I am running something very small and simple as a test:

Code: Select all | TOGGLE FULL SIZE
import board
import adafruit_dotstar as dotstar
dots = dotstar.DotStar(board.D2, board.D0, 255, brightness=0.1)   # clock=D2, data=D0

dots.fill((0, 0, 0))

a=0
while a<255:
    dots[a]=(100,0,0)
    dots[a]=(0,0,0)
    a += 1



All this does is turn on the first LED to red, immediately turn it back off, and then advance to the next one. It takes a full minute and 17 seconds for to cycle through all 255 LEDs. To me that seems really slow compared to some of the dotstar animations I have seen online, so it seems that I'm not doing something right. I am using 3v-5v level shifter and a 5v10A power supply.

The end goal here is to have a series of buttons. When a user presses a button, a certain static pattern will flash up on the disk for a second or so and then disappear. If you can think of a CircuitPython resource that would be helpful in this regards, please let me know.

Thanks!


Hi!

I played with your code, as quoted above, changing it only for a lower number of pixels and also using SPI in my case.

Result: the code executed very quickly indeed -- the speed is really fast for my use case. No slowness in updating and displaying the pixels at all.

The question of why my code executes rapidly and your code slowly is difficult for me to answer. I'm guessing that if you post close up photos of your complete circuit that will help diagnose the speed issue.

Thanks so much

Bob

bcochran1
 
Posts: 474
Joined: Mon Jan 21, 2013 10:46 pm

Re: DotStar Disk wire colors and plugs

by RumiTheIsotope on Wed Jan 22, 2020 1:59 am

Hi Bob,

I too started with an 8X8 matrix before I got the disk. The matrix seems to run much faster than the disk. Maybe all the extra pixels slows things down - I know that more pixels use more memory - perhaps there is additional processing as well that slows things down?

Instead of running two Trinkets to avoid USB power surges, why aren't you powering the matrix with a separate 5V supply? USB rails are generally only good for 0.5 amps at most. These little dotstars can suck up a lot of power, especially if things go wrong. I found out the hard way that if the clock or data lines become disconnected, the matrix or disk will go bonkers and start displaying random stuff, often at full brightness. My first 8X8 matrix got so hot the solder melted and the LEDs started sliding off the board as I was foolishly trying to troubleshoot why I was getting weird patterns. Turned out to be a bad jumper wire, but by the time I figured it out it was too late and the matrix was toast. So now I have my 5v supply in a position such that I can quickly kill the power if things go bonkers again.

My project is not in a situation where I could provide you a picture, but we both doing pretty much the same thing. Thanks for posting your nice and clear pictures as I'm sure they will be a help for others as well. As for me, I got everything working well enough to present the demonstration that I needed. I ran out of memory and I/O ports on the little trinket, but the full-scale project will be built with a Metro M4 when the parts show up. Bosses grunted with approval.

RumiTheIsotope
 
Posts: 21
Joined: Mon Jan 13, 2020 7:59 pm

Please be positive and constructive with your questions and comments.


cron