I'm using an Arduino to control a servo, using external power supply (5V 3A) as follows:
the servo's '+' is connected to the power supply ('+')
the servo's '-' is connected to the power supply ('-')
the servo's control is connected to some digital pin.
the Arduino's 5V pin is connected to the power supply ('+')
the Arduino's GND is connected to the power supply ('-').
I'm using the servo.h library to control the servo.
Everything works fine, except that whenever I presses the 'reset' button or plug/unplug the power supply, there is a loud current-spike inside the servo
What am I doing wrong ? any suggestions for a fix?
ps: I've also tried to power the Arduino with a 9V battery (via its power jack) instead of using the 5V pin (while still connecting the board's GND to the power supply). and - same thing...
This is only a thought. But I would suspect that when the reset button is pressed and the power is removed from the regulator circuit, that the attached filtering capacitor is backflowing through the servo. It must be something of that nature.
You don't mention which board you are using, but they typically have a logical VCC and a Voltage in. The logical VCC is the voltage after passing through the regulator and it fuels the amtel chip. You do not need to hook the servo to this.
The servos power supply can go straight to the VIN / Battery without going the the regulator.
Thats what you want anyway. The whole purpose of the regulator circuit and it's attached filtering capacitors is to provide constant power regardless of a secondary load on a shared power supply.