How to Make a WiFi Controlled RC Car Using ESP8266

{getToc} $title={Table of Contents}

Want to make a small RC car that you can control from your phone without using a separate Bluetooth module? This is a pretty simple project to try. The main controller is an ESP8266 NodeMCU, so the car uses WiFi for communication instead of adding an HC-05 or HC-06 Bluetooth module.

I came across this project from UtGo Tech and found the idea interesting because the ESP8266 handles the wireless connection itself. The motors are controlled through an L298N motor driver, while the car can be operated from a smartphone.

The original project uses four BO motors, four wheels, an L298N motor driver and two 18650 batteries. The chassis can also be made from cardboard, which keeps the project inexpensive and easy to build.

Project inspiration: UtGo Tech – WiFi RC Car Using ESP8266

If you are new to ESP8266, you can first check our ESP8266 beginner guide before starting this project.

Youtube Video

How Does the WiFi RC Car Work?

The idea behind the car is actually quite straightforward. The ESP8266 creates a WiFi network, and the phone connects to that network. When you press a button in the controller app, the ESP8266 receives the command and controls the motors through the L298N.

The basic flow looks like this:

Phone

WiFi

ESP8266 NodeMCU

L298N Motor Driver

Four DC Motors

One nice thing about this setup is that you don't need a separate Bluetooth module. The ESP8266 already has WiFi capability, and the Arduino ESP8266 core provides WiFi and networking support for ESP8266 boards.

You can read more about installing ESP8266 support in Arduino IDE in the official ESP8266 Arduino Core documentation .

Components Required

Here is the list of components needed for this build.

Component Quantity
ESP8266 NodeMCU 1
L298N Motor Driver 1
BO Geared DC Motors 4
65mm Wheels 4
18650 Li-ion Batteries 2
2-cell Battery Holder 1
On/Off Switch 1
Jumper Wires As required
Cardboard For chassis

Tools You Will Need

  • Soldering iron
  • Solder wire
  • Hot glue gun
  • Screwdriver
  • Wire cutter
  • USB cable
  • Computer for programming the ESP8266
  • Android smartphone for controlling the car

Making the RC Car Chassis

You don't have to start with a fancy robot chassis for this project. A strong piece of cardboard can work well for a basic prototype.

Cut the cardboard to the size you want for the car. If the cardboard feels too weak, use two layers and glue them together. This gives the chassis a little more strength and makes it easier to mount the motors and electronics.

Mark the positions for all four motors before applying glue. Take a little time here because the position of the motors affects how straight the car will move.

Once the positions look right, fix the four motors to the chassis using hot glue or another suitable mounting method.

Preparing the Motors

The four BO motors need wires connected to their terminals.

Cut four suitable pairs of wires and solder them to the motor terminals. Keep the wires long enough to reach the motor driver without putting unnecessary tension on them.

At this stage, don't worry too much if a motor spins in the wrong direction. Motor polarity can be changed later by swapping the two wires or changing the direction logic in the program.

Battery Setup

This project uses two 18650 batteries in a two-cell holder. The battery pack supplies power to the motor driver and motors.

Make sure the battery holder is wired correctly and always check the polarity before connecting it to the circuit.

Important: use suitable protected/reputable cells and a proper charger. Do not short-circuit, physically damage or improperly charge lithium-ion batteries.

L298N Motor Driver

The ESP8266 GPIO pins are not designed to power the motors directly. The L298N is used between the ESP8266 and the motors.

The ESP8266 sends direction signals to the L298N. The motor driver then switches the motor connections so the motors can rotate in the required direction.

For a four-wheel car, the motors on each side are normally grouped together. This allows the car to move by changing the direction of the left and right sides.

ESP8266 to L298N Connections

The original project uses four ESP8266 control pins for the motor driver. The connections shown for the project are:

ESP8266 NodeMCU L298N
D5 IN1
D6 IN2
D7 IN3
D8 IN4
These pins are used by the ESP8266 to control the two motor channels of the L298N.

Before publishing your final circuit diagram, compare it with your actual hardware and code. Motor-driver wiring can vary between builds.

Circuit Diagram

The complete connection can be thought of like this:

2 × 18650 Battery

L298N Motor Driver

Left Motors + Right Motors

ESP8266 NodeMCU

D5, D6, D7, D8

L298N IN1, IN2, IN3, IN4


Setting Up Arduino IDE for ESP8266

Before uploading the program, the Arduino IDE needs to know about the ESP8266 boards.

If you haven't installed ESP8266 support before, open Arduino IDE and go to:

File → Preferences

Find Additional Boards Manager URLs and add the ESP8266 package URL:

https://arduino.esp8266.com/stable/package_esp8266com_index.json

Then open:

Tools → Board → Boards Manager

Search for ESP8266 and install the ESP8266 platform.

After installation, select the NodeMCU board from the ESP8266 boards list.

The official ESP8266 Arduino Core documentation recommends installing the ESP8266 platform through Boards Manager.

ESP8266 Arduino Core installation guide

Upload the RC Car Program

Before mounting the wheels, I recommend uploading the program first. It is easier to connect the USB cable while the NodeMCU is still easy to reach.

  1. Turn the battery switch OFF.
  2. Connect the NodeMCU to your computer using a USB cable.
  3. Open Arduino IDE.
  4. Select the ESP8266 NodeMCU board.
  5. Select the correct COM port.
  6. Open the RC car program.
  7. Click the Upload button.
  8. Wait until the upload finishes successfully.
  9. Disconnect the USB cable.

Arduino IDE supports third-party board packages through Boards Manager, and the ESP8266 project provides the required board package for NodeMCU and other ESP8266 boards.

ESP8266 WiFi RC Car Code

The program is the part that connects everything together. The ESP8266 creates the WiFi network, receives commands from the phone and then changes the motor direction through the L298N.

For this section, add the code that you have tested with your own circuit.

If you are using code from another creator, don't remove the original author's credit. If you have rewritten or modified the program, clearly mention what you changed.

You may also want to read our Arduino programming tutorials if you are new to uploading sketches.

Mounting the Wheels

Once the program has uploaded successfully, disconnect the USB cable and finish the mechanical assembly.

Mount the four wheels on the motor shafts and check that none of them touches the cardboard chassis.

Before putting the car on the floor, lift it slightly and test the motors first. This makes it much easier to find a wrong motor connection without the car suddenly moving away.

Connect Your Phone to the RC Car

Now we get to the fun part.

Turn on the battery switch. The ESP8266 should start its WiFi network.

  1. Open WiFi settings on your smartphone.
  2. Look for the WiFi network created by the ESP8266.
  3. Connect your phone to the RC car's WiFi network.
  4. Open the compatible RC car controller app.
  5. Use the direction buttons to control the car.

The important thing to remember is that the phone is communicating with the ESP8266 over WiFi. There is no separate Bluetooth module involved in this setup.

Test the Car

Start with the car lifted off the ground and check each direction.

Command Expected Result
Forward Car moves forward
Reverse Car moves backward
Left Car turns left
Right Car turns right
Stop Motors stop

Common Problems and Fixes

ESP8266 is not detected

Try another USB cable first. Some USB cables are designed only for charging and don't carry data. Also check whether the correct USB driver and COM port are available on your computer.

WiFi network is not showing

Check the ESP8266 power supply and make sure the correct program has been uploaded. Open the Serial Monitor if your program prints startup information there.

The car moves backward when I press forward

This usually means the motor polarity or direction logic needs to be changed. Swap the two wires of the affected motor pair or adjust the direction in the program.

Only two motors are working

Check the motor-driver terminals and make sure both motors on each side are connected properly. Also inspect the solder joints.

ESP8266 keeps restarting when the motors start

Motors can introduce electrical noise and voltage drops. Check the battery condition, wiring and power arrangement. Make sure the ESP8266 is receiving a suitable supply and don't assume every reset is a software problem.

Final Result


And that's it. You now have a small RC car that can be controlled from a smartphone over WiFi.

What makes this project interesting is that the ESP8266 is doing more than just controlling the motors. It is also handling the wireless communication, so there is no need to add a separate Bluetooth module.

The cardboard chassis also makes this a good starting point if you're just getting into robotics. Once the basic car is working, you can start adding your own ideas.

Ideas to Improve the RC Car

Once the basic version is working, there are quite a few things you can experiment with:

  • Add LED headlights.
  • Add an ultrasonic sensor.
  • Build an obstacle avoidance mode.
  • Add speed control.
  • Add a buzzer or horn.
  • Add a camera module.
  • Replace the cardboard chassis with an acrylic or 3D-printed frame.
  • Create your own web-based controller instead of using a mobile app.

If you are interested in taking the project further, check out our robotics projects and other ESP8266 projects .

Source and Credit

This article was inspired by the WiFi RC car project demonstrated by UtGo Tech. The original video shows the project assembly, ESP8266 setup and smartphone control.

You can watch the original project here:

HOW TO MAKE WIFI RC CAR VERY EASILY | BASED ON ESP8266 NODEMCU | UT GO

You can also visit the original written project from UtGo Tech: Build Your Own Wi-Fi RC Car Using ESP8266 .

The project idea and original demonstration belong to the respective creator. If you use their original code, circuit diagram, photographs or other material, keep the appropriate attribution and follow the terms under which that material was provided.

Related Articles

Frequently Asked Questions

Can I make this RC car without Bluetooth?

Yes. The ESP8266 has built-in WiFi, so the car can communicate with a smartphone over WiFi without adding an HC-05 or HC-06 Bluetooth module.

Can I use a different motor driver?

Yes, but the wiring and program will need to be changed to match the motor driver you choose.

Can I use cardboard for the chassis?

Yes. Cardboard is fine for a simple prototype as long as it is strong enough to hold the motors, batteries and electronics.

Can I control the car without internet?

Yes. In this type of setup, the phone can connect directly to the WiFi network created by the ESP8266. An internet connection is not required for the basic local control.

Can I control the car from a web browser?

Yes. That is actually a good next step. Instead of using a dedicated Android app, you can program the ESP8266 to host a small web page with forward, reverse, left, right and stop buttons.

Conclusion

This is one of those projects where you can start with a few inexpensive parts and end up with something that actually moves around your room.

The ESP8266 takes care of the WiFi connection, the L298N handles the motors, and the phone becomes the remote control.

If you're building your first WiFi robot, this is a good project to start with. Once you get the basic car moving, you can keep adding features and turn it into something much more interesting.

If you build your own version, let us know what you changed. Adding your own features is where the project really becomes yours.

Uday kiran

Hey Guys, My name is Uday Kiran. I'm from India. now I'm 18 years old, studying at college. Making DIY projects is my hobby, passion and I love making awesome projects from scratch. I am the creator of the Electromechanics community. facebook twitter youtube instagram external-link

Previous Post Next Post

نموذج الاتصال