Remote Control bot

Remote Control bot © GPL3+

BLYNK app based remote used to control a bot.

  • 1,036 views
  • 0 comments
  • 1 respect

Components and supplies

Apps and online services

About this project

RC Drive

The project in the video above is to use an application called BLYNK to make a remote and connect it to the wifi module NodeMCU(esp8266). The input is provided manually by the user through the remote made on the app and the input would be received by the wifi module and passed on to the arduino(uno).The reason why arduino is used here is because it can provide +5v output which the nodeMCU cannot. The +5v is necessary in order to drive the motors by using the motor driver.The code below also contains the way in which the turns, forward and backward motion is performed.In case of multiple input firing, the code has been made in such a way that there is priority of the motion i.e:

  • FORWARD(Highest Priority)
  • REVERSE
  • LEFT
  • RIGHT(Least Priority)

If left and right buttons on the remote are pressed simultaneously then based on this priority list the code would perform the particular motion.The priority order can be easily modified based on the situation.

Also in order to make the bot more responsive the code contains complete stopping condition after every motion(clearstate() function) and till the state of the input does not change the bot would be in previous input state(while loops have been used).

Code

RemoteC/C++
This code is for the wifi module
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "6579f12f9e124f8f9fd0a3d2b3dae236";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "8085";
char pass[] = "boobnoob";
void setup(){
  Blynk.begin(auth, ssid, pass);
  pinMode(D0,OUTPUT);
  pinMode(D1,OUTPUT);
  pinMode(D2,OUTPUT);
  pinMode(D3,OUTPUT);
  Serial.println(9600);
}
void loop(){
 Serial.println(digitalRead(D0));
 Serial.println(digitalRead(D1));
 Serial.println(digitalRead(D2));
 Serial.println(digitalRead(D3));
 Blynk.run();
}
Arduino car codeC/C++
The code for driving the motors based on input.
byte fw=2,bw=3,lt=4,rt=5;
byte la=8,lb=9,ra=10,rb=11;
byte f=0,r=0,l=0,b=0,state=0;
void setup() {
  pinMode(fw,INPUT);
  pinMode(bw,INPUT);
  pinMode(lt,INPUT);
  pinMode(rt,INPUT);
  pinMode(lb,OUTPUT);
  pinMode(la,OUTPUT);
  pinMode(ra,OUTPUT);
  pinMode(rb,OUTPUT);
  Serial.begin(9600);
}
byte reader(){
 f=0;
 r=0;
 l=0;
 b=0;
 f=digitalRead(fw);
 if(f==1)
 {
  Serial.println("out1");
  return 10;
 }
 b=digitalRead(bw);
 if(b==1)
 {
  Serial.println("out2");
  return 20;
 }
 l=digitalRead(lt);
 if(l==1)
 {
  Serial.println("out3");
  return 30;
 }
 r=digitalRead(rt);
 if(r==1)
 {
  Serial.println("out4");
  return 40;
 }
 return 0;
}
void clearstate()
{
 digitalWrite(ra,0);
 digitalWrite(rb,0);
 digitalWrite(la,0);
 digitalWrite(lb,0); 
}
void loop(){
  state=reader();
  while(state==10)
  {
    digitalWrite(la,1);
    digitalWrite(lb,0);
    digitalWrite(ra,1);
    digitalWrite(rb,0);
    state=reader();
  }
  clearstate();
  while(state==20)
  {
    digitalWrite(la,0);
    digitalWrite(lb,1);
    digitalWrite(ra,0);
    digitalWrite(rb,1);
    state=reader();
  }
  clearstate();
  while(state==30)
  {
    digitalWrite(la,0);
    digitalWrite(lb,1);
    digitalWrite(ra,1);
    digitalWrite(rb,0);
    state=reader();
  }
  clearstate();
  while(state==40)
  {
    digitalWrite(la,1);
    digitalWrite(lb,0);
    digitalWrite(ra,0);
    digitalWrite(rb,1);
    state=reader();
  }
  clearstate();  
}

Comments

Similar projects you might like

Servo Control with TV Remote Control

Project showcase by eldo85

  • 5,618 views
  • 5 comments
  • 17 respects

Control an LED with the Remote Control

Project showcase by Nicholas_N

  • 3,315 views
  • 2 comments
  • 9 respects

B·Day Bot - Remote control

Project in progress by Julio Vazquez

  • 1,112 views
  • 1 comment
  • 11 respects

Remote Control Gripper Bot

Project tutorial by Scott Beasley

  • 4,845 views
  • 8 comments
  • 15 respects
Add projectSign up / Login