I have a Servo motor and I am able to perform operations with no issues.
I connect my power supply, and the motor rotates to 90 degrees (if it was not at 90 degrees initially).
My problem is, I want the motor to rotate back to 0 degrees when the power supply is cut off. I know I will need another power supply to do this in the end (maybe a battery), but I am confused as to how to do it.
Put a diode into the positive main and backup supply, the combined cathodes to the servo. Then the servo will always use the supply with the higher voltage. Use Schottky diodes for low voltage drop.
use a supercap, that can power the
arduino and motor for longer than it takes to close
this, but add: main power source to the barrel connector. use one digital pin to monitor status of voltage at the barrel regulator. if you lose power at the barrel initiate the shutdown and park function.
supercap into the 5V feed. put a resistor in line with the 5V to the supercap, so the entire board does not turn into one glorious fuse when the cap charges up the first time.