Show Posts
Pages: 1 [2]
16  Using Arduino / Networking, Protocols, and Devices / Is there any difference between the max485 chip versions? on: November 14, 2012, 11:18:40 pm
I see sellers listing different versions of the max485 chip. Does it matter? I want to make sure I don't buy the wrong thing. So far I have come across a:


I can't really tell from the spec sheets what the difference is. There also seems to be huge disparity in prices. Like this vendor has 50 chips for $9. That's allot of chips!

or 10 for $2.... are they really that cheap?

17  Using Arduino / LEDs and Multiplexing / Re: How did this guy daisy chain the tlc5940 over a long wire? on: November 13, 2012, 09:29:16 pm
Thanks everyone for taking the time to reply to my questions.

I have already bought a bunch of tlc5940, and I want pwm control, so I am pretty much locked into them for now. After seeing this video I did give a 5 ft long cat5e cable a try. I didn't have any female connectors like the guy in the video, so I had to solder the wires to header pins. Maybe I did a crap job on the soldering, but it didn't work. One thing that occurred to me is he is only connecting two tlc5940s. I am trying to connect a 4th one with a long cable. Maybe that is a significant difference?

I have read in other places that reducing clock speed can increase range. But can I do this for the TLCs? That will not interfere with how they communicate/operate? What are the drawbacks?

It seems like RS-485 would solve my problem. But what I am confused by is do I need an arduino at each node? Of course it would not need to be a full arduino, just basically a processor that can talk to the RS485 chip and then send the correct spi signals to the TLC? That sounds like it might be a whole project in of itself. I did some searching for a ready made spi --> RS485 ---> spi device but did not turn anything up. Does anyone know of the existence of a product like that?

I am basically trying to weigh the effort/cost of investigating a node based solution against the pain of just making a bunch of connectors and using a ton of wiring. Going at it from the other direction, is there an efficient way to churn out wires with connectors? 4 segments each needing to connect to each other. The last segment 1 connector, the one before 3 connectors, then 5, then 7 for the first one in the chain and its connecting 7 for a total of 23 connectors. With 18 wires in each connector that is 414 individual connections I have to make! Its amazing how quickly something like this scales up. 10ft of lights didn't really seem like it would be that big of a deal...until I actually tried to do it smiley

BTW: I really dig that controller for the cricket board.

18  Using Arduino / LEDs and Multiplexing / How did this guy daisy chain the tlc5940 over a long wire? on: November 12, 2012, 12:45:16 am
I've been searching for a way to daisy chain the tlc5940 over medium distances and started to think it was not possible until I saw this guy:

His web site is short on details and in a language I don't understand. Can anyone tell what he is doing?

I have the 4 tlc5940s that I need for my project working great when they are connected close together. But as soon as I start separating them by the 2.5 feet I need (maximum run 10 feet) they stop working. I want to have TLCs separated and close to the leds they will driving because it will greatly cut down on the number of wires I need to run between the sections. I understand there are distance limitations with the method the TLCs use to communicate. But I see there are allot of add on modules for the arduino that allow it communicate over longer distances (such as with rs-485). Is there anything like this that would work for the TLC5940? Thank you.
19  Using Arduino / LEDs and Multiplexing / Re: Can you really have complete control over an LED matrix with multiplexing? on: October 23, 2011, 07:10:46 pm
Thanks for the great link. I've been able to work out a function that will refresh one row at a time. Now if I wanted to control this as an RGB array, and have full color control over each LED, would one LED have to be refreshed at a time, instead of one row at a time? I can't think of another way to do it.

In case anyone is interested, here is the function I came up with. writeMatrix takes 4 parameters. The number of times you want to repeat the pattern, the speed that the pattern will play, the pattern as an array, and the size of the array. This will update a shift register to control the LEDs.


//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 8;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 12;
//Pin connected to Data in (DS) of 74HC595
const int dataPin = 11;

int squareChase [ ] = {      
      int lineChaseH [ ] = {      
 int walkPattern [] = {B11100000,
long int refreshTime = 10; // time in milliseconds between refresh
long int patternRefresh;

int rayCount = 0;

void setup() {
  //Set pins for shift register
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT); 
  pinMode(clockPin, OUTPUT);


void loop() {

} // end of the loop

void writeMatrix(int repetitions, long int patternSpeed, int *patternArray, int raySize) {
  repetitionCounter = 0;
  while(repetitions > repetitionCounter) {
        if(millis() >= patternRefresh){

  patternRefresh = millis() + patternSpeed;

   rayCount = rayCount + 4;
    if(rayCount == raySize) {
    rayCount = 0;
  for(int i = 0; i < 4; i++) {
    digitalWrite(latchPin, LOW);

byte byteToSend = patternArray[rayCount + i] | walkPattern[i];
    shiftOut(dataPin, clockPin, MSBFIRST, byteToSend);
     digitalWrite(latchPin, HIGH);

20  Using Arduino / LEDs and Multiplexing / Re: Can you really have complete control over an LED matrix with multiplexing? on: October 19, 2011, 03:05:44 pm

That makes perfect sense. Thank you, great tutorial!

So my 4x4 array is actually composed of common anode rgb leds. I only hooked up the blue ones so I can understand
how this works without the added complexity of color. But I have been wondering all  along how I would get more
than 7 colors since the entire row would share the pwm and I would not be  able to control the color of an led individually. Now that I have read this tutorial, it makes sense how I can do this since I only have to worry about one column at a time.

I hooked the 4x4 up to a 74HC595 as a learning process. I've been searching for a good explanation on how to
simulate pwm over a 74HC595 but it is confusing to me so far. Do you know of a tutorial on that as good as the last one?

In general I am finding working with the shift register kind of confusing. In the example you gave me, the walking bit is represented by the actual pins of the arduino stored in an array and incremented. That is easy for me to understand. But since I am both sourcing and sinking on the same 74HC595 I am having difficulty conceptualizing a function such as:

turnOnLed(2,3) and it converting that input into a byte of 01001101. I know what I want to convert it to, just not the method. Any suggestions on what I need to read up on? I have looked at bitwise operations, but am having trouble understanding how to use it to get the right values where the sinking and sourcing values are contained in the same byte. I actually find the 8x8 array easier to understand because with two 74HC595, the byte is not shared. Thanks for your help.

21  Using Arduino / LEDs and Multiplexing / Can you really have complete control over an LED matrix with multiplexing? on: October 19, 2011, 11:32:35 am
Forgive me if this question has been answered before, but I have searched and have either not found it,
or understood it when I did see it.

So I have built a 4x4 array and have wired it up with common rows and coloumns so it can be controlled
with only 8 inputs. It works, but I don't understand how I can generate certain patterns. I understand
how controlling a single LED works, and rows and blocks, but not certain arrangements. Take the following:

X = LED OFF    0 = LED ON

   C1   C2   C3   C4

A1  X    X    X    X
A2  X    X    X    X

A3  X    0    X    0

A4  X    X    0    X

What is illogical to me is how could coordinate A3,C3 be off. If column C3 is activated in order
to light the led at A4,C3, and A3 is activated to light the leds at A3,C2 and A3,C4, would A3,C3 not be lit? Thanks.

Pages: 1 [2]