Skip to main content

Smart Robot with voice control, line follower, obstacle avoiding and remote control.

SMART ROBOT CAR 










This smart robo is based on arduino , and canwork in 3 modes .... all these modes are 
selected by a common android app


1st  mode  : Inbuilt  App  Joystick

   working via the app inbuilt joystick command were we can use joystick to control   robo like a
   RC car. 
   
   

2nd mode : Voice controlled robo 

    Here you can give input to the robo with voice commands.


3rd mode : Autonomous mode 

    Here the robo will use its ultrasonic sensor to find free way and avoid collision  with objects or 
    wall.

4th mode : Line follower (optional).

     Here we are giving you the option of line following if you need you can active.
 

5th mode ; IR remote control (optional).

This option is also available here.if you need you may active. 
____________________________________________________________________

Download link for app =>



------------------------------------------------------------------------------------------------------


Spare parts (needed)               =>

1- Arduino board (any).---------1pc
2- DC motor driver -L298n ___1pc
3- IR sensor -----------------------2pcs
4- IR Receiver --------------------1pc
5- Bluetooth Module (HC05/HC06)----------1pc
7- Servo Motor SG90 -------------1pc
8- DC gear motor with chassis--- 2pc or 4pcs
9- Jumper wire.
10- Data cable-----------------------1pc
11- PC with Arduino IDE.


-------------------------------------------------------------------------------------------------------

Circuit  diagram =>








         For circuit you just have to attach all components Vcc to 5 volts and GND to ground 
         now follow the instruction with me :-

         
     

        IR Sensors =>

 









............................................................................................................................................  

        IR Receiver =>

    







............................................................................................................................................

           Ultrasonic sensor  =>


       






  
  

...........................................................................................................................................

           Servo =>

          

.............................................................................................................................................

           Motor driver  =>

         

..............................................................................................................................................


Programming  =>

          Download the program from above and paste It to your arduino IDE,
          note that in my build i have not used IR sensor or IR receiver so part
          the program is commented so if you are using both this sensors you 
          can uncomment and use it .
         
        Before uploading the program be sure that rx and tx of arduino  and 
        bluetooth module are dissconected ....After uploading is done connect 
        back rx of module to tx of arduino and vicw versa.



#include <SoftwareSerial.h>
SoftwareSerial BT_Serial(2, 3); // RX, TX


const int RECV_PIN = A5;

#define enA 10//Enable1 L298 Pin enA 
#define in1 9 //Motor1  L298 Pin in1 
#define in2 8 //Motor1  L298 Pin in1 
#define in3 7 //Motor2  L298 Pin in1 
#define in4 6 //Motor2  L298 Pin in1 
#define enB 5 //Enable2 L298 Pin enB 

#define servo A4

#define echo A2    //Echo pin
#define trigger A3 //Trigger pin

int distance_L, distance_F = 30, distance_R;
long distance;
int set = 20;

int bt_ir_data; // variable to receive data from the serial port and IRremote
int Speed = 130;  
int mode=0;
int IR_data;

void setup(){ // put your setup code here, to run once

pinMode(echo, INPUT );// declare ultrasonic sensor Echo pin as input
pinMode(trigger, OUTPUT); // declare ultrasonic sensor Trigger pin as Output  

pinMode(enA, OUTPUT); // declare as output for L298 Pin enA 
pinMode(in1, OUTPUT); // declare as output for L298 Pin in1 
pinMode(in2, OUTPUT); // declare as output for L298 Pin in2 
pinMode(in3, OUTPUT); // declare as output for L298 Pin in3   
pinMode(in4, OUTPUT); // declare as output for L298 Pin in4 
pinMode(enB, OUTPUT); // declare as output for L298 Pin enB 

Serial.begin(9600); // start serial communication at 9600bps
BT_Serial.begin(9600); 

pinMode(servo, OUTPUT);

 for (int angle = 70; angle <= 140; angle += 5)  {
   servoPulse(servo, angle);  }
 for (int angle = 140; angle >= 0; angle -= 5)  {
   servoPulse(servo, angle);  }

 for (int angle = 0; angle <= 70; angle += 5)  {
   servoPulse(servo, angle);  }
delay(500);
}


void loop(){  

if(BT_Serial.available() > 0){  //if some date is sent, reads it and saves in state     
bt_ir_data = BT_Serial.read(); 
Serial.println(bt_ir_data);     
if(bt_ir_data > 20){Speed = bt_ir_data;}      
}



     if(bt_ir_data == 8){mode=0; Stop();}    //Manual Android Application and    
else if(bt_ir_data ==10){mode=2; Speed=200;} //Auto Obstacle Avoiding Command

analogWrite(enA, Speed); // Write The Duty Cycle 0 to 255 Enable Pin A for Motor1 Speed 

analogWrite(enB, Speed); // Write The Duty Cycle 0 to 255 Enable Pin B for Motor2 Speed 

if(mode==0){     
//===============================================================================
//                          Key Control Command
//=============================================================================== 
     if(bt_ir_data == 1){forword(); }  // if the bt_data is '1' the DC motor will go forward
else if(bt_ir_data == 2){backword();}  // if the bt_data is '2' the motor will Reverse
else if(bt_ir_data == 3){turnLeft();}  // if the bt_data is '3' the motor will turn left
else if(bt_ir_data == 4){turnRight();} // if the bt_data is '4' the motor will turn right
else if(bt_ir_data == 5){Stop(); }     // if the bt_data '5' the motor will Stop

//===============================================================================
//                          Voice Control Command
//===============================================================================    
else if(bt_ir_data == 6){turnLeft();  delay(400);  bt_ir_data = 5;}
else if(bt_ir_data == 7){turnRight(); delay(400);  bt_ir_data = 5;}
}


if(mode==2){    
//===============================================================================
//                          Obstacle Avoiding Control
//===============================================================================     
 distance_F = Ultrasonic_read();
 Serial.print("S=");Serial.println(distance_F);
  if (distance_F > set){forword();}
    else{Check_side();}
}

delay(10);
}

void servoPulse (int pin, int angle){
int pwm = (angle*11) + 500;      // Convert angle to microseconds
 digitalWrite(pin, HIGH);
 delayMicroseconds(pwm);
 digitalWrite(pin, LOW);
 delay(50);                   // Refresh cycle of servo
}


//**********************Ultrasonic_read****************************
long Ultrasonic_read(){
  digitalWrite(trigger, LOW);
  delayMicroseconds(2);
  digitalWrite(trigger, HIGH);
  delayMicroseconds(10);
  distance = pulseIn (echo, HIGH);
  return distance / 49 / 4;
}

void compareDistance(){
       if (distance_L > distance_R){
  turnLeft();
  delay(350);
  }
  else if (distance_R > distance_L){
  turnRight();
  delay(350);
  }
  else{
  backword();
  delay(300);
  turnRight();
  delay(600);
  }
}

void Check_side(){
    Stop();
    delay(100);
 for (int angle = 70; angle <= 140; angle += 5)  {
   servoPulse(servo, angle);  }
    delay(300);
    distance_L = Ultrasonic_read();
    delay(100);
  for (int angle = 140; angle >= 0; angle -= 5)  {
   servoPulse(servo, angle);  }
    delay(500);
    distance_R = Ultrasonic_read();
    delay(100);
 for (int angle = 0; angle <= 70; angle += 5)  {
   servoPulse(servo, angle);  }
    delay(300);
    compareDistance();
}

void forword(){  //forword
digitalWrite(in1, HIGH); //Right Motor forword Pin 
digitalWrite(in2, LOW);  //Right Motor backword Pin 
digitalWrite(in3, LOW);  //Left Motor backword Pin 
digitalWrite(in4, HIGH); //Left Motor forword Pin 
}

void backword(){ //backword
digitalWrite(in1, LOW);  //Right Motor forword Pin 
digitalWrite(in2, HIGH); //Right Motor backword Pin 
digitalWrite(in3, HIGH); //Left Motor backword Pin 
digitalWrite(in4, LOW);  //Left Motor forword Pin 
}

void turnRight(){ //turnRight
digitalWrite(in1, LOW);  //Right Motor forword Pin 
digitalWrite(in2, HIGH); //Right Motor backword Pin  
digitalWrite(in3, LOW);  //Left Motor backword Pin 
digitalWrite(in4, HIGH); //Left Motor forword Pin 
}

void turnLeft(){ //turnLeft
digitalWrite(in1, HIGH); //Right Motor forword Pin 
digitalWrite(in2, LOW);  //Right Motor backword Pin 
digitalWrite(in3, HIGH); //Left Motor backword Pin 
digitalWrite(in4, LOW);  //Left Motor forword Pin 
}

void Stop(){ //stop
digitalWrite(in1, LOW); //Right Motor forword Pin 
digitalWrite(in2, LOW); //Right Motor backword Pin 
digitalWrite(in3, LOW); //Left Motor backword Pin 
digitalWrite(in4, LOW); //Left Motor forword Pin 
}





...........................................................................................................................................
...........................................................................................................................................  

For its working do check out our Youtube video for the same =>


or go the link you can get Code ,APK file and Ckt diagram.

https://drive.google.com/file/d/1Xsm317gT9Gc8tkCykGt1swJwFmqzqcy1/view?usp=sharing

For serial library-
https://github.com/PaulStoffregen/SoftwareSerial.git 




............................................................................................................................................


WE WOULD LOVE YOUR INVOLVEMENT IN PROJECT MAKING SO IF YOU HAVE MADE THE SAME PROJECT DO SHARE US ON  geniustec18@gmail.com   .



............................................................................................................................................



Comments

Popular posts from this blog

  ST7735 LCD With Arduino Uno and Arduiono Nano (TUTORIAL) Hi. Today we learn about 1.8 inch ST7735 LCD TFT color display. We will use here Arduino uno and Arduino nano for this tutorial. it will be pretty cool . let us start .   The ST7735 TFT display is a 1.8″ display with a resolution of 128×160 pixels and can display a wide range of colors (full 18-bit color, 262,144 shades!). The display uses the SPI protocol for communication and has its own pixel-addressable frame buffer which means it can be used with all kinds of micro controller and you only need 4 I.O. pins. To complement the display, It also comes with an SD card slot on which colored bit maps can be loaded and easily displayed on the screen . Features  of ST7735 TFT--- ·           1.8″ diagonal LCD TFT display ·        ·           128×160 resolution, 18-bit (262,144) color ·        ·             4 or 5 wire SPI digital interface ·        ·         Built-in microSD slot – uses 2 more digital lines ·       ·          5V comp

HOW WE CAN MAKE CNC PLOTTER FROM OLD DVD DRIVES WITH ARDUINO SHIELD IN HOME

Here we are sh owing you how we can make CNC PLOTTER from old dvd drives and Arduino uno with l293 driver shield.We can plot any image or any words with this.So try to make it and enjoy with plotter.Keep watching we will give you idea for more types of plotters.Also you can learn ,How you can make G code for plotter.

TASMOTA WITH ESP

WHAT IS TASMOTA HOW WE CAN USE WITH ESP    DEVICES

SMART-HOME AUTOMATION WITH ESP01 /ESP8266 (TASMOTA FIRMWARE)

                                   SMART-HOME AUTOMATION                          { ESP-01 WITH TASMOTA FIRMWARE } TODAY WE ARE MAKING HERE A HOME AUTOMATION DEVICE WITH TASMOTA FIRMWARE . YOU CAN CONTROL HOME APPLIANCES WITH YOUR MOBILE OR PC SCREEN WITH WI FI .     # VERY CHEAP . # VERY EASY.     # NO CODE REQUIRED. REQUIREMENTS   ( HARDWARE ) •      ESP 01 (8266) MODULE •      ESP 01 MODULE PROGRAMMER OR ARDUINO UNO. •      JUMPER WIRES. •      OPTIONAL PUSH BUTTON •      LATEST VERSION OF TASMOTA. •      TASMOTIZER . •      PC AND DATA CABLE  ( IF YOU ARE USING ARDUINO UNO FOR FLASHING ). •      3.7 VOLT DC POWER SUPPLY. ( AMS 1117-3.3 LDO ) •     LM7805    IC FOR RELAY MODULE . •     BATTERY 7.2 VOLT. •     PC- FOR PROGRAMMING                                                     REQUIREMENTS                       (SOFTWARE)                •     DOWNLOAD LATEST VERSION OF TASMOTA BINARY FILE  .( LINK                          GIVEN )              http://ota.tasm

Home Automation With Arduino .(Bluetooth)

Here we are showing you that how you can run any home appliances with smartphones,This is the projects model of a arduino bluetooth device .you can control your's home appliances with any smart phone from anywhere with internet .Here we are using a electric 220 volts AC bulb,to show you .You can use it for your all other home appliances like fans ,air conditioner,lights and many more. to run with relays with smart way.So learn that and make your home Smart Home.   Download link here   (for sketch ) Download link here    ( for Smartphone ) If you have any inquiry please whatsapp on 00966571482173 or mail on geniustec18@gmail.com  Thanks for watching. 

controling devices with Smart phone and Arduino

Today we will show you a project that  can control devices with smart phones. We can increase or decrease the speed of fan, Desert coolers, Air conditioner  or increase or decrease the lights of lamp. we can make smart home with  Arduino. we can control devices anywhere in the world with internet .Here we will use arduino uno and bluetooth for controlling the devices. Contact us for any inquiry on mail    geniustec18@Gmail.com Download link  {For Arduino Uno } Download link   { APK file for Your Smartphone }