Menu Close

DTMF Robot on The Arduino Robotic Kit

Robo India Presents DTMF based wireless robot on The Arduino Robotic Kit.

Where to Buy.

Buy on Amazon Prime –  click here

Buy on Robo India – click here

1. Introduction:

A step by step guide for to make DTMF Based Wireless Robot on Robo India The Arduino Starter Kit.

You may need this tutorial to assemble the chassis. While you assemble chassis. Here is the basic robot assembly of The Arduino Robotic Kit.

1.2 Additional assembly guide toDTMF Robot

The Arduino Robotic Kit comprises several parts. These parts come in sorted form in separate poly bags. Each poly bag is named. Following parts will be required to construct DTMF Robot on The Arduino Robotic Kit.

  1. Basic Assembled robot of The Arduino Robotic Kit
  2. DTMF Module
  3. DTMF Module studs and screw set
  4. Aux. Cable
  5. Screw driver

Follow the following guide to make line follower, please note that this tutorial is a sequel of basic robot assembly.

2. Assembly and Connections

After assembling the robot make the connection as given in the following diagram. The Power Jumper on the motor shield works as Switch to motor it will be useful while debugging.

2.1 Assembly

Assemble all the parts required for line follower robot. 

2.2 Testing motor Connection

It is difficult to find GND and positive supply terminal of motor. Transfer the following code to the Arduino Board. The robot should move in forward direction, if it not doing so, interchange the of the wire of motor. e.g. suppose left motor is rotating in back ward direction and right motor is rotating in forward direction then you have to interchange the wires of M3 terminal.

You may download this sketch from here.

//Robo India Line follower Tutorial
// This codes runs robo int the forward direction.

// Shield Pins Declaration 
int dataPin = 8;        
int latchPin = 12;
int clockPin = 4;
int en = 7;
void setup()
{
    pinMode(dataPin, OUTPUT);     // Setting up the motor shield. 
    pinMode(latchPin, OUTPUT);
    pinMode(clockPin, OUTPUT);
    pinMode(en, OUTPUT);    
    digitalWrite(en, LOW); 
 
 forward(); // This funtion for forward robot motion
 
  
 }

void loop()
{
}

void forward(void){
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 3);
        digitalWrite(latchPin, HIGH);  

}

void backward(void){
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 164);
        digitalWrite(latchPin, HIGH);  
}

void turn_left(void){
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 161);
        digitalWrite(latchPin, HIGH);  
}

void turn_right(void){
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 38);
        digitalWrite(latchPin, HIGH);  
}

void halt(void){
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 32);
        digitalWrite(latchPin, HIGH);  
}


2.3 Programming DTMF Robot

Till the above step you have made all of the connection and your motors are connected to the correct terminals. The following programme is the wireless DTMF robot Control programme.

It has following predefined function for robot motion-

1. forward() : forward movement of robot.

2. backward() : backward movement of robot.

3. turn_left() : for turning left.

4. turn_right(): for turning right.

5. halt() : for stopping robot.

You may download this sketch from here.

// Robo India DTMF Robot Tutorial
// www.roboindia.com

// declaring Motor Shield
int dataPin = 8;        
int latchPin = 12;
int clockPin = 4;
int en = 7;
  
const int Q1 = A0;  // Defining Digital Input Pins from DTMF Module
const int Q2 = A1;
const int Q3 = A2;
const int Q4 = A3;

int SoQ1 = 0;     // Defining variable to store the status(HIGH/LOW) of above inputs.
int SoQ2 = 0;
int SoQ3 = 0;
int SoQ4 = 0;
int oldCon = 0;  //  Variable to know what was the last button pressed.  

void setup(){ 
   pinMode(Q1, INPUT);  // Defining pins as input.
   pinMode(Q2, INPUT);
   pinMode(Q3, INPUT);
   pinMode(Q4, INPUT);
  
   pinMode(dataPin, OUTPUT);     // Setting up Motor Shield
   pinMode(latchPin, OUTPUT);
   pinMode(clockPin, OUTPUT);
   pinMode(en, OUTPUT);    
   digitalWrite(en, LOW);   
}

void loop(){
  SoQ1 = digitalRead(Q1);  // Reading status of Input Pins. It can be LOW or HIGH
  SoQ2 = digitalRead(Q2);
  SoQ3 = digitalRead(Q3);
  SoQ4 = digitalRead(Q4);
  
   if(SoQ4==LOW && SoQ3==LOW && SoQ2==HIGH && SoQ1==LOW )  // Condition for Button 2. It is equal to Binary - 0010 
    {
      if (oldCon!=2){
         forward();
       }
      oldCon=2;  
    }
  
  else if(SoQ4==LOW && SoQ3==HIGH && SoQ2==LOW && SoQ1==LOW )  // Condition for Button 4. It is equal to Binary - 0100 
    {
      if (oldCon!=4){
        turn_left();
       }
      oldCon=4;  
    }
  else if(SoQ4==LOW && SoQ3==HIGH && SoQ2==LOW && SoQ1==HIGH )  // Condition for Button 5. It is equal to Binary - 0101 
        {
      if (oldCon!=5){
         halt();
       }
      oldCon=5;  
    }
 
  else if(SoQ4==LOW && SoQ3==HIGH && SoQ2==HIGH && SoQ1==LOW )   // Condition for Button 6. It is equal to Binary - 0110 
    {
      if (oldCon!=6){
       turn_right(); 
       }
      oldCon=6;  
    } 
  else if(SoQ4==HIGH && SoQ3==LOW && SoQ2==LOW && SoQ1==LOW )   // Condition for Button 8. It is equal to Binary - 1000 
    {
      if (oldCon!=8){
         backward();  
       }
      oldCon=8;  
    }    
    
delay(50);   // Debounce Delay.
  
}

// Motor Shield Funtions. 
void forward(void){  // function for forward movement. 
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 3);
        digitalWrite(latchPin, HIGH); 
}

void backward(void){   // function for forward movement. 
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 164);
        digitalWrite(latchPin, HIGH); 
}

void turn_left(void){   // function for left turn. 
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 161);
        digitalWrite(latchPin, HIGH);  
}

void turn_right(void){   // function for Right turn. 
        digitalWrite(latchPin, LOW);            
        shiftOut(dataPin, clockPin, LSBFIRST, 38);
        digitalWrite(latchPin, HIGH);  
}

void halt(void){        // function for stopping robot. 
        digitalWrite(latchPin, LOW);             
        shiftOut(dataPin, clockPin, LSBFIRST, 32);
        digitalWrite(latchPin, HIGH);  
}



once you have transferred this code to the the Arduino board. Your robot is ready to follow wireless instruction through DTMF. Connect a phone to the DTMF board using 3.5 mm Aux. audio cable. 

This robot will perform following function-

1. If you press 2 it will move forward.

2. If you press 4 it will turn left.

4. If you press 5 it will stop.

5. If you press 6 it will turn right.

6. If you press 8 it will move backward.

3. Resources:

Where to Buy.

Buy on Amazon Prime –  click here

Buy on Robo India – click here

Detailed DTMF Tutorial.

This motor shield is based on Adafruit Motor Shield. Resources can be found here.

If you have any query please write us at support@roboindia.com

Thanks and Regards
Content Development Team 
Robo India
https://roboindia.com


Leave a Reply