Servo control to pause and resume

I need to set up one servo to turn from 0degrees to 90degrees pause at 90degrees for 5 minutes and then return to zero. The aim is to save battery power so when pausing at 90degrees the servo needs to sleep so that it doesn't draw power if possible. i have tried the servo sketch and used the delay parameter but beacuse the servo is still pulling power with the delay command, the battery goes flat fast. any ideas how i can do this?

Did you try “servo.detach();”?

Thanks for the advice. I ampeobably foing completely the wrong thing. I did try “servo.detach()” but the servo didn’t move. I have been trying to modify the code in the following brilliant article but can’t get the servo to do what i need.

http://interface.khm.de/index.php/lab/experiments/time-lapse-photography-with-arduino-and-chdk/

I tried changing “softwareservo” with “servo” module but since i am new in the Arduino world not sure if i am doing this right.
The Code extract using “servosoftware” is as follows:

void cameraSwitch() {

int tt=0;
int phi=0;

pinMode(pinServoOn,OUTPUT);
digitalWrite(pinServoOn,1);
Serial.println(“shoot picture”);

for (phi=0 ; phi < 1; phi++){
myservo1.write(phi);
delay(20);
SoftwareServo::refresh();
}
for (phi=180 ; phi > 10; phi–){
myservo1.write(phi);
delay(20);
SoftwareServo::refresh();
}
myservo1.detach();
delay(5000);
myservo1.attach(11);
delay(1000);
digitalWrite(pinServoOn,0);
digitalWrite(pinServoOn,0);
}

Basically i need to set up an irrigation system where the servo operates a water valve to water the plants for 5 minutes every other day. So thought using a ds1307 and “timelapse photo” programme i could get everything to sleep and then wake up every otherday to operate tehh servo for 5 minutes and then shut the valve and sleep. so far no luck.

The servo should stop moving when you use .detach(). Make sure you re-.attach() the servo before trying to move it again and giver it time to reach its destination before you .detach()

Something like this:

void loop()
    {
    //  If it's time to open the valve
    myServo.attach(myServoPin);
    myServo.write(MyServoOpenPosition);
    delay(1000);  //  Give the servo time to move
    myServo.detach();   // Stop sending pulses so the servo doesn't try to move

   delay(5UL*60UL*60UL*1000UL - 1000UL);  // Delay the rest of the 5 minutes

    myServo.attach(myServoPin);
    myServo.write(MyServoClosePosition);
    delay(1000);  //  Give the servo time to move
    myServo.detach();   // Stop sending pulses so the servo doesn't try to move
    }