Build a Phone-Controlled Robot Car with ESP32
Share
A phone-controlled robot car works by splitting one job between two parts: an ESP32 microcontroller uses its built-in Wi-Fi or Bluetooth radio to receive a direction command from a phone, and a separate motor driver board takes that low-power signal and switches the higher current needed to actually turn two DC motors. The ESP32 alone cannot drive a motor — its GPIO pins output a few milliamps at 3.3V, while a small gear motor needs hundreds of milliamps at 3–6V — so the motor driver sits in between as a current amplifier, and the chassis, wheels, and battery supply the rest of the physical build.
What parts does a wireless robot car need?
Six roles have to be filled, regardless of which specific parts you buy:
- Microcontroller with wireless built in — an ESP32 has Wi-Fi and Bluetooth on the same chip, so it doesn't need a separate wireless module to talk to a phone.
- Motor driver — converts the ESP32's logic-level GPIO/PWM signals into the higher-voltage, higher-current output the motors need; an L298N dual H-bridge module is the common low-cost choice.
- Drive motors (x2) — small DC gear motors, one per side, so the car can turn by spinning each side at a different speed or direction.
- Chassis — the frame that holds the motors, wheels, battery, and boards together.
- Power supply — a battery plus a shield or holder; note that the motors and the ESP32 often need different voltages, so the battery has to be sized for both.
- Wiring — jumper wires to connect the ESP32's GPIO pins to the motor driver's input pins, and the driver to the motors and battery.
How does a motor driver let a microcontroller control motors?
A motor driver such as the L298N is built around an H-bridge circuit: four internal switches arranged so that reversing which pair is closed reverses the current direction through the motor, which reverses its spin direction. The ESP32 doesn't touch that current directly — it only sets two GPIO pins per motor (one motor's direction pins, for example) to HIGH or LOW, and the H-bridge does the actual switching using its own separate power input (commonly 6–46V for the motor side on an L298N, distinct from its 5V logic supply). Speed control layers on top of direction control using PWM: instead of holding a driver input pin fully on, the microcontroller pulses it rapidly, and the ratio of on-time to off-time (the duty cycle) sets the average voltage the motor sees, which sets its speed. This is why a build with two motors typically uses four direction pins plus one or two PWM-capable pins from the ESP32, all going to the driver rather than to the motors directly.
Bluetooth or WiFi — which is better for controlling a robot car?
An ESP32 supports both from the same board, and the right choice depends on what you're optimizing for. Bluetooth (specifically Bluetooth Serial / SPP) pairs the ESP32 directly with a phone as if it were a wireless serial cable: no local network, router, or app beyond a generic Bluetooth terminal is required, and the code to send single-character commands like F, B, L, R, S is short. Its tradeoff is range, typically tens of meters at most, and a phone can only be paired with one Bluetooth device's serial link at a time. Wi-Fi control instead runs a small web server on the ESP32 (or joins your home network), which lets you drive the car from a browser page with on-screen buttons or sliders, works over longer range on a local network, and can be extended to add live video or multiple simultaneous viewers later — at the cost of more setup (the ESP32 needs Wi-Fi credentials or has to run its own access point) and a slightly heavier firmware. For a first build, Bluetooth Serial is the faster path to "it moves when I tap a button"; Wi-Fi is worth the extra setup once you want a real interface or plan to add a camera feed.
What can you upgrade later (sensors, camera, etc.)?
Because the ESP32 has GPIO pins to spare once two motors and a driver are wired up, a bare drive-by-phone car is usually a starting point rather than the finished project. Common next additions include an ultrasonic distance sensor (like an HC-SR04) for basic obstacle detection or auto-stop, IR reflectance sensors on the underside for line-following, and an ESP32-CAM module (a second ESP32 board with a built-in camera) for a live first-person video feed streamed to the same phone that's driving it. Each of these adds its own wiring and firmware logic on top of the motor-control code rather than replacing it, which is why getting the basic forward/backward/left/right control working cleanly first — before adding sensors — makes troubleshooting each addition easier.
Watch it built live
Rather than describe a generic parts list, we typed one real sentence into Compoden's AI build assistant on the storefront and let it pick parts, price them, and explain its reasoning — unscripted, screenshotted as it happened:
"I want to build a robot car I can control from my phone using an ESP32"

It matched six in-stock parts on the first try (no follow-up question was needed) and explained the reasoning behind each one. On the microcontroller and motor driver specifically, it wrote:
"The ESP32-WROOM-32 is the main controller, like the decision-maker for your robot car... it has built-in Wi-Fi and Bluetooth for wireless communication... This ESP32 is a good choice because its built-in Wi-Fi allows it to connect to your phone for control, and it has enough pins to manage the motors."
"The L298N Motor Driver Module is needed because the motors cannot be connected directly to the ESP32. This module acts as an intermediary, taking signals from the ESP32 and converting them into the higher power needed to run the motors."
It also ran its own power-budget check on the tray and flagged a real sizing gap worth knowing about before you buy: "power: build peaks ~5.0A but the selected supply provides ~1.0A — size up the power supply (headroom recommended)." That's the two N20 motors and the L298N's motor-side draw combined, versus the 18650 Battery Shield's 1A output rating — the shield is fine for powering the ESP32's logic, but a build that actually drives both motors under load at once will want a higher-current battery source than a single 18650 cell feeding that shield.
Watch the firmware get generated
We then asked Compoden's build companion, Soldr, to write the actual driving firmware: forward, backward, left, and right, controlled wirelessly.

Soldr matched the same six parts against its own catalog (6/6), then generated firmware built on the BluetoothSerial library and the ESP32's LEDC peripheral for PWM speed control, defaulting to a 20kHz PWM frequency. It described the result this way: "Here's the firmware for your ESP32 robot car, allowing wireless control via Bluetooth Serial... The robot will respond to single-character commands: 'F' for forward, 'B' for backward, 'L' for left, 'R' for right, and 'S' for stop." The code appeared in the Firmware tab essentially all at once once generation finished — there was no visible character-by-character streaming to watch. Soldr also flagged an honest limitation rather than guessing past it: "this code has not been checked against a board. Your build has parts in it, but no board I can compile for — so I could not verify the pins. If you are using a board you already own, tell me exactly which one and I will re-generate it properly wired for that board." Treat the generated pin assignments as a documented starting point to check against your specific ESP32 board's pinout, not as pre-verified.
Who this build is for
This is a reasonable first wireless-robotics project if you've already wired at least one sensor or LED to a microcontroller before, since the new skills here are motor-driver wiring and basic wireless command handling rather than programming fundamentals. Soldr's own build profile for this exact tray rated it "Difficulty: Easy (one part cannot be driven directly from a pin)" and suitable for "roughly 11+" with adult help on the wiring and the power-budget point above. Budget an evening for chassis assembly and wiring, and a second short session for flashing and testing forward/backward/left/right before you consider it done.
Get everything in this build
The exact parts Soldr picked above, at today's live price and stock — each links straight to checkout, or add the whole tray in one click.
| Part | Qty | Price | |
|---|---|---|---|
| ESP32-WROOM-32 | 1 | ₹280 | Add to cart → |
| L298N Motor Driver Module | 1 | ₹180 | Add to cart → |
| N20 Micro Metal Gear DC Motor 50RPM 3V | 2 | ₹182 | Add to cart → |
| 2WD Robot Chassis Kit | 1 | ₹280 | Add to cart → |
| 18650 Battery Shield Module | 1 | ₹280 | Add to cart → |
| Male-to-Male Breadboard Jumper Wires (20 cm, 24 AWG) | 1 | ₹40 | Add to cart → |
| Total | ₹1,242 | Add all to cart → |
Prices and stock verified live at the time this was written; Compoden's storefront always reflects the current price at checkout. As flagged above, size your battery source to the build's real peak current (roughly 5A across both motors and the driver) rather than the 1A the 18650 shield alone provides, before you rely on it to drive both motors at once.
Built and Backed by Compoden
Every part above ships from Compoden's own India stock, checked for compatibility before it's carded together. Delivery in 3–7 days across India, with COD and UPI available at checkout. This exact tray also carries over into Soldr.dev after purchase, already populated with these parts, where it generates the wiring diagram, firmware, and test steps for this specific hardware combination rather than a generic robot-car guide. If a part doesn't perform as described, Compoden's support team will help you troubleshoot or replace it.
FAQ
Can an ESP32 drive motors directly from its pins?
No. An ESP32's GPIO pins output around 3.3V at a few milliamps, far below what even a small DC gear motor needs to turn. A motor driver module such as an L298N sits between the ESP32 and the motors, taking the ESP32's low-power direction and PWM signals and switching the higher voltage and current the motors actually draw.
Should I control my robot car over Bluetooth or Wi-Fi?
Bluetooth Serial is the simpler starting point — it pairs the ESP32 directly with a phone like a wireless serial cable, with no app or network setup, but has shorter range. Wi-Fi requires running a small web server on the ESP32 but gives you a real browser-based control page, longer range on a local network, and room to add a live camera feed later.
How much does this exact build cost?
In a real live quote from Compoden's storefront, the six parts — ESP32-WROOM-32, L298N motor driver, two N20 gear motors, a 2WD chassis kit, an 18650 battery shield, and jumper wires — came to ₹1,242 total.
Why does the build need a bigger battery than the 18650 shield provides?
The build assistant's own power check on this tray found the two drive motors and the L298N driver can peak at roughly 5A combined, while the 18650 Battery Shield Module is rated for about 1A output. The shield is fine for the ESP32's own logic power, but a battery source sized for the motors' real peak draw is needed to drive both motors reliably under load.