Project tutorial
4-Wheel Robot Made With Arduino Controlled Using Dabble

4-Wheel Robot Made With Arduino Controlled Using Dabble © CC BY

This project will show you how to make a DIY 4-wheel robot that can be controlled using a smartphone via Dabble, a mobile application.

  • 11 views
  • 0 comments
  • 0 respects

Components and supplies

Apps and online services

About this project

Another project, another out-of-the-box gifting idea! Presenting to you the Dabble controlled 4-wheel robot - an simple-and-fun to build and easy-to-control robot that can be controlled via Bluetooth using Dabble, a mobile application indigenously developed us. All you need to make your robot is an Arduino Uno board, chassis, wheels, motor shafts, and other accesories and tools. To control it, you need to install Dabble from Google Play and pair it with Bluetooth; and your robot’s ready to go places!

What better way to end the year with the same DIYing spirit that it began with, right? So what are you waiting for!

So, Let’s get started!

Step 1: Things You'll Need

  • Arduino Uno Board
  • Breadboard
  • Chassis
  • Motor Mounts
  • DC Motors
  • Wheel
  • Motor Driver
  • Bluetooth Module HC05
  • DC Terminal Block
  • Battery
  • Jumper Cables

Step 2: Making of the Body

Firstly, we will start making the body of the 4 Wheel Robot.

Take the chassis and turn it upside down.

Onto this chassis mount 4 motor mounts using M3 Bolts and nuts.

Fix the DC Motors and fix them on the motor mounts using M2 Nuts and Bolts.

Attach wheels on each shaft of the DC Motor.

Flip the assembly, thus your body is created.

Step 3: Adding the Brain

The microcontroller that we are going to use is Arduino Uno.

We are going to make all the connections on it, but we are also going to use a breadboard to make the connections.

Step 4: Making Connections and Using Motor Driver

Make the connection as shown in the below figure.

We are going to make use of the motor drivers because Arduino Uno does not provide sufficient power to run 4 Motors. Thus, we will be adding the motor driver, we will be able to give the robot needed energy.

The left two motors are connected in parallel. Similarly, the right two motors are too connected in parallel.The connections are made as follows:

  • Enable Pins – Digital Pin 10 and 11
  • VCC – Arduino 5V
  • m1_dir1, m1_dir2, m2_dir1, m2_dir2 – Digital Pin 4, 5, 6, and 7
  • VC – External Battery
  • GND – GND of Arduino and BatteryMake sure we connect all the GND wires together.

Step 5: Connecting Smartphone

We need to add a module that will make the connection between your robot and Dabble App on Smartphone.

We are taking Bluetooth HC05 Module. Connect it as shown in the connection figure.

Step 6: Adding the Battery

We will need to add an extra power source to our robot. Also, to connect Arduino Uno with the battery we are going to use DC Terminal Block or DC Jack.

Step 7: Arduino Code

Upload the following code:

Step 8: Working

We can easily connect our robot to our Smartphone using Dabble.

Before working with any of the modules, you need to connect the Bluetooth that you are working on.

There are many modules available in the App for other functionalities.

Today we will be working with the Gamepad Module.

And we will be using the Left Set of buttons:

  • Up – Move Forward
  • Down – Move Backward
  • Left – Turn Left
  • Right – Turn Right

Step 9: Conclusion

With this, you DIYDabble-controlled 4wheel robot is ready for action!

Psst! Just so you know, Dabble can do much more than just wirelessly controlling robots. You can explore more about it here!

Code

robot.inoArduino
/* 
 *  
 *  this project demonstrate controlling arduino 4 wheel robot using Dabble app
 *  we will be using gamepad module in digital mode 
 *  for more information about gamepad go to https://thestempedia.com/docs/dabble/game-pad-module/
 *  
 *  in this project we will be using HC-05 bluetooth module  
 *  for arduino "UNO" use bluetooth module buadrate below 38400
 *  
 *  connection of bluetooth module with arduino 
 *  
 *  HC-05 bluetooth module ----> arduino "UNO"
 *  
 *              Tx         ----> 2
 *              Rx         ----> 3 
 *              
 *  Written by by Punit chotaliya, STEMpedia         
 *  on 16 jan 2019
 *              
 */

//To include the GamePad module in the Arduino program, you have to 
//include the following header:
#define CUSTOM_SETTINGS
#define INCLUDE_GAMEPAD_MODULE

//include Dabble app library 
#include <Dabble.h>

#define motor1_en 10      // motor 1 enable pin 
#define motor2_en 11      // motor 2 enable pin 
#define motor1_dir1 4     // motor 1 input1 (InputA) 
#define motor1_dir2 5     // motor 1 input2 (InputA)
#define motor2_dir1 6     // motor 2 input1 (InputB)
#define motor2_dir2 7    // motor 2 input2  (InputB)

void setup() 
   {
      // put your setup code here, to run once:
       
      Serial.begin(9600);   //  start serial communication using 9600 baudrate
      Dabble.begin(38400); // Enter your bluetooth module baudrate
                            // NOTE : for arduino "UNO" use bluetooth module buadrate below 38400 
      for(unsigned int i=4;i<8;i++)
         {
             pinMode(i,OUTPUT); // declaring input pins of motor1 and motor2 as a output pin 
         }
      pinMode(motor1_en,OUTPUT);  // declaring enable pins of motor as a output 
      pinMode(motor2_en,OUTPUT);

       
        
    }

void loop() 
     {
        // put your main code here, to run repeatedly:
        
         Dabble.processInput(); //To refresh the data that the arduino UNO got from the mobile app, you have to use the following line of code
      
        
        if (GamePad.isUpPressed()) // if UP is pressed in the gamepad then move robot forward
          {
             Serial.print("UP");
             forward();
          }

        else if (GamePad.isDownPressed()) // if DOWN is pressed in the gamepad then move robot backward
          {
             Serial.print("DOWN");
             backward();
          }

        else  if (GamePad.isLeftPressed()) // if LEFT is pressed in the gamepad then move robot LEFT
           {
              Serial.print("Left");
              left();
           }

        else  if (GamePad.isRightPressed()) // if RIGHT is pressed in the gamepad then move robot RIGHT
           {
               Serial.print("Right");
               right();
           }

        else // stop the robot
           {
            Serial.println("strop");
            Stop();
           }


     }

     void forward()  // function for robot forward movement 
     {
        analogWrite(motor1_en,255);
        analogWrite(motor2_en,255);
        digitalWrite(motor1_dir1,HIGH);
        digitalWrite(motor1_dir2,LOW);
        digitalWrite(motor2_dir1,HIGH);
        digitalWrite(motor2_dir2,LOW);
      
     }
     void backward() // function for robot backward movement 
     {
        analogWrite(motor1_en,255);
        analogWrite(motor2_en,255);
        digitalWrite(motor1_dir1,LOW);
        digitalWrite(motor1_dir2,HIGH);
        digitalWrite(motor2_dir1,LOW);
        digitalWrite(motor2_dir2,HIGH);
      
     }
     void left() // function for robot left movement 
     {
        analogWrite(motor1_en,255);
        analogWrite(motor2_en,255);
        digitalWrite(motor1_dir1,LOW);
        digitalWrite(motor1_dir2,HIGH);
        digitalWrite(motor2_dir1,HIGH);
        digitalWrite(motor2_dir2,LOW);
      
     }
     void right() // function for robot right movement 
     {
        analogWrite(motor1_en,255);
        analogWrite(motor2_en,255);
        digitalWrite(motor1_dir1,HIGH);
        digitalWrite(motor1_dir2,LOW);
        digitalWrite(motor2_dir1,LOW);
        digitalWrite(motor2_dir2,HIGH);
      
     }
     void Stop() // // function for no movement
     {
        analogWrite(motor1_en,0);
        analogWrite(motor2_en,0);
        digitalWrite(motor1_dir1,LOW);
        digitalWrite(motor1_dir2,LOW);
        digitalWrite(motor2_dir1,LOW);
        digitalWrite(motor2_dir2,LOW);
      
     }
evive LibraryC/C++
No preview (download only).

Schematics

Fritzing Diagram of Four Wheel Robot
Dabble robot bb (5) rkd1ul1ctw

Comments

Similar projects you might like

Bluetooth Controlled Pick And Place Robot

Project tutorial by Ahmed Ebrahem Ahmed

  • 9,099 views
  • 15 comments
  • 42 respects

Hand Gesture Controlled Robot

Project tutorial by Mayoogh Girish

  • 57,771 views
  • 78 comments
  • 70 respects

Bolt Controlled Robot Car

Project tutorial by Team Bolt

  • 1,898 views
  • 1 comment
  • 17 respects
Add projectSign up / Login