does a detached servo with power sraw current?

  myservo.detach(ServoPin);  // detaches the servo on pin 9 to the servo object

If you detach a servo, but still have the Gnd & +5 volts wires hooked up, is it drawing any current or holding it's current position?

SouthernAtHeart:

  myservo.detach(ServoPin);  // detaches the servo on pin 9 to the servo object

If you detach a servo, but still have the Gnd & +5 volts wires hooked up, is it drawing any current or holding it's current position?

That is really two questions, isn't it?

  1. A servo that is detached (has no active control signal) but still wired to ground and +5vdc, will still draw some minimum amount of current. How much is specific to your servo. Simply measuring it's current draw with a multimeter will give you the answer.

  2. A servo without a active control signal will to stopped, but can offer no resistance to external forces acting on it's output shaft. So it will hold position as long as external forces aren't higher then the servos gear reduction friction.

Servos were never designed to be powered up but without an active and continuous control signal. So while the Arduino servo library allows one to 'detach' a servo, that is operating a servo in a mode it was never designed for and it's exact characteristics and response to that situation is undefined by the servo manufacture. I can't really see a need or advantage to having to 'detach' a servo in standard servo applications, at least from the servo's perspective?

Lefty

I can't really see a need or advantage to having to 'detach' a servo in standard servo applications, at least from the servo's perspective?

You need to when also using the newsoftserial library as they use the same timer so interfere.

The reason for this question: I'm still hoping to just use a servo to open and close a drawer (the drawer is actually a platform on which a coffee pot sits in a cupboard). I know a servo is not designed to be used this way, but it would save having to rig up extra sesnors/limit switches, and a servo is easy to use. Being it's just used a few seconds a day thing, maybe it'll work for years.
Here's my first run at code for it. Does it look promising?

/* servo speed: 
0    full speed reverse
90   stopped
180  full speed forward
*/
Servo myservo;  // create servo object to control a servo 
  
void Servo_Out()
{
  myservo.attach(ServoPin);  // attaches the servo on pin 9 to the servo object
  lcd.clear();
  lcd.print("1 coffeepot coming up, er, out.");

   int intDelay = 20;  //changing delay will change the overall distance. 
   int x = 1;
   for (int i = 91; i > 90; i = i + x){  //loop from 90 to 179 and back to 90
      myservo.write(i);     // sets the servo speed 
      if (i = 179) x = -1;  // start to slow down at full speed
      delay(intDelay);  // set distance to 0.5" longer than drawer travel
   } 
  myservo.detach();  // detaches the servo on pin 9 to the servo object
}

As retrolefty said, servo behavior without a control signal is undefined. The actual behavior and characteristics are going to be entirely dependent on the manufacturers specific design. In any case, it's unlikely detaching from a servo in code is going to have any beneficial effect. If there is currently no load on a servo, then it should only be drawing enough current to power the control circuitry. Detaching shouldn't have any affect on that. If there is a load on the servo, then detaching will likely have an undesirable affect as the servo will then no longer try to maintain it's position (since it doesn't know what its position is supposed to be).