[SOLVED] Power consumption issue with servo library / servo.detach not working properly


#1

I’m measuring draw on my project and noticed something strange. On powerup with the servo disconnected via a transistor the DK will draw around 0.5-0.7ma at idle with my code. As soon as I use the servo once (Servo.attach, Servo.write, Servo.detach, remove power from transistor) the idle draw goes up to 1.7-1.9ma. I did some more testing to isolate this and found that if I even do just a Servo.attach/Servo.detach with power to the servo completely disconnected the whole time I see the same draw increase.

Could this be something with the servo library implementation?

EDIT: I also notice that even after detach the DK is still sending a signal to the pin. If I pull power from the servo, manually turn it, and turn power back on it returns the servo to the previously set position and holds. I’m guessing this is where the extra draw is coming from…


#2

Was looking through the code… was this not implemented yet?


#3

Sorry about that, yes, somehow it wasn’t checked in to disable the servo on detach. I just added it, so this will be in the GA release.


#4

Do you know when that will be? Will there be any new beta releases before that?


#5

The change is checked in, so you can compile locally in the meantime if you need to. The GA release should be soon, I would say next week at the latest, just waiting to make sure any issues with the upgrade process are worked out.


#6

Looking good on the GA release!