Turning an RF toy car into a WiFi car with an ESP32

A borrowed toy car, a lost remote, and a browser tab for a steering wheel.

Sections (6)

This car belongs to my best friend’s baby, who is twelve months old. The remote was lost, which in a house with a one-year-old is less of an accident and more of a law of nature.

So I offered to fix it. By which I mean I offered to replace its brain completely and control it from a phone over WiFi.

What’s inside a toy car

Less than you’d think. Two motors, a battery, and a small receiver board. The front motor steers, the rear motor drives. The receiver board listens for the RF (radio frequency) signal from the remote and turns it into “go forward” or “turn left.”

No remote meant the receiver was useless anyway. Out it came. The replacement: something I could control from any phone browser. No app, no custom remote. Just a web page.

The parts

An ESP32. A tiny, cheap board with WiFi built in. It’s the new brain, and it also hosts the web page you drive with.

A motor driver. This is the bit people skip and then wonder why nothing moves. The ESP32’s pins can say “motor on,” but they can’t supply the power a motor actually needs. Asking them to is like asking a light switch to also be the power station. A motor driver sits in between, takes the signal from the ESP32 and the power from the battery, and does the heavy lifting.

I used a DRV8833 on a little board labelled HW-668, for about ₹100. It runs two motors in both directions, which is exactly what a car needs.

Power. The battery is wired to a TP4056 module so it can charge over USB (Universal Serial Bus).

Wiring

The original wires were colour-coded, which is more organisation than most of my projects get. Front motor on white and green, rear motor on blue and yellow.

On the ESP32 side, steering goes on GPIO (General Purpose Input/Output) pins 16 and 17, drive goes on 18 and 19, both through the DRV8833. Two pins per motor, because each motor needs to go both ways.

The software

The ESP32 runs a small web server. Connect your phone to it, open the page, and you get touch controls. On a laptop, WASD works, because every control scheme eventually becomes a video game. An LED (Light Emitting Diode) shows the WiFi status, so I can tell “not connected” apart from “connected, but I wired something backwards.”

Did it drive?

Not the first time.

The motors were fine. The WiFi wasn’t. When the ESP32’s WiFi radio switches on, it pulls short bursts of power, and it needs a steady 5 volts to keep up. The battery on its own couldn’t hold that steady, so the WiFi simply wouldn’t work.

The fix was a buck-boost converter, a small board that holds the voltage steady at 5 volts whether the battery is full or nearly flat. The funny part is that I’d already looked at one earlier and decided I didn’t need it. I needed it.

With steady power, the WiFi came up and the car drove. The owner has not reviewed it yet. Busy schedule, mostly naps.

What’s next

A camera on top. The goal is driving it from a browser with a view from the car itself, so it feels a bit like Rocket League. Minus the rocket. For now.