I’m trying to operate a sub-micro server (Servo - Generic (Sub-Micro Size) - ROB-09065 - SparkFun Electronics) from an Arduino Uno. When the Arduino is powered from the USB, everything operates normally. When I power the Arduino from three “123” batteries (3v x 3 = 9v) via the Vin port, it acts strangely.
For testing, I’m only using void setup() to move the servo. See code. When Arduino is powered from USB, I can see the servo go from 70 to 100 and back again to 70, just as it should.
However, when I disconnect the USB, and connect the batteries to Vin, the servo immediately jumps to over 100 (I don’t know the exact number), a second elapses, and then I can see the servo go from 70 to 100 and back again to 70. If I hit the reset button, the same events occur.
If I disconnect the batteries, and attach the USB, the nasty event just described happens, but only once. If I hit the reset button, the servo acts according to the code.
Thanks in advance for any help.
ServoCalibration.ino (1.15 KB)