Hello, I'm new to electronics, but I would like to start a project using an arduino, and I had a question. Say I wanted to lift a flap using a servo motor, and I wanted it to be able to stay there for an extended period of time, and then close. Could I just use the detach() command from the integrated servo library to tur the servo off, and then use the attach() command to turn it back on again later? Thank you, igpay
it all depends on what that flap is gonna end up doing. if the servo is to continue to support a load, it has to stay attached (and depending on what library youre using, stay refreshing). if you only need it to move the flap to a position, but then the flap doesnt have any forces acting on it, you can go ahead and detach it. just make sure to reattach it before sending it another command
I agree with Knucles904 but you may also get a glitch when you detach it, in which case it will twitch to a new position before sitting still.
There are (expensive) digital servos which can be programmed with various parameters, including fail-safe behaviour in the event of loss of input signal and the like, which might make your setup more robust for a price.
thank you both for helping, bt I have one more question. Will the servo still use electricity even when it is detached? Thanks.
There are two things using electricity in a servo: the potentiometer providing position feedback, and the motor providing motion. The second is the hog, but should only draw when in use, the first is more frugal but always draws a current when connected to power and ground.
In other words, yes but probably not a huge amount, particularly compared to the values when it is moving around.
Having said that, nothing beats taking some measurements as I'm just spouting RC folklore and have never taken a ampmeter to it.