Show Posts
Pages: 1 ... 4 5 [6] 7 8 9
76  Using Arduino / General Electronics / Re: Data cable issues - problem goes away when touching cable with my hand! on: January 22, 2012, 05:48:09 am
Thanks all for your input.  This forum is such an asset!

You'll be glad to know I fixed the problem with your help.

First off I tried the cap from data to ground. This fixed the issue at 60% of the problem points. The rest required a combination approach, with one set (There are 6 sets of these led chains running independently) needing a bypass cap on the supply to the first board, caps on the data line on two of the other boards, and a resistor to stop reflections on one of those boards as well!

Wicked job

77  Using Arduino / General Electronics / Re: Data cable issues - problem goes away when touching cable with my hand! on: January 21, 2012, 08:41:16 am
Wow thanks Mark I'll put that to the test immediately.

Any idea why it might be working when I touch the cable?
78  Using Arduino / General Electronics / Data cable issues - problem goes away when touching cable with my hand! on: January 21, 2012, 05:52:52 am

I'm using some ws2803 led driver chips daisy chained on reasonably long (for the spec) cables, using the spi bus for communication (data and clock). One of the cables in the chain needs to be slightly longer than the others and the leds connected to drivers after this cable perform erratically, especially when adjusting the brightness of lots of leds at once.

The funny thing is. If I touch this cable with my hand, the problem goes away! Sadly I'm unable to stay next to the installation holding the cable as a long term solution..  What could this problem be?? 

Someone suggested that as spi is such a high frequency signal and can be prone to reflections down the data line, my hand might actually be absorbing some of the signal to the point that the reflection is no longer significant, but his fix of a 50ohm resistor on the data line did not help, so I'm dubious.

I've tried different types of cable. Cat5, sheilded 2 core, twisted two core, and nothing has really helped.

It's driving me mad!
79  Using Arduino / LEDs and Multiplexing / Re: ws2801 led strip problems on: November 29, 2011, 05:27:57 am
Still no joy.

Is there any way I could have damaged the ws2801 chips by sending wrong data down the wrong wire?  Eg sending CLK into SDI?

Wouldn't have thought so but I'm pretty sure I didn't connect power up to the wrong place
80  Using Arduino / LEDs and Multiplexing / ws2801 led strip problems on: November 25, 2011, 10:38:26 am

I tried recently to get one of these led strips working with an arduino. 

Had no joy, having followed the instructions using sample code on that page, and All that happens is the first led in the strip flashes, and only when the ground from the 5v supply is not linked to arduino ground.

At the same time I got some of these which use the LPD6803 and they worked fine with the sample code provided.

Since then I got a strip similar to this along with a controller someone had made using an mbed NXP LPC1768.  This came pre wired and worked straight out of the box (artnet dmx control built in - really nice) and I though I'd have a go at controlling that strip using an arduino.  No joy, same problem as above.  I wired the string back up the the mbed controller and now it doesn't work either!

First thoughts are probably that I've connected the power up incorrectly and blown something but I've been really careful and am pretty sure I haven't done this. I noted the wires used for power on the (working) setup with the mbed and made sure to use the same (apparently it's fairly common for the cable colours to change between batches of these led strips) with the arduino. 

I'm a little confused as most people seem to have a really easy time getting these to work and I'm not really sure how to troubleshoot further. It's a little worrying that I seem to have broken the new strip, as I have no idea how that might have happened. Does anyone have an idea of how to troubleshoot from here?

Here is the last setup I tried -

Strip <-----> Arduino
SDI <-----> Pin 2
CKI <-----> Pin 3
GND <----->  GND

Strip <-----> 5v power supply
GND <-----> GND
5v <-----> 5v

Using the sketch here -

81  Using Arduino / LEDs and Multiplexing / Re: uploading through UNO to Rainbowduino on: November 21, 2011, 07:49:00 pm
Courtesy of Albert Miao at the Seedstudio forum -

"You can try like this.
1.Upload a blank sketch to Arduino Uno to disable Arduino Uno Serial Port.
void setup()
DDRB = 0;
DDRC = 0;
DDRD = 0;

void loop()

2.And connect as:

Rainbowduino <--> Arduin Uno
TX <-->TX
RX <-->RX
DTR<-->RESET Arduino Duemilanove or Nano with ATmega328 in Arduino IDE.
4.upload a sketch...

Good luck
82  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: August 16, 2011, 02:08:55 pm
Hey Grumpy

Everything worked ok for version 1 of the installation the other day. Thanks loads for your help in getting there. Don't know if I ever said but these led's were for a sound reactive light installation in a club.

I now need to refine a few things so have a couple more questions if you'd be so kind smiley

I ended up using a version of firmata to interface the arduino with the control software (vvvv) and the resolution of the pwm outputs with this is only 8 bit. Turns out this isn't at all enough to do smooth and subtle transitions in brightness at the lower brightness levels as there is a very visible step between each value.  Any idea what the maximum resolution is when using pwm straight from the arduino board?

Something that would help in addition to this would be a way to electronically affect the current from the output with a sort of function curve which would mean that the spacing between steps in the lower end is smaller than the spacing at the higher end. This would give me more control over the lower brightness values which I found to be of most importance.  Is there any (simple) way to acheive this?

83  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: August 04, 2011, 06:00:55 pm
If I'm running several of these circuits from the same power source, will a single .1uF between +ve and ground suffice, as long as the voltage is within limits?
84  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: August 04, 2011, 07:35:46 am
Yes you're right.

I tried measuring with a slightly better meter and the resistors read as 1.2ohm which is what they should be.  (1.7 is just what I measured, not the rated value)

Is there any benefit in using a capacitor in this circuit as you mentioned before?  If so how do I choose the value, and does it goes in parallel with the led?

85  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: August 03, 2011, 12:51:43 pm
Hi Grumpy.

I think it's ok. I thought the voltage drop of the lm317 was less than what it is. I now get consistent current when the voltage is over 6.5 volts (~3 for the led and ~3 for the lm317)

Thing is, I have removed the transistor and pwm source, and I'm getting a much higher current going through the led than expected.

I'm using a 1.7ohm (tested) resistor between the adj and vout pins, and as I understand it the calculation is

1.25volts (regulated voltage) / 1.7ohms = 0.735Amps

whereas I'm getting 1.03A through the led....

Any idea where I'm going wrong?
86  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: August 03, 2011, 10:38:23 am
By output reference voltage I mean that between the vOut and Adjust pins
87  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: August 03, 2011, 10:34:11 am
Testing the circuit in the image above (but with only one led), changing the voltage going into the lm317 affects the current going through the led. 

I thought that the lm317 will keep a constant reference voltage output regardless of input voltage (within limits) which means the current going through the led remains constant.....?

Is something amiss?
88  Using Arduino / Programming Questions / making an encoder count backwards on: July 20, 2011, 03:30:48 pm
Hi. I've been playing with bits of code on this page to get my shiny new optical encoder working as a motor controller.

I started with this one
//PIN's definition
#define encoder0PinA  2
#define encoder0PinB  3

volatile int encoder0Pos = 0;
volatile boolean PastA = 0;
volatile boolean PastB = 0;

void setup()

  pinMode(encoder0PinA, INPUT);
  //turn on pullup resistor
  //digitalWrite(encoder0PinA, HIGH); //ONLY FOR SOME ENCODER(MAGNETIC)!!!!
  pinMode(encoder0PinB, INPUT);
  //turn on pullup resistor
  //digitalWrite(encoder0PinB, HIGH); //ONLY FOR SOME ENCODER(MAGNETIC)!!!!
  PastA = (boolean)digitalRead(encoder0PinA); //initial value of channel A;
  PastB = (boolean)digitalRead(encoder0PinB); //and channel B

//To speed up even more, you may define manually the ISRs
// encoder A channel on interrupt 0 (arduino's pin 2)
  attachInterrupt(0, doEncoderA, RISING);
// encoder B channel pin on interrupt 1 (arduino's pin 3)
  attachInterrupt(1, doEncoderB, CHANGE);


void loop()

 //your staff....ENJOY! :D

//you may easily modify the code  get quadrature..
//..but be sure this whouldn't let Arduino back!
void doEncoderA()
     PastB ? encoder0Pos--:  encoder0Pos++;

void doEncoderB()
     PastB = !PastB;

which worked well apart from the fact that the direction differed every time I used it, and it seemed to depend on which direction it was turned to begin with. This was not acceptable for motor control!

So I'm now looking at this one -

enum PinAssignments {
  encoderPinA = 2,
  encoderPinB = 3,
  clearButton = 8

volatile unsigned int encoderPos = 0;
unsigned int lastReportedPos = 1;

boolean A_set = false;
boolean B_set = false;

void setup() {

  pinMode(encoderPinA, INPUT);
  pinMode(encoderPinB, INPUT);
  pinMode(clearButton, INPUT);
  digitalWrite(encoderPinA, HIGH);  // turn on pullup resistor
  digitalWrite(encoderPinB, HIGH);  // turn on pullup resistor
  digitalWrite(clearButton, HIGH);

// encoder pin on interrupt 0 (pin 2)
  attachInterrupt(0, doEncoderA, CHANGE);
// encoder pin on interrupt 1 (pin 3)
  attachInterrupt(1, doEncoderB, CHANGE);


void loop(){
  if (lastReportedPos != encoderPos) {
    Serial.print(encoderPos, DEC);
    lastReportedPos = encoderPos;
  if (digitalRead(clearButton) == LOW)  {
    encoderPos = 0;

// Interrupt on A changing state
void doEncoderA(){
  // Test transition
  A_set = digitalRead(encoderPinA) == HIGH;
  // and adjust counter + if A leads B
  encoderPos += (A_set != B_set) ? +1 : -1;

// Interrupt on B changing state
void doEncoderB(){
  // Test transition
  B_set = digitalRead(encoderPinB) == HIGH;
  // and adjust counter + if B follows A
  encoderPos += (A_set == B_set) ? +1 : -1;

Which works well but for one thing, when it counts below zero it goes to 65535 rather than -1 (which I need), and is the way the first example works.  Is there a way I can either make the second example count decreasing values below zero as negative numbers, or make the first example count in the same direction every time?

Thanks guys
89  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: June 07, 2011, 05:34:19 am
haha  alright Grumpy!

Could've been clearer smiley

Think I'm comfortable working out the resistor and regulator values for a particular current.

Presumably I can find arrayed versions of the regulator, transistor, and resistor to make a more compact multi channel version of this circuit.

Yay think I 'm finally there!
90  Using Arduino / LEDs and Multiplexing / Re: multiplexing with pwm? on: June 06, 2011, 04:54:26 pm
I'm not planning to use that led arrangment, the image was ripped from that instructables link.

I'm thinking a single one of these or similar in place of those parallel strings
Pages: 1 ... 4 5 [6] 7 8 9