Shopping Cart

⚡️ We’re Helping 1 Million People Build Their First Robots

🇺🇸 Proudly Women-Owned Small Business
Arduino Bluetooth Car Tutorial

Arduino Bluetooth Car (Smartphone Controlled)

We sometimes use affiliate links in our content. This won't cost you anything, but it helps us to offset the costs of paying our writing team. You can support us directly on BuyMeACoffee. Thank you!

In the previous tutorial, I showed you how to use a BLE module to control an LED. For this tutorial, we will expand upon that knowledge to create an Arduino Bluetooth Car that can be controlled using a Smartphone.

You can pick up an Arduino Robot kit or source all the materials separately to build a custom robot car. At a minimum, you’ll need an Arduino Uno, a motor controller (such as the L293D or L298N), a BLE module (AT-09 or HM-10), Geared DC Motors, 1KΩ and 2KΩ resistors, and batteries to power everything. I recommend using 18650 rechargeable batteries. You can choose to make the chassis from scratch using foam board, acrylic, 3D printing, or you can buy one online.

Related Article: How to power your mobile robot

This tutorial assumes you already have some basic Arduino programming skills and have downloaded and installed the Arduino IDE. You’ll also need to download and install the BLE Joystick App for Android or for iPhone. Once you have all the materials and software for this project, it’s time to assemble the robot chassis.

Make a Chassis for Arduino Bluetooth Car

Here I made chassis using a 5mm thick foam board. You can use any other material of your choice. Just make sure it is light and strong. First, mount two motors on the base board as shown in the image below.

Build Arduino Robot car

Next, attach the Arduino on another board and connect the motor shield. I’m using the L293D shield, below.

Arduino Bluetooth Robot

After that, place the second board on top of the base.

Build an Arduino Bluetooth Car

Once the robot is built, it’s time to wire up the electronics. Remove the motor shield to expose the Arduino pins.

Arduino Bluetooth Car Wiring

Before you connect the components, make sure you carefully read the pin labels on the BLE module because not all modules have same pin configuration. Refer to the wiring diagram, below.

Wiring Diagram for Arduino Bluetooth Car

TX goes to RX on the Arduino (Digital Pin 0)
RX goes to TX on the Arduino (Digital Pin 1)
GND goes to GND
VCC goes to +5V

You will need to create a voltage divider using two resistors. Solder them together and connect the 2KΩ end to the Arduino GND pin and the 1KΩ end to the TX pin on the Arduino.

The point where the two resistors are connected goes to the Rx pin of Bluetooth module. Here’s what it looks like on the Arduino Bluetooth Car.

Arduino Bluetooth Car Wiring Complete

After that, reconnect the motor shield to the top of the Arduino. If you want, you can solder the wires directly to the shield for a more permanent solution. Lastly, connect the motors to M1 and M2 of the motor shield. Now, you’re ready to write some code for the Arduino Bluetooth Car.

Writing Code for Arduino Bluetooth Car

Before writing the code, check out the values used by the BLE joystick app. Here is an image you can refer to:

BLE Joystick App to control Arduino Bluetooth Car

We will use the AFMotor library, which will make the coding easy. You can download the library from here (click to download), or you can Goto >> Tools >> Manage Libraries >> Enter AFMotor.h in the search bar and install the library. Now, let’s talk about the code. Unlock the code walk-through by signing in below.

Test Arduino Bluetooth Car

Now that we have the robot build, wired, and programmed, it’s time to power it up. I used two separate batteries: one for powering the Arduino, and another to power the motor shield. Make sure to remove the jumper from the shield before you connect the batteries, because if you don’t, it may damage the Arduino board.

Once the robot is powered up, you will see the light on Bluetooth module blinking. Now open the BLE Joystick app. Click on the top right corner (Bluetooth Symbol), and you will see a list of bluetooth addresses. (For some reason it shows the same address multiple times.) Select the first one on the list.

When you select the bluetooth address, you will notice that the LED on module stops blinking and becomes solid. That indicates connection is established. Now you can start using your smartphone to control the robot.

Did you enjoy this tutorial? If so, be sure to share it with a friend who enjoys robotics.

We also have a brand-new online robotics course designed to get you building, wiring, and programming mobile robots in 30-days! Check it out here.

Support Content Like This

You May Also Like

Have a question? Need Help?

Thanks for dropping by! Comments are no longer moderated daily.
Before posting your comment, please consider buying a coffee.
If you'd like to work with Liz, you can schedule a call here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Learn Robotics Botly Favicon

Become a Learn Robotics Insider


Be the first to know when we launch new robotics content. Plus gain FREE robotics tips to your inbox.

Awesome! Check your inbox for a surprise!

Remote Robotics Courses for High School, Middle School, or Pre-College Training

Join the Powered by Learn Robotics Program

Teach robotics anywhere with our turnkey robotics program!

Download our free program brochure!

Success! Check your email for the download!