sheen.bot logo

Insights

Why your robot reboots when the motors turn on (and how to fix it)

22 Aug 2026·Sheen Robotics
Why your robot reboots when the motors turn on (and how to fix it)

Your microcontroller restarts because the initial current spike from DC motors collapses battery voltage below its operating limit. Here is how to fix brownout resets in the classroom.

If your robot runs its setup code, lights up its LEDs, and then resets the exact moment the drive code executes, your microcontroller is experiencing a brownout reset. The motors are not frying the chip; they are starving it of voltage.

When a direct current (DC) motor starts from a dead stop, it demands a massive spike in current for a fraction of a millisecond. If your power supply cannot supply that current instantly, the voltage across your circuit plunges. The moment that voltage dips below the microcontroller's safe operating threshold—around 2.7V for a 3.3V chip like an ESP32, or 4.3V for a standard 5V Arduino Uno—the processor resets to protect its memory from corruption. Once the motor stops turning during the reset, the voltage recovers, the code boots again, and the loop repeats indefinitely.

The mechanics of a brownout

To fix this reliably, it helps to understand why the voltage drops in the first place. Two physical realities cause motor-induced reboots in school robotics kits:

  • Inrush current: A stationary DC motor has virtually no back-electromotive force (back-EMF). Electrically, turning on a motor is almost identical to placing a dead short across the power supply for a split second. A yellow hobby gearmotor that draws 150 mA while cruising can easily demand 1.2 A to 1.5 A at the instant it begins turning.
  • Internal battery resistance: Every battery has internal resistance. When four AA alkaline batteries or a pair of 18650 cells are asked to deliver 2 A to 3 A instantaneously across two drive motors, the voltage across the battery terminals drops in direct proportion to that internal resistance. Thin jumper wires and spring-loaded battery clips make this voltage sag significantly worse.

When you power a microcontroller and an H-bridge motor driver (such as an L298N, DRV8833, or TB6612FNG) from the same unbuffered battery pack, that voltage sag travels straight into the processor's supply line. The microcontroller interprets the drop as a power outage and reboots.

Fix 1: Add bulk decoupling capacitors

The simplest hardware fix that does not require adding a second battery pack is adding bulk capacitance near the motor driver.

A capacitor acts like a tiny, extremely fast reservoir of electrical charge. When the motor turns on and demands a sudden surge of current, the capacitor discharges into the motor driver before the main battery voltage has time to collapse completely.

  • Place a 470 µF to 1000 µF electrolytic capacitor directly across the motor driver's high-current power input terminals (Motor VCC and GND).
  • Keep the capacitor leads as short as possible. If it is sitting three breadboard rows away, the resistance of the push-in breadboard tracks will blunt its effectiveness.
  • Ensure correct polarity: the negative stripe on the capacitor must connect to ground (GND), and the positive leg connects to power.

For high-frequency electrical noise generated by the motor brushes, also solder a small 0.1 µF (100 nF) ceramic capacitor directly across the two metal terminals of each DC motor.

Fix 2: Split your power rails completely

If you are building four-wheel-drive robots or using higher-torque motors, bulk capacitors alone may not prevent voltage sag on tired batteries. The definitive engineering solution is splitting your power rails into logic power and motor power.

ConfigurationProsConsBest For
Single pack with bulk capacitorLightweight, fewer batteries to manage in classStill prone to resets if batteries are nearly flatLightweight 2WD line followers
Dual battery packsZero motor interference on microcontrollerExtra weight, two battery sets to chargeRobotics competitions, heavy chassis
Buck converter bufferSingle battery pack, clean regulated voltageRequires tuning voltage output with a multimeterAdvanced secondary school projects

To wire dual power supplies correctly:

  1. Power the microcontroller (Arduino, micro:bit, or ESP32) using its own dedicated power source—for example, a 5V USB power bank or a small 3.7V LiPo with a boost converter.
  2. Power the motor driver's motor power terminal (often labelled VM or VMS) from your main motor battery pack (e.g. a 4×AA holder or a 2S Li-ion pack).
  3. Connect all ground (GND) wires together. The microcontroller and the motor driver must share a common ground reference, or the logic signals controlling direction and speed will float and behave erratically.

Fix 3: Soft-start your motors in code

You can often eliminate motor reboots without touching a soldering iron simply by changing how your code applies power. In classrooms, learners typically write code that jumps instantly from rest to full speed:

analogWrite(motorPin, 255);

This instantaneous transition triggers maximum inrush current. Instead, ramp up the pulse-width modulation (PWM) duty cycle over 50 to 100 milliseconds using a simple loop. Accelerating from 0 to 255 in five small steps reduces the peak surge significantly, keeping the battery voltage above the microcontroller's brownout threshold without noticeably sluggish robot movement.

Classroom wiring mistakes that mimic brownouts

Before rewiring your entire chassis, check these three mechanical failure points common in classroom environments:

  • Push-in solderless breadboards: Breadboard power rails cannot reliably carry the 1.5 A to 2 A peak currents drawn by two spinning DC motors. Route high-current motor power directly through screw terminals or soldered connections, not through breadboard spring clips.
  • Thin jumper wires: Cheap 28 AWG dupont jumpers have high resistance. When motor current flows through thin jumper wires, the wire itself drops significant voltage before the power even reaches the motor driver.
  • Flat alkaline batteries: As alkaline cells drain, their internal resistance increases dramatically. A battery pack that reads 6.0V on a multimeter while idle might plunge to 3.2V under a 500 mA load. Always measure battery voltage while the motors are actively trying to turn.

If you are equipping a computer lab or competition team with reliable power distribution hardware, driver modules with integrated filtering are available in the Sheen Robotics store, or as part of our structured robotics kits through Infinity.

#robotics#electronics#troubleshooting#stem-education

More Insights