Varun walimbe
Published © GPL3+

Floor Cleaning Robot

This Robot cleans floors very efficiently !!:)

IntermediateShowcase (no instructions)24 hours28
Floor Cleaning Robot

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
MAKERFACTORY 5V relay module compatible with Arduino
MAKERFACTORY 5V relay module compatible with Arduino
×2
BO Motor
×1
Geared DC Motor, 12 V
Geared DC Motor, 12 V
×2
water pump motor
×1
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
×1
9V battery (generic)
9V battery (generic)
×1
9V Battery Clip
9V Battery Clip
×1
Jumper wires (generic)
Jumper wires (generic)
×2
Custom PCB
Custom PCB
×1

Software apps and online services

Arduino IDE
Arduino IDE
Blynk
Blynk

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Desoldering Pump, Deluxe SOLDAPULLT®
Desoldering Pump, Deluxe SOLDAPULLT®
Tape, Double Sided
Tape, Double Sided
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Code

Floor Cleaning Bot.ino

Arduino
/*THIS IS CODE FOR FLOOR CLEANING ROBOT CAR
PIN NUMBERS I HAVE USED ARE OF ARDUINO PRO MINI.
TX AND RX PINS MAY OR MAY NOT BE DIFFERENT FOR YOU
CHANGE THE PIN NUMBERS ACCORDING TO THE TYPE OF ARDUINO YOU USE*/

#include<SoftwareSerial.h>
int TX=0;
int RX=1;
SoftwareSerial Blue(TX,RX); // HERE ("Blue") IS THE BLUETOOTH OBJECT
String button;
int Rp1=9; //CLEANING  MOTOR PIN (CONTROLLEF BY RELAY)
int Rp2=10; //WATER PUMP MOTOR PIN(CONTROLLED BY RELAY)
const int M1=2;
const int M2=3;
const int M3=4;
const int M4=5;

//const int ENA=9;  (USE THIS FOR MOTOR SPEED CONTROL)
//const int ENB=10;

void setup() 
{
  Serial.begin(9600);
  pinMode(Rp1,OUTPUT);
  pinMode(Rp2,OUTPUT);
  pinMode(M1,OUTPUT);
  pinMode(M2,OUTPUT);
  pinMode(M3,OUTPUT);
  pinMode(M4,OUTPUT);
  digitalWrite(Rp1,HIGH);
  digitalWrite(Rp2,HIGH);
  
  //pinMode(ENA,OUTPUT);
  //pinMode(ENB,OUTPUT);
}

void forward()
{
  digitalWrite(M1,HIGH);
  digitalWrite(M2,LOW);
  digitalWrite(M3,LOW);
  digitalWrite(M4,HIGH);
}

void backward()
{
  digitalWrite(M1,LOW);
  digitalWrite(M2,HIGH);
  digitalWrite(M3,HIGH);
  digitalWrite(M4,LOW);
}

void right()
{
  digitalWrite(M1,HIGH);
  digitalWrite(M2,LOW);
  digitalWrite(M3,LOW);
  digitalWrite(M4,LOW);
}

void left()
{
  digitalWrite(M1,LOW);
  digitalWrite(M2,LOW);
  digitalWrite(M3,LOW);
  digitalWrite(M4,HIGH);
}

void pause()
{
  digitalWrite(M1,LOW);
  digitalWrite(M2,LOW);
  digitalWrite(M3,LOW);
  digitalWrite(M4,LOW);
  
  digitalWrite(Rp1,HIGH);
  digitalWrite(Rp2,HIGH);
}

void clean()
{
  /*CLEANING METHOD DEPENDS ON PERSON TO PERSON
  SO USE YOUR OWN METHOD HERE FOR CLEANING :)
  
  <YOUR CODE>
  THIS WILL BE USED IN YOUR AUTONOMOUS FUNCTION
  */
  
}

void Autonomous()

{
  forward();
  clean();
  forward();
  clean();
  forward();
  clean();
  
}

void loop() 
{
  while (Serial.available())
  { 
    delay(10); //DELAY FOR STABILITY
    char c = Serial.read(); 
    if (c == '#') 
    {
      break; 
    } 
    button += c; //VOICE = VOICE+C
  }
  
  if(button.length()>0)
  {
    Serial.println(button);

    
    if(button=="*front")
    {
      Serial.println("go forward");
      forward();
    }
     if(button=="*back")
     {
       Serial.println("GO backward");
       backward();
     }
     if(button=="*right")
     {
       Serial.println("GO right");
       right();
     }

     if(button=="*left")
     {
       Serial.println("GO left");
       left();
     }

     if(button=="*water")
     {
       Serial.println("Turn the pump on");
       digitalWrite(Rp2,LOW);
     }

     if(button=="*clean")
     {
       Serial.println("Turn the cleaning motor on");
       digitalWrite(Rp1,LOW);
     }

     
     if(button=="*Autonomous")
     {
       Serial.println("Entered Autonomous Mode");
       Autonomous();
     }

     if(button=="*pause")
     {
       Serial.println("Entered Autonomous Mode");
       pause();
     }
      button = "";
    }
  }

Credits

Varun walimbe

Varun walimbe

9 projects • 0 followers
I like to innovate and make different types of Robots and systems that thrive to make human lives easier :)

Comments

Add projectSign up / Login