top of page
Writer's pictureSanskruti Ashtikar

Building a Bluetooth Controlled Robot Using TinkerCAD

Updated: Nov 25

Bluetooth-controlled robots are a fun and engaging way to learn about wireless communication and robotics. This project will guide you through designing, simulating, and programming a Bluetooth-controlled robot using TinkerCAD. With the ability to control your robot using a smartphone, you’ll gain a deeper understanding of Arduino programming, Bluetooth communication, and motor control.





Materials Needed:


  • Arduino Uno

  • HC-05 Bluetooth Module

  • L298N Motor Driver Module

  • DC Motors (x2)

  • Robot Chassis with Wheels

  • Power Supply (e.g., 9V battery or battery pack)

  • Breadboard

  • Jumper Wires


Step 1: Understanding the Bluetooth Controlled Robot


In this project, an Arduino Uno board will be connected to an HC-05 Bluetooth module, allowing wireless communication with a smartphone. The Arduino will receive commands via Bluetooth and control the motors accordingly, making the robot move forward, backward, or turn left and right.


Step 2: Setting Up the Components in TinkerCAD


  1. Arduino Uno: Place the Arduino Uno on the TinkerCAD workspace. This will be the brain of your Bluetooth-controlled robot.

  2. HC-05 Bluetooth Module: Place the HC-05 Bluetooth module on the breadboard.

    • VCC: Connect to 5V on the Arduino.

    • GND: Connect to GND on the Arduino.

    • TXD: Connect to the RX (digital pin 0) on the Arduino.

    • RXD: Connect to the TX (digital pin 1) on the Arduino. You might need to use a voltage divider here, as the RX pin on the HC-05 is 3.3V tolerant.

  3. L298N Motor Driver Module: Place the L298N motor driver on the breadboard.

    • IN1, IN2, IN3, IN4: These control the direction of the motors.

      • Connect IN1 to digital pin 8 on the Arduino.

      • Connect IN2 to digital pin 9 on the Arduino.

      • Connect IN3 to digital pin 10 on the Arduino.

      • Connect IN4 to digital pin 11 on the Arduino.

    • EN1 and EN2: These enable the motors.

      • Connect EN1 to 5V on the Arduino (can also be connected to PWM pins for speed control).

      • Connect EN2 to 5V on the Arduino.

    • Motor Connections: Connect the left motor to OUT1 and OUT2, and the right motor to OUT3 and OUT4.

    • Power Supply: Connect a 9V battery or another power source to the motor driver’s VCC and GND. Make sure to connect the Arduino’s GND to the motor driver’s GND.

  4. DC Motors and Chassis: Attach two DC motors to the robot chassis and connect them to the motor driver as mentioned. Add wheels to the motors and a castor wheel for balance.





Step 3: Writing the Arduino Code


The Arduino code will listen for commands sent via Bluetooth and control the motors to move the robot accordingly.


char command; // Variable to store received data
int motor1Pin1 = 8;
int motor1Pin2 = 9;
int motor2Pin1 = 10;
int motor2Pin2 = 11;
void setup() {
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(motor2Pin1, OUTPUT);
  pinMode(motor2Pin2, OUTPUT);
  Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
  if (Serial.available() > 0) {
    command = Serial.read(); // Read the incoming data


    switch (command) {
      case 'F': // Move forward
        digitalWrite(motor1Pin1, HIGH);
        digitalWrite(motor1Pin2, LOW);
        digitalWrite(motor2Pin1, HIGH);
        digitalWrite(motor2Pin2, LOW);
        break;
      case 'B': // Move backward
        digitalWrite(motor1Pin1, LOW);
        digitalWrite(motor1Pin2, HIGH);
        digitalWrite(motor2Pin1, LOW);
        digitalWrite(motor2Pin2, HIGH);
        break;
      case 'L': // Turn left
        digitalWrite(motor1Pin1, LOW);
        digitalWrite(motor1Pin2, HIGH);
        digitalWrite(motor2Pin1, HIGH);
        digitalWrite(motor2Pin2, LOW);
        break;
      case 'R': // Turn right
        digitalWrite(motor1Pin1, HIGH);
        digitalWrite(motor1Pin2, LOW);
        digitalWrite(motor2Pin1, LOW);
        digitalWrite(motor2Pin2, HIGH);
        break;
      case 'S': // Stop
        digitalWrite(motor1Pin1, LOW);
        digitalWrite(motor1Pin2, LOW);
        digitalWrite(motor2Pin1, LOW);
        digitalWrite(motor2Pin2, LOW);
        break;
    }
  }
}




Step 4: Simulating the Circuit in TinkerCAD


  1. Start the Simulation: Click the "Start Simulation" button in TinkerCAD. Since TinkerCAD does not support direct Bluetooth communication, simulate the process by typing commands directly into the serial monitor.

  2. Test the Commands: Type 'F', 'B', 'L', 'R', and 'S' in the serial monitor to simulate the forward, backward, left, right, and stop commands, respectively. Observe how the motors respond.

  3. Troubleshooting: If the motors do not respond correctly, double-check your connections and ensure that the Arduino code matches the pin configurations.


Step 5: Controlling the Robot with a Smartphone


Once the simulation is successful, you can move on to controlling the robot with a smartphone. Here’s how to do it:

  1. Install a Bluetooth Controller App: Download a Bluetooth terminal app on your smartphone. Apps like "Bluetooth Terminal" for Android or "Bluetooth Serial Controller" for iOS work well.

  2. Pair the HC-05 Module: Pair your smartphone with the HC-05 Bluetooth module. The default pairing code is usually "1234" or "0000".

  3. Control the Robot: Use the app to send the commands ('F', 'B', 'L', 'R', 'S') to the robot. The robot should move in response to the commands received.


Step 6: Building the Physical Robot


After successfully simulating the circuit in TinkerCAD, you can build the physical robot using the components.

  1. Assemble the Components: Transfer the design from TinkerCAD to a real breadboard and chassis. Secure the components as per the connections outlined.

  2. Upload the Code: Connect the Arduino to your computer and upload the code.

  3. Test the Robot: Place the robot on the floor and use your smartphone to control its movements. Adjust the code and connections if necessary to achieve optimal performance.


Conclusion


Congratulations! You have successfully designed, simulated, and programmed a Bluetooth-controlled robot using TinkerCAD. This project introduces you to the basics of wireless communication, motor control, and robotics. By experimenting further, you can add features like speed control, obstacle avoidance, or even autonomous navigation.

TinkerCAD provides a powerful platform for prototyping and testing your ideas before building physical models. Continue to explore and innovate with your designs, and soon you’ll be creating even more complex and capable robots.


Happy tinkering and building!


Want us to guide you through your project or make the project for you ?







Create Various Projects

Check out our Free Arduino Projects Playlist - Arduino Projects 

Check out our Free Raspberry Pi Projects Playlist - Raspberry Pi Projects 

Check out our Free TinkerCAD Projects Playlist - TinkerCAD Projects 

Check out our Free IoT Projects Playlist - IoT Projects 

Check out our Free Home Automation Projects Playlist - Home Automation Projects 

Check out our Free NodeMCu Projects Playlist - NodeMCu Projects 





50 views0 comments

Related Posts

See All

Comments


bottom of page