Floor Cleaning Robot

Employ a robot to take care of your floor cleaning jobs.

IntermediateFull instructions provided2 days1,438
Floor Cleaning Robot

Things used in this project

Story

Read more

Code

Robot Motion Control Code

Arduino
Energia Code for Robot Movement
// 9th and 10th for left motor

int op1=9;
int op2=10;

// 11th and 12th are for right motor

int op3=11;
int op4=12;

// relay for mop

int relay1=5;

//relay for pump

int relay2=6;

void setup() {
  // put your setup code here, to run once:
pinMode(op1,OUTPUT);
pinMode(op2,OUTPUT);
pinMode(op3,OUTPUT);
pinMode(op4,OUTPUT);
pinMode(relay1,OUTPUT);
pinMode(relay2,OUTPUT);
digitalWrite(op1,LOW);
digitalWrite(op2,LOW);
digitalWrite(op3,LOW);
digitalWrite(op4,LOW);
digitalWrite(relay1,LOW);
digitalWrite(relay2,LOW);
}

void forward()
{
  digitalWrite(op1,HIGH);
  digitalWrite(op2,LOW);
  digitalWrite(op3,HIGH);
  digitalWrite(op4,LOW);

}

void stop_robo()
{
  digitalWrite(op1,LOW);
  digitalWrite(op2,LOW);
  digitalWrite(op3,LOW);
  digitalWrite(op4,LOW);

}

void backward()
{
  digitalWrite(op1,LOW);
  digitalWrite(op2,HIGH);
  digitalWrite(op3,LOW);
  digitalWrite(op4,HIGH);

}

void left()
{
  digitalWrite(op1,HIGH);
  digitalWrite(op2,LOW);
  digitalWrite(op3,LOW);
  digitalWrite(op4,LOW);

}

void right()
{
  digitalWrite(op1,LOW);
  digitalWrite(op2,LOW);
  digitalWrite(op3,HIGH);
  digitalWrite(op4,LOW);

}

void pump_on()
{
  digitalWrite(relay2,HIGH);
  delay(3000);
  digitalWrite(relay2,LOW);
}

void clean()
{
  digitalWrite(relay1,HIGH);
  
}

void stop_clean()
{
  digitalWrite(relay1,LOW);
}

void start()
{
  pump_on();
  clean();
}

void loop() 
{
  start();
  forward();
  delay(3000);
  stop_clean();
  stop_robo();
  delay(1500);
}

Credits

Dr. Umesh Dutta

Dr. Umesh Dutta

38 projects • 53 followers
Working as Director of Innovation Centre at Manav Rachna, India. I am into development for the last 12 years.
Texas Instruments University Program

Texas Instruments University Program

91 projects • 119 followers
TI helps students discover what's possible to engineer their future.
Energia

Energia

34 projects • 26 followers
Founder of @energiaproject
devdutt

devdutt

10 projects • 9 followers
Robotic Gold Medalist at IIT Guwahati and Embedded,Hardware Developer at Manav Rachna Innovation and Incubation Centre

Comments