SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on the software and hardware for Atmel's STK standard.
By FoxholeNorman
#77299
I just wanted to know if there was a limitation on how far you can run a cable for an adc. Basically i have a simple analog stick from an old ps2 controller and i wanted to push 5V through and use it as a rate controller on an arduino mega. It worked great when i hooked it up on an o-scope and when i tested it close to the MCU, but when i put a cable (about 5ft) on it it would only output 5V at any position of the joystick.

Thanks,

Fox
User avatar
By leon_heller
#77309
Connections to ADC inputs should be as short as possible, otherwise they pick up noise.

Leon
By signal7
#77392
To flesh out Leon's curt response, you can actually make the cable as long as you would like, but you will need to put a low pass filter on it near the microcontroller. As Leon said, you'll have a problem picking up noise and at the same time you'll want to pay attention to the nyquist frequency limits. Usually a low pass filter takes care of both at the same time.

Otherwise, I'm not sure why you would be getting the strange results. I'd check it with an oscilloscope again with the longer cable in place to see what's happening. If anything, I'd expect the resistance/capacitive/inductive effects of the cable to degrade the signal by a small amount but 5 feet isn't really a long distance, imho.
By riden
#77404
It sounds like a miswire or open ground between the Arduino and the stick.
By brainwav
#77436
What about using a shielded twisted pair cable?? Would that take away the noise?
By qema
#77540
brainwav wrote:What about using a shielded twisted pair cable?? Would that take away the noise?
Shielded cables will reduce the noise, just make sure you connect the shield to ground.