How to Build a Remote-Controlled Car with a Smartphone App

Building Remote-Controlled Cars / Visits:8

Building a remote-controlled car from scratch is one of the most satisfying DIY electronics projects you can tackle. But what if you could control it with nothing more than your smartphone? Better yet, what if you could leverage the precision, torque, and versatility of a micro servo motor to do the heavy lifting—steering, throttle control, or even active suspension? In this guide, I’ll walk you through every step of constructing a smartphone-controlled RC car, with a heavy focus on how micro servo motors can transform a basic chassis into a responsive, agile machine.

Why Micro Servo Motors Are the Star of This Build

Before diving into the wiring and code, let’s talk about why micro servo motors deserve center stage. Unlike standard DC motors that just spin continuously, a micro servo motor gives you precise angular positioning—typically 0 to 180 degrees. This makes it perfect for steering mechanisms. But that’s just the beginning. Modern micro servos (like the SG90 or MG90S) are cheap, lightweight, and surprisingly strong for their size. They can handle continuous rotation with modification, or you can use them for:

  • Steering linkage – Directly control the front wheels’ angle.
  • Throttle control – If you’re using a brushed ESC, a servo can physically push a potentiometer.
  • Camera gimbal – Mount a phone or camera and pan/tilt using two servos.
  • Active suspension – Adjust ride height on the fly (advanced, but possible).

The key advantage? Positional feedback. With a standard motor, you don’t know where the wheels are pointed unless you add an encoder. With a servo, you command 90 degrees, and it goes there—and stays there until told otherwise. That’s reliability.

What You’ll Need: The Full Parts List

Here’s a realistic bill of materials. I’ll mark items that are optional or upgradable.

The Chassis and Drivetrain

  • RC car chassis – 4WD or 2WD, any size. A cheap 1:10 scale buggy works great.
  • DC drive motor(s) – Brushed 540 or 550 motor (or brushless if you’re fancy).
  • Electronic Speed Controller (ESC) – Brushed ESC (e.g., HW1060) for simplicity.
  • Battery – 2S LiPo (7.4V) or 3S LiPo (11.1V) – choose based on ESC specs.
  • Battery connector – XT60 or Deans.

The Micro Servo Motor (The Star)

  • Micro servo motorSG90 (plastic gears, cheap) or MG90S (metal gears, recommended for steering). Buy at least two if you want a pan/tilt camera.
  • Servo horns and screws – Usually included.

The Brains (Microcontroller & Connectivity)

  • ESP32 development board – This is non-negotiable for smartphone control. It has built-in Wi-Fi and Bluetooth. (Arduino Uno won’t cut it without extra modules.)
  • Breadboard and jumper wires – For prototyping.
  • Voltage regulator – 5V output (e.g., LM2596 or AMS1117) to power the ESP32 and servo from the main battery.

Smartphone App & Communication

  • Smartphone – Android or iOS.
  • App – We’ll use a custom app built with MIT App Inventor (free, no coding skills required) or a pre-built one like Blynk or Serial Bluetooth Terminal.

Tools & Miscellaneous

  • Soldering iron, solder, flux, wire strippers, heat shrink tubing.
  • Zip ties, double-sided tape, hot glue gun.
  • Multimeter (for debugging).
  • Optional: 3D printer for custom servo mounts (or just use brackets).

Step 1: Designing the Steering Mechanism with a Micro Servo

This is where the micro servo motor really shines. A typical RC car uses a servo for steering, but most off-the-shelf servos are larger “standard” size. We’re using a micro servo because it’s lighter and fits in tighter spaces.

The Mechanical Setup

  1. Mount the servo – Secure it to the chassis using screws or double-sided tape. If your chassis doesn’t have a servo mount, 3D-print a bracket or use a metal L-bracket.
  2. Attach the servo horn – Choose a long horn (often included) to maximize steering angle.
  3. Link to the steering knuckles – Use a ball link or a stiff wire (like a paperclip or pushrod) to connect the servo horn to the steering arm. The goal is linear motion: when the servo rotates, the wheels turn left or right.
  4. Center the servo – Manually rotate the horn to the middle position (90 degrees) before attaching the linkage. Then adjust the linkage length so the wheels point straight.

Pro tip: If you’re using continuous rotation servos (modified for 360° rotation), you can even use them as drive motors. But for steering, stick with standard 180° servos.

Step 2: Wiring the Electronics – Power and Signal

Now we need to connect everything. The wiring diagram is simple but critical.

Power Distribution

  • Battery → ESC – The ESC draws power from the main battery and drives the DC motor.
  • Battery → 5V regulator – The regulator steps down the battery voltage (7.4V–11.1V) to a stable 5V for the ESP32 and servo.
  • 5V regulator → ESP32 Vin pin – This powers the microcontroller.
  • 5V regulator → Micro servo red wire – Servos draw a lot of current (up to 1A under load), so don’t power them from the ESP32’s 5V pin. Use the regulator directly.

Signal Connections

  • ESP32 GPIO pin (e.g., GPIO 13) → Micro servo signal wire (usually orange or white) – This is a PWM (Pulse Width Modulation) signal. The ESP32 can generate this easily.
  • ESC signal wire → ESP32 GPIO pin (e.g., GPIO 12) – The ESC uses a similar PWM signal to control motor speed.
  • Ground (GND) – Connect all grounds together: battery negative, ESC ground, regulator ground, servo ground (black/brown), and ESP32 GND.

Warning: Double-check polarity. Reversing the battery wires can destroy the ESC or regulator instantly.

Step 3: Programming the ESP32 for Wi-Fi Control

The ESP32 will act as a Wi-Fi access point (or connect to your home network) and listen for commands from your phone. We’ll use the Arduino IDE to write the code.

Code Structure

  1. Wi-Fi setup – Create a simple TCP server on port 80.
  2. Servo library – Use ESP32Servo.h (not the standard Servo.h, which has timing issues on ESP32).
  3. ESC calibration – Most ESCs need to see a specific PWM pulse range (usually 1000–2000 microseconds) to arm and control speed.
  4. Command parsing – Receive characters like ‘L’, ‘R’, ‘F’, ‘B’, ‘S’ for left, right, forward, backward, stop.

Here’s a stripped-down code snippet to get you started:

cpp

include <WiFi.h>

include <ESP32Servo.h>

const char* ssid = "RC-Car"; const char* password = "12345678";

Servo steeringServo; const int servoPin = 13; const int escPin = 12;

WiFiServer server(80);

void setup() { Serial.begin(115200); steeringServo.attach(servoPin, 500, 2500); // Custom pulse range steeringServo.write(90); // Center

// ESC setup (adjust pulse range for your ESC) ledcSetup(0, 50, 16); // Channel 0, 50Hz, 16-bit ledcAttachPin(escPin, 0); ledcWrite(0, 3072); // Neutral (1500us)

WiFi.softAP(ssid, password); server.begin(); }

void loop() { WiFiClient client = server.available(); if (client) { while (client.connected()) { if (client.available()) { char c = client.read(); if (c == 'L') steeringServo.write(45); // Turn left else if (c == 'R') steeringServo.write(135); // Turn right else if (c == 'C') steeringServo.write(90); // Center else if (c == 'F') ledcWrite(0, 4096); // Full forward else if (c == 'B') ledcWrite(0, 2048); // Full backward else if (c == 'S') ledcWrite(0, 3072); // Stop } } client.stop(); } }

Note: The ESC pulse values (2048, 3072, 4096) are for a 16-bit PWM range at 50Hz. Adjust these based on your ESC’s calibration.

Step 4: Building the Smartphone App (MIT App Inventor)

You don’t need to be a software developer. MIT App Inventor is a drag-and-drop tool that generates Android APKs.

App Design

  1. Buttons – Add buttons for Forward, Backward, Left, Right, Stop. Arrange them in a D-pad layout.
  2. Wi-Fi connection – Add a text box for the IP address (usually 192.168.4.1) and a Connect button.
  3. Logic – When a button is pressed, send a single character over TCP. For example, pressing “Left” sends ‘L’, releasing it sends ‘C’ (center).

Key Blocks (in App Inventor)

  • Use the Web component to connect to the ESP32’s IP and port 80.
  • Use the Clock component to send commands repeatedly while a button is held down (for smooth steering and throttle).

For iOS users: You can use the Blynk app instead, which has a built-in widget for sending integer values to a virtual pin. The ESP32 code then reads those values.

Step 5: Testing and Calibrating the Micro Servo

This is the most fiddly part. A misaligned servo can cause the car to drift or bind.

Calibration Steps

  1. Power up the ESP32 and servo. The servo should snap to 90 degrees (center).
  2. Send a command from the app to turn left (45 degrees). Watch the wheels. If they turn too far or not enough, adjust the write() values in the code.
  3. Physical adjustment – If the wheels don’t point straight when centered, loosen the servo horn screw, rotate the horn slightly, and retighten.

Common Issues with Micro Servos

  • Jittering – Usually caused by insufficient power. Add a capacitor (470µF) between 5V and GND near the servo.
  • Stalling – The servo can’t move the linkage. Check for binding or upgrade to a metal-gear servo (MG90S).
  • Overheating – If the servo gets hot, reduce the PWM frequency or add a heatsink.

Step 6: Advanced Mods – Dual Micro Servos for Pan/Tilt Camera

Once you have the basic car working, why not add a camera that follows your phone’s orientation? This is where two micro servos create a pan-tilt mechanism.

Hardware Setup

  • Pan servo – Mounted horizontally, rotates left/right.
  • Tilt servo – Mounted vertically, rotates up/down.
  • Phone holder – 3D-print a bracket that holds your smartphone (or a small camera).

Wiring

  • Connect both servos to the 5V regulator (ensure enough current – 2A minimum).
  • Use two separate GPIO pins for signal (e.g., GPIO 14 and 27).

Code Modification

  • Read two values from the app: panAngle and tiltAngle.
  • Map phone accelerometer data (sent via Wi-Fi) to servo angles (0–180).

cpp int panValue = map(phonePan, -90, 90, 0, 180); int tiltValue = map(phoneTilt, -90, 90, 0, 180); panServo.write(panValue); tiltServo.write(tiltValue);

This turns your RC car into a mobile surveillance robot. The micro servo motors handle the precision work while the ESP32 handles the communication.

Step 7: Troubleshooting the Micro Servo and Wi-Fi Link

Even with careful assembly, things can go wrong. Here’s a quick troubleshooting table.

| Problem | Likely Cause | Solution | |---------|--------------|----------| | Servo doesn’t move | No power or wrong PWM pin | Check 5V regulator output; verify GPIO pin in code | | Servo moves erratically | Electrical noise from DC motor | Add a ferrite bead on servo wire; use shielded cable | | Wi-Fi disconnects | ESP32 brownout (voltage drop) | Use a larger capacitor (1000µF) on the 5V rail | | App can’t connect | Wrong IP address or port | Make sure ESP32 is in AP mode; check serial monitor for IP | | Car only goes forward | ESC not calibrated | Follow ESC calibration procedure: full throttle → neutral → full brake |

Step 8: Performance Tuning – Getting the Most from Your Micro Servo

A micro servo motor isn’t just a “set it and forget it” component. You can optimize it for your specific RC car.

Speed vs. Torque

  • SG90 – 0.12 sec/60° at 4.8V (fast but weak). Good for lightweight cars.
  • MG90S – 0.10 sec/60° at 6V (faster and stronger). Better for off-road steering.
  • DS3218 – 0.08 sec/60° (high-speed micro servo). Overkill but fun.

PWM Frequency

Standard servos expect 50Hz (20ms period). But some digital servos can handle up to 400Hz. Check your servo’s datasheet. Running a servo at a higher frequency can reduce jitter but may cause overheating.

Mechanical Advantage

If your steering linkage is too stiff, the servo will struggle. Use a longer servo horn to increase leverage (but reduce angular resolution). Alternatively, use a push-pull linkage with ball bearings.

Step 9: Expanding the Project – Autonomous Mode with Sensor Feedback

Why stop at remote control? Add an ultrasonic sensor (HC-SR04) and let the ESP32 avoid obstacles automatically. The micro servo can even pan the sensor left and right to scan the environment.

How It Works

  1. Mount the ultrasonic sensor on a micro servo (panning).
  2. Program the ESP32 to sweep the servo from 0° to 180° while taking distance readings.
  3. If an obstacle is detected within 30cm, the car stops and turns away.
  4. Override the smartphone app’s commands when autonomous mode is active.

This turns your simple RC car into a semi-autonomous robot. The micro servo motor becomes the “neck” of the robot, giving it spatial awareness.

Step 10: Final Assembly and Field Testing

You’ve built the car, coded the ESP32, and designed the app. Now it’s time to put it all together.

Assembly Checklist

  • [ ] All wires secured with zip ties or hot glue.
  • [ ] Battery firmly mounted to avoid shifting during turns.
  • [ ] Servo horn screw tightened with threadlocker (vibrations loosen screws).
  • [ ] ESP32 enclosed in a small project box to protect from dust.
  • [ ] Power switch installed between battery and regulator (for safety).

Field Test Protocol

  1. Range test – Walk 10 meters away from the car. Does the app still respond? If not, the Wi-Fi range is limited. Consider using a directional antenna on the ESP32.
  2. Steering test – Drive in a straight line. Does the car drift? Adjust the servo center trim in the code.
  3. Speed test – Run the car at full throttle. Does the servo hold the steering angle? If the wheels wobble, the servo is too weak for the speed.
  4. Battery life – A 2S 2200mAh LiPo should give you about 20 minutes of runtime with a micro servo. Less if you’re using continuous rotation.

Why Micro Servo Motors Are the Future of DIY Robotics

The humble micro servo motor has evolved from a niche component in radio-controlled airplanes to a cornerstone of modern robotics. In this project, you’ve seen how it provides:

  • Precision – Without it, steering would be an on/off affair (full left or full right). With it, you get smooth, proportional control.
  • Adaptability – The same servo can steer, pan a camera, or even actuate a gripper.
  • Affordability – A pack of five SG90s costs less than a single standard servo. This makes experimentation cheap and accessible.

As you continue building, consider upgrading to continuous rotation servos (like the FS90R) for the drive system. You can then control speed and direction without an ESC. Or use a servo motor with feedback (like the Dynamixel series) for closed-loop position control. The possibilities are endless.

Your smartphone-controlled RC car is now more than a toy—it’s a platform for learning embedded systems, wireless communication, and mechanical design. And at the heart of it all, that tiny micro servo motor is doing the heavy lifting, one degree at a time.

Copyright Statement:

Author: Micro Servo Motor

Link: https://microservomotor.com/building-remote-controlled-cars/rc-car-smartphone-app-control.htm

Source: Micro Servo Motor

The copyright of this article belongs to the author. Reproduction is not allowed without permission.

About Us

Lucas Bennett avatar
Lucas Bennett
Welcome to my blog!

Tags