3

I have a Servo Motor and an Arduino Uno.

I used the Arduino to run a servo motor. The code was very simple. It was to just Turn it 90 Deg Anti-Clockwise when a switch is pressed and Turn back to its original position (90 Deg Clockwise).

The servo had 3 pins. 1. V+ 2. Ground 3. Data

I connected the V+ to the Arduino's 5v Output. And the Ground to the Arduino's GND pin. I connected the Data to Digital Pin 3.

When ever this script runs, The servo turns a little and then stops. It stops because the arduino froze and It wont do anything. I pressed the Reset button and it does nothing. I plugged off the Servo and the Power Supply and replugged the Power and it works.

The power source was a battery pack with 4x 1.5 Volts batteries in it. Maybe there was a problem with this?

Do anyone know what might be the problem here? Any Answer will be Appriciated. Thanks.

8
  • Can we get a schematic and your code? Might be something in the code.
    – Josh Jobin
    Commented Jan 7, 2016 at 11:33
  • Also, does this occur every time you run it? Is the problem reoccurring?
    – Josh Jobin
    Commented Jan 7, 2016 at 11:33
  • 2
    Servo maybe gets at start too high current, which causes a drop in voltage at 5V and freezing microcontroller?
    – sigaris
    Commented Jan 7, 2016 at 11:43
  • Which servo motor are you using? Do you have the spec, or at least an exact model name? Commented Jan 7, 2016 at 11:45
  • 3
    Possible duplicate of Why does connecting a high-current device to my digital circuit cause weird behavior?
    – Matt Young
    Commented Jan 7, 2016 at 14:43

3 Answers 3

2

You said that you were using 4x 1.5v batteries. That would make a total of 6 volts. The current that those batteries can supply is also little.

The Recommended Input Range is 7-12 volts. And the Limit is 6-20 volts.

You were supplying it with 6 Volts which is at the very limit of the Input Voltage Range. When the motor runs, the Voltage might have dropped and made the arduino freeze.

The fix is to supply the arduino with another source such as a benchtop supply that can supply more than 8 volts.

1
  • Not necessarily wrong, but 99% likely only part of the issue.
    – Matt Young
    Commented Jan 7, 2016 at 14:44
1

Connect your servo V+ to your battery stack and the servo data input to your Arduino. I suspect that the servo is causing the Arduino to reset when the servo draws too much current through the Arduino's voltage supply circuitry.

1

My first response would be a brown out reset. Because of the load the voltage will sag and drop below a certain voltage so the microcontroller will reset. Try to put a big buffer capacitor on the power supply.

Other possible cause could be inductive spiking, but I dont expect this to be the cause of your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.