Servo problems with long cable

Hey guys! I'm currently working on a project that requires me to control a servo over a cable that is longer than the usual 10-15 cm jumper wires.. In fact I'm using a 20m long cable to access the servo I need to control and there is absolutely no other way than using the 20m. Now the problem is that the servo will work properly when attached with short cables but will go totally nuts with the long one. I figured out that it was due to a voltage drop, so I tried hooking it up to an extern power source that is more powerful. This seems to work partially because my multimeter is now showing 5V(needed) at the end of the cable but as i can't put more voltage through the pwm pin the servo isn't moving..

Any ideas? any possibility to make the pwm signal stronger?

When wiring up the external DC power source for the servo(s) did you remember that there still needs to be a common ground wire from the negative of this supply to an arduino ground pin? The control signal will not work without a common ground.

Basically you cannot expect a logic signal to go down 20m cables, that isn't likely to work.

But more than that is matters vitally on the nature of the cable. screened? twisted pair? just a bundle of separate wires?

Try adding a 180 ohm resistor between signal and ground at the servo, which will terminate the cable better. You should run signal and ground as a twisted pair, and also another two wires for supply (a second, thicker ground and 6V wire pair). The signal ground is there to be part of the twisted pair and cancel noise pickup, the power ground doesn't care about noise pickup.

Add a 1000uF+ 6V3 or 10V electrolytic across the supply wires at the servo too so you don't put large current transients down the power wiring.

Keep the signal pair and the power pair apart if at all possible.

Yes, I did, still didn't work..

BUT i somehow just got it to work and i absolutely don't know why.. this just looks like magic to me haha XD

I was trying to amplify the pwm with a transistor and i just wanted to hook it up when it suddenly started to work after connecting only the base and the collector.. so i was like WTF there is still 1 connection missing how is this even supposed to work??

So i came across the idea that it has to do something with a diode inside the transistor or something and i just removed the transistor and put in a diode blocking current that would flow back into the pwm pin and not to the servo and it just works??

WTF? can anyone explain that to me?

Edit: Didn't read your response when i was writing this MarkT, I'm using 3 separate cables- GND, V & logic

You might try upping the voltage at the servo. Note that the minimum specified voltage for the typical hobby servo is 4.8v, so only supplying 5v down the long wire is marginal at best. You might try supplying 9-12v down the wire with a 7805 chip setup like below to supply 5.7v to the servo.

Or a 7806, but not sure if they are as easy to find?

luc373: So i came across the idea that it has to do something with a diode inside the transistor or something and i just removed the transistor and put in a diode blocking current that would flow back into the pwm pin and not to the servo and it just works??

WTF? can anyone explain that to me?

The diode is suppressing ground-bounce? Causing signal reflections that double the voltage? Who knows? Unless you point an oscilloscope at the thing its guesswork.

What kind of cable are you using? Have you tried a 180 ohm load resistor at the receiving end for the PWM? Large electrolytic decoupling capacitor on the servo supply?