Eswar Chitirala
Published

Control Your Bot From Anywhere

IoT with your robot at one place and your phone another, both connected via internet.

BeginnerFull instructions provided2 hours419
Control Your Bot From Anywhere

Things used in this project

Hardware components

CC3200-LAUNCHXL SimpleLink CC3200 Wi-Fi LaunchPad
Texas Instruments CC3200-LAUNCHXL SimpleLink CC3200 Wi-Fi LaunchPad
×1
DC motor (generic)
×1
12V Battery(generic)
×1
Dual H-Bridge motor drivers L293D
Texas Instruments Dual H-Bridge motor drivers L293D
×1

Software apps and online services

Blynk
Blynk
Energia
Texas Instruments Energia
ip webcam

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Hardware connections

Hardware connections_2

Code

Complete Code

Arduino
#define LED1 RED_LED
#define LED2 GREEN_LED
#define LED3 YELLOW_LED

#define BLYNK_PRINT Serial//for blynk app to work
#include <SPI.h>//including spi library 
#include <WiFi.h>//including wifi library
#include <BlynkSimpleEnergiaWiFi.h>//including blynk header file

char auth[] = "your unique auth key ";//your auth key for blynk app
char ssid[] = "energia";//ssid name of hotspot created by your phone on-board
char pass[] = "supersecret";//password for the same

void setup() {
  
  pinMode(LED1,OUTPUT);
  pinMode(LED2,OUTPUT);
  pinMode(LED3,OUTPUT);
  
  digitalWrite(LED1, LOW);
  digitalWrite(LED2, LOW);
  digitalWrite(LED3, LOW);
  
  Serial.begin(9600);
  
  Blynk.begin(auth,ssid,pass);
}
//User defined functionality for virtual pins 
BLYNK_WRITE(V1)//Move left i.e. make right motor move
{ 
  
  BLYNK_LOG("Got a value: %s", param.asStr());
  int i = param.asInt(); 
  if(i == 1)
  {
    digitalWrite(LED1, HIGH);
    digitalWrite(LED3,LOW);
  }
  else if(i == 0)
  {
    digitalWrite(LED1, LOW);
  }
}

BLYNK_WRITE(V2)//Move right i.e. make left motor move
{ 
  BLYNK_LOG("Got a value: %s", param.asStr());
  int j = param.asInt(); 
  if(j == 1)
  {
    digitalWrite(LED2,HIGH);
    digitalWrite(LED3,LOW);
  }
  else if(j == 0)
  {
    digitalWrite(LED2, LOW);
  }
}

BLYNK_WRITE(V3)//Move Backwards
{
  BLYNK_LOG("Got a value: %s", param.asStr());
  int k = param.asInt(); 
  if(k == 1)
  {
    digitalWrite(LED1,LOW);
    digitalWrite(LED2,LOW);
    digitalWrite(LED3,HIGH);
  }
  else if(k == 0)
  {
    digitalWrite(LED3, LOW);
  }
}

void loop() {
  Blynk.run();  
}

Credits

Eswar Chitirala

Eswar Chitirala

0 projects • 0 followers
enthusiast, lifetime learner.

Comments

Add projectSign up / Login