I am using my Arduino to generate control signals for my GWS S03N STD servo,while powering the servo from an external supply, and that is working fine.
However, I would like to be able to turn the servo on and off via a digital HIGH/LOW signal from the Arduino. To do this, I have been using the Darlington Pair transistor configuration from Motors 1. where output pin is connected to a digital output on the arduino.
But for some reason this messes up the control signals to the servo. Again, if I connect the motor directly to the power rails, it all works fine, but as soon as I place the transistors in circuit, I end up with serious noise problems on the control signal. As well as on the output pin. I have tried adding the recommended smoothing capacitors and various diodes (but not the inductor), as well as a low-pass filter to the output pin but nothing seems to help. Both the Arduino and power supply share a common ground.
May have nothing to do with your symptoms, but you really need to have a current limiting resistor between your output pin and the base of that transistor. Otherwise you are in danger of damaging the output pin. 1K ohm should work fine.
Is it really nessesary to turn power on and off to the servo? They aren't designed to work that way and there might be a backdoor circuit between the servo's control signal wire wired to the arduino pin when the servo is turned off. You might try changing the arduino output pin wired to the servos control wire to be a input pin just before you remove power from the servo. Then change it back to a output pin after you power up the servo.
However, I would like to be able to turn the servo on and off via a digital HIGH/LOW signal from the Arduino.
If you isolate the servo ground, you may damage your servo and arduino board. If you stop sending control signals to the servo, it is basically turned off. If you use the servo library below, you should be able to use the detach function.
By OFF, I mean disconnect the power supply from the servo. I can control its position accurately, but it is still drawing power even when stationary - (I can tell this by the gentle hum and vibration it emits). It may be because it is a very cheap servo, but I don't want it pulling any power at all when it is not in use.
Anyway, I have decided to switch the servo power via a Relay with a transistor driver driven from the Arduino, along a separate voltage regulator to power the servo - hopefully this should keep everything clean.
By OFF, I mean disconnect the power supply from the servo.
By disconnecting the power and still leaving the outputs connected you are feeding in a signal to an electronic circuit input that has no power. This is often leads to trouble in the form of latch up. That means the the circuit no longer works when power is re applied and you have to remove both the power and the signal input before it will work again.
One way round this is to make sure the input to the servo is zero before removing the power.