How to make a 4WD omnidirectional Bluetooth-controlled car using the Arduino Nano board

Hello and welcome back! In this project, we will learn how to make a 4WD omnidirectional Bluetooth-controlled car using the Arduino Nano board. For Bluetooth communication, I used the HC-05 Bluetooth module, which allows us to control the car wirelessly using a smartphone. This car is a 4-wheel drive (4WD) vehicle, and for that, I used four 5V DC gear motors along with four mecanum wheels. If you want to know more about the mecanum wheels, please check out this link.

Especially in this project, I have designed a custom PCB chassis for this car. So, we don’t need any additional chassis or body for this. All the electronic components, such as the Arduino Nano, motor drivers, HC-05 module, and LEDs, are directly mounted on this PCB. It makes the car look neat, compact, and professional. I also added front and rear lights on the PCB, which work just like real car headlights and tail lights. You can also change the motor speed by rotating the preset on the board. I believe you can build a superb and creative 4WD omnidirectional car using this PCB. You can easily get your PCB printed using free coupons from JLCPCB.

For the power supply, I used two 18650 Li-ion batteries, which provide enough current and longer run time for the motors. However, if you don’t have those, you can also use a 9V battery, but the running time will be shorter. Also, you can control this car using our SRITU HOBBY Bluetooth remote app, which you can download for free from the Google Play Store.

Ok, let’s do this project step by step. The required components are given below.

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

Secondly, let’s order PCBs for this project.

  • Click the “Instant Quote” button and upload the Gerber file, which you can download from the link below.
  • Gerber file – Download
  • For this project, I ordered five White PCBs. Next, select the build time and shipping method. Finally, click “Save to Cart” and complete the payment.

Step 3

Thirdly, unbox your PCB package once you receive it.

Step 4

Now, solder all the components onto the PCB.

Step 5

Afterward, connect the wheels to the gear motors using the wheel couplings. Then, install all four motors onto the chassis properly. For that, I used the glue gun.

Step 6

Next, put the wires through the holes and connect them to the correct terminals.

Step 7

Now, mount the battery holder on the rear side of the car. After that, attach the Arduino Nano board, both L293D motor driver ICs, and the 74HC595 shift register IC to the PCB in their proper places.

Step 8

Next, connect the Arduino Nano board to your computer. Then, copy and paste the following program into the Arduino IDE. Also, you have to install the AFmotor library file.

#include <AFMotor.h>

// Motor setup
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);

// Pin definitions
#define Flight 10      // Front lights
#define Rlight 9       // Brake lights
#define speedPin A0    // 104 preset connected here

int Speed = 200;
char value;

void setup() {
  Serial.begin(9600);

  // Set light pins as outputs
  pinMode(Flight, OUTPUT);
  pinMode(Rlight, OUTPUT);

  // Set initial speed (will be updated in loop anyway)
  motor1.setSpeed(Speed);
  motor2.setSpeed(Speed);
  motor3.setSpeed(Speed);
  motor4.setSpeed(Speed);
}

void loop() {
  // Read speed from potentiometer and map it to 0–255
  Speed = analogRead(speedPin) / 4;  // 0–1023 → 0–255

  // Update motor speed
  motor1.setSpeed(Speed);
  motor2.setSpeed(Speed);
  motor3.setSpeed(Speed);
  motor4.setSpeed(Speed);

  // Read Bluetooth input if available
  if (Serial.available() > 0) {
    value = Serial.read();
    Serial.println(value);
  }

  // Movement and light commands
  if (value == 'U') {
    forward();
  } else if (value == 'D') {
    backward();
  } else if (value == 'L') {
    leftSide();
  } else if (value == 'R') {
    rightSide();
  } else if (value == 'T') {
    turnLeft();
  } else if (value == 'F') {
    turnRight();
  } else if (value == 'H') {
    sideLeft();
  } else if (value == 'G') {
    sideRight();
  } else if (value == '1') {
    digitalWrite(Flight, HIGH);  // Turn front light on
  } else if (value == '2') {
    digitalWrite(Flight, LOW);   // Turn front light off
  } else {
    Stop();  // Stop motors and turn on brake light
  }
}

// Movement functions
void forward() {
  allForward();
  digitalWrite(Rlight, LOW);  // Brake light OFF
}
void backward() {
  allBackward();
  digitalWrite(Rlight, LOW);
}
void leftSide() {
  motor1.run(FORWARD);
  motor2.run(BACKWARD);
  motor3.run(FORWARD);
  motor4.run(BACKWARD);
  digitalWrite(Rlight, LOW);
}
void rightSide() {
  motor1.run(BACKWARD);
  motor2.run(FORWARD);
  motor3.run(BACKWARD);
  motor4.run(FORWARD);
  digitalWrite(Rlight, LOW);
}
void turnLeft() {
  motor1.run(BACKWARD);
  motor2.run(BACKWARD);
  motor3.run(FORWARD);
  motor4.run(FORWARD);
  digitalWrite(Rlight, LOW);
}
void turnRight() {
  motor1.run(FORWARD);
  motor2.run(FORWARD);
  motor3.run(BACKWARD);
  motor4.run(BACKWARD);
  digitalWrite(Rlight, LOW);
}
void sideLeft() {
  motor1.run(FORWARD);
  motor2.run(RELEASE);
  motor3.run(FORWARD);
  motor4.run(RELEASE);
  digitalWrite(Rlight, LOW);
}
void sideRight() {
  motor1.run(BACKWARD);
  motor2.run(RELEASE);
  motor3.run(BACKWARD);
  motor4.run(RELEASE);
  digitalWrite(Rlight, LOW);
}
void Stop() {
  motor1.run(RELEASE);
  motor2.run(RELEASE);
  motor3.run(RELEASE);
  motor4.run(RELEASE);
  digitalWrite(Rlight, HIGH);  // Turn brake light ON
}

// Optional helper to simplify repeated actions
void allForward() {
  motor1.run(FORWARD);
  motor2.run(FORWARD);
  motor3.run(FORWARD);
  motor4.run(FORWARD);
}
void allBackward() {
  motor1.run(BACKWARD);
  motor2.run(BACKWARD);
  motor3.run(BACKWARD);
  motor4.run(BACKWARD);
}
  • Now, select the correct board and port. After that, click the upload button.

Step 9

Next, unplug the USB cable and insert the batteries into the holder to power up your car.

Step 10

Okay, now it’s time to download and install the SRITU HOBBY app from the Google Play Store.

  • SRITU HOBBY App — Download
  • Next, open the SRITU HOBBY app and navigate to the Controllers tab. After that, choose the Bluetooth Car Remote from the list.
  • Afterward, click the gear wheel icon and find your device name. In this step, make sure to enable location and allow location permission. Then, you will see a green indicator on the remote.

Step 11

Finally, you can control your 4WD omnidirectional car using your mobile phone. If the motors don’t rotate correctly, please swap the motor wires. You can also adjust the speed of the car by rotating the preset. Okay, enjoy your project! The full video guide is given below. We hope to see you in the next project. Have a great day!

How to make a 4WD omnidirectional Bluetooth-controlled car using the Arduino Nano board

Similar Posts

Leave a Reply

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