I'm building an self-navigating robot with an arduino, an ultrasonic sensor, and two DC motors. I'm currently within the process of coding the robot but I've discovered I have an unusual problem; whenever I run the project via the USB cable operations run fine, however once I take the cable out and run the system on batteries alone performance diminishes.

I have checked the code thoroughly, however I don't understand how this could be an issue that's coding related. I also (as part of the testing) built a basic program which only operated the motors, and was able to run this via USB and via batteries alone with no difference in performance.

So what possible reasons could there be for a drop in performance? I have included a link to a youtube video I had taken of it earlier below to maybe give a better understanding of how performance diminishes:


(Also it could be important to note if I take the cable out while motors are currently moving performance stays at where it should be)


  • Can you show us the sketch you are using? Are you using Serial to write to the serial monitor?
    – VE7JRO
    Mar 9, 2019 at 17:01
  • What are you using to power the board? Looking at the video, it looks like the motors are using more current than the batteries can supply, which causes the voltage to drop, which causes the arduino to reset (brown-out reset). You can see the following sequence in the video: Arduino turns on motor; voltage drops and Arduino resets (motors also turn off); Arduino bootloader does it's 3 second timeout; and the again start the motor, etc. etc. PS Starting a motor takes more current than when it's running. That is probably why unplugging the USB doesn't immediately reset the Arduino.
    – Gerben
    Mar 9, 2019 at 17:40
  • Ahhh I see, so that's why it's fine when it's running but it can't get started! A brownout makes a lot of sense, thanks. The motors are being powered by 4 AA batteries connected in series, these batteries also power the arduino so I might swap in a 9V battery for the arduino and see if that impacts it
    – walkman118
    Mar 9, 2019 at 18:08
  • Yeah, 6V is barely enough to power the Arduino voltage regulator. 7.5V or 9V would be better. If the voltage droops at all at 6V the Arduino’s regulator doesn’t have enough to work with. Using a separate 9V battery connected to the Arduino’s barrel connector would be a good idea.
    – Duncan C
    Mar 10, 2019 at 0:35
  • The recommended minimum to the voltage regulator is 7V, so 6V is already lower than you want to go.
    – Duncan C
    Mar 10, 2019 at 0:36

1 Answer 1


What seems is that you are facing an power shortage while working with on board power supply. While running DC motors and Arduino on same battery set your Arduino is not getting enough power.

Try switching to a better power supply which can maintain a constant EMF, as eventually you'll always run out of power. Try an adaptor to use wall socket current. This way you'll not lose any functionality of Arduino project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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