enter image description here

Can anyone help me fix this? It always restarts when I power the servos with an external battery. I connected one battery to Arduino and one battery to servos, each 5V, but my Arduino keeps restarting.

  • 1
    Where is the supply for your Arduino board coming from?
    – oldfart
    Apr 15, 2018 at 11:29
  • I connect two batteries for Arduino and for the servo but the Arduino keep restarting after few seconds
    – Abhijit leihaorambam
    Apr 15, 2018 at 11:36
  • You are using same power supply for UNO and servo I guess.
    – Mitu Raj
    Apr 15, 2018 at 12:43
  • The first thing I saw was a cartoon where apparently a schematic should be. I'm not even going to look at the rest. Automatic -1 and closing.
    – Olin Lathrop
    Apr 15, 2018 at 12:53
  • 1
    Are both those black wires connected together?
    – Nick Gammon
    Apr 16, 2018 at 8:16

2 Answers 2


You will need to fix this on your own but I can suggest some things that you will likely need to investigate.

  1. Evaluate what exactly causes the AVR to get reset. It is highly likely that long wires and current surges as loads are applied is causing either the GND or the VCC to the AVR to be compromised and initiating a brown out reset in the MCU.
  2. Driving inductive loads without proper design may be putting high voltage spikes into your design that create havoc with proper software execution and/or risking serious damage to the silicon components. Make sure you take steps to eliminating such with clamp diodes, filter caps or zener diodes.
  3. You will have to check your exact MCU data sheet but many parts have a reset reason register that your software can read to see what particular thing initiated the reset.
  4. Lastly the most important thing is to make sure you have the proper tools for debugging problems like this. It is very common that you should have access to an oscilloscope so you can find the problems and learn how to fix them. The best way to learn how to design in a way that you avoid problems like this on the next project is to see first hand what went wrong and learn from it.

The reason here is, you are not able to provide enough current required for the servo. There are multiple ways to work around.

  1. Change the code: Just try to rotate only one servo at a time. Rotate the second servo after servo1 finished rotation.

  2. Use a 9V battery and connect it to the power socket of arduino [this could solve the issue if you are using normal servos]

  3. Use separate power supplies for servo and Arduino. Use two different 5V supplies to power servo and arduino. Please don't forget to connect the grounds of both supplies together.

Your Answer

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