A DIY robot's motor drive system is the electrical bridge that translates low-voltage microcontroller logic signals into high-current directional power for DC motors while managing inductive kickback. Getting this architecture right changes a robot that resets every time a wheel catches on a rug into one that reliably pushes through obstacles without crashing the main controller. However, builders commonly confuse a motor driver's continuous current rating with its peak/stall current rating, leading to melted silicon, logic brownouts, and endless debugging sessions.
The Math: Stall Current vs. Continuous Current
To understand why DIY robots fail, we have to look at the numbers. The most common actuator in hobby robotics is the standard yellow TT gearmotor (1:48 ratio). Let us run the math on a typical 2WD (two-wheel drive) setup.
- No-load current: ~150mA at 6V
- Typical operating current: ~400mA at 6V (pushing a 500g chassis on hard floors)
- Stall current: 2.5A at 6V (when the wheel is physically blocked)
If your robot hits a wall, both motors stall simultaneously. Your power system must suddenly supply 5.0A. If you are using the ubiquitous L298N bipolar motor driver, you run into a massive thermal and voltage-drop problem. The L298N uses bipolar junction transistors (BJTs) which inherently drop about 2.0V across the H-bridge.
Let us calculate the power dissipated as heat in the L298N at a 2A continuous draw per channel:
P = I × V_drop = 2A × 2.0V = 4.0 Watts of heat per channel.
Without a massive heatsink, the L298N's internal thermal shutdown triggers in seconds. Furthermore, that 2.0V drop means if you feed it 6V, your motors only see 4.0V, severely reducing your stall torque exactly when you need it most.
Where You Meet This in Practice
On the workbench, the solution is to abandon legacy BJT-based drivers and move to MOSFET-based H-bridges. Modern MOSFET drivers have an on-resistance (R_DS(on)) measured in milliohms, resulting in a voltage drop of roughly 0.5V or less.
| Motor Driver IC | Type | Continuous Current | Peak Current | Voltage Drop (Approx) | Best Use Case |
|---|---|---|---|---|---|
| L298N | BJT | 2.0A | 3.0A | ~2.0V | Legacy projects, high voltage (12V+) steppers |
| TB6612FNG | MOSFET | 1.2A | 3.2A | ~0.5V | Standard 2WD ESP32/Arduino DIY robots |
| DRV8833 | MOSFET | 1.5A | 2.0A | ~0.4V | Compact custom PCBs, low-voltage LiPo builds |
| BTS7960 | MOSFET | 43A | 43A | ~0.1V | Heavy combat robots, 12V+ high-torque motors |
For a standard ESP32-based DIY robot using TT motors, the TB6612FNG is the sweet spot. Its 3.2A peak rating comfortably covers the 2.5A stall current of a single TT motor, and the low voltage drop ensures your motors get the full battery voltage. For deeper architectural theory on H-bridges, Texas Instruments' motor driver documentation provides excellent primers on MOSFET gate driving and dead-time insertion.
Real-World Scenario Walkthrough: The Carpet Edge Brownout
Theory is great until your robot hits a carpet edge and reboots. Here is a breakdown of a classic failure mode I see constantly in DIY robot forums.
- The Setup: A 2WD ESP32-DevKitC V4 robot powered by a 2S LiPo battery (7.4V nominal, 8.4V fully charged). The builder uses an L298N driver and powers the ESP32's
VINpin directly from the L298N's onboard 5V regulator. - The Numbers: The robot is cruising on hardwood. Current draw is 400mA per motor. The LiPo sits comfortably at 8.0V. The L298N drops 2V, feeding 6V to the motors. The L298N's linear 5V regulator steps the 8.0V down to 5V for the ESP32, dissipating the excess as heat.
- The Event: The robot drives off the hardwood and onto a thick rug. The wheels catch. Both motors instantly stall.
- The Outcome: The current demand spikes to 5.0A. The LiPo battery has an internal resistance (ESR) of about 0.15 ohms. Using Ohm's law (V = I × R), the voltage sag across the battery's internal resistance is 5.0A × 0.15Ω = 0.75V. The terminal voltage drops from 8.0V to 7.25V. However, the L298N is now overheating and its internal resistance increases, causing the 5V output to sag to 4.2V.
- What Went Wrong: The ESP32's onboard AMS1117-3.3 LDO requires a dropout voltage of about 1V to maintain a stable 3.3V rail. With only 4.2V coming in from the sagging L298N regulator, the 3.3V rail drops to 3.0V. The ESP32's Brownout Detector (BOD) triggers, or worse, the flash memory fails to read mid-instruction, causing a hard crash and a reboot.
5V or VIN pin directly. This isolates logic power from motor voltage sags and eliminates the heat problem.
FAQ: Power and Logic in Robot Builds
Do I need to add external flyback diodes if I use a TB6612FNG?
No. Modern MOSFET motor drivers like the TB6612FNG and DRV8833 have internal body diodes that safely route the inductive kickback (back-EMF) generated when the motor is suddenly turned off. Adding external Schottky diodes is only necessary if you are building a custom H-bridge from discrete components or using very old, unprotected ICs.
Why does my ESP32 throw a "Brownout detector was triggered" error in the serial monitor?
This is a hardware protection feature, not a software bug. It means the 3.3V rail dropped below the safe threshold (usually around 2.43V). In DIY robots, this is almost always caused by sharing a weak 5V power source between the logic and the motor driver, or using long, thin wires between the battery and the driver that cause severe voltage drop under load. Upgrade your wiring to at least 18 AWG silicone wire for the main power bus.
Can I use a single 18650 cell (3.7V) to power both the ESP32 and the motors?
It is highly discouraged. An ESP32 requires a stable 3.3V rail. A single 18650 ranges from 4.2V (full) to 3.0V (empty). You would need a buck-boost converter to maintain 3.3V or 5V, which adds cost and switching noise. Furthermore, a single cell cannot supply the 5A stall current without severe voltage sag. A 2S LiPo (7.4V) paired with a 5V buck converter is the most robust architecture for small DIY robots.






