Ali Soomar
Published

Internet-controlled RC Car

A cool RC Car that you can control with the touch of your fingers right from your own phone.

BeginnerShowcase (no instructions)1 hour1,882
Internet-controlled RC Car

Things used in this project

Hardware components

MSP-EXP430F5529LP MSP430 LaunchPad
Texas Instruments MSP-EXP430F5529LP MSP430 LaunchPad
×1
CC3100BOOST SimpleLink CC3100 Wi-Fi BoosterPack
Texas Instruments CC3100BOOST SimpleLink CC3100 Wi-Fi BoosterPack
×1
Jumper wires (generic)
Jumper wires (generic)
×1
AA Batteries
AA Batteries
×1
Breadboard (generic)
Breadboard (generic)
×1
Dual H-Bridge motor drivers L293D
Texas Instruments Dual H-Bridge motor drivers L293D
×1
4xAA battery holder
4xAA battery holder
×1

Software apps and online services

Code Composer Studio
Texas Instruments Code Composer Studio
Energia
Texas Instruments Energia
Alternative
Blynk
Blynk

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Code

RC Car Program

C/C++
#define BLYNK_PRINT Serial    
#include <SPI.h>
#include <WiFi.h>
#include <BlynkSimpleEnergiaWiFi.h>

//Obtain your Authentication Token from the Blynk app
char auth[] = "Authentication"  ;    

// Your WiFi credentials
char ssid[] = "WiFi Name";          
char pass[] = "WiFi Password";      // Set to "" for open networks

void setup() {
  // put your setup code here, to run once:
  analogReadResolution(12);
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

  pinMode(29, OUTPUT); //MOTOR 1
  pinMode(30, OUTPUT);

  pinMode(32, OUTPUT); //MOTOR 2
  pinMode(31, OUTPUT); 
}

BLYNK_WRITE(V0)//FORWARD
{
  //Print to the terminal
  BLYNK_LOG("Got a value: %s", param.asStr());
  
  int i = param.asInt(); 
  if(i == 1)
  {
   digitalWrite(29, HIGH);
   digitalWrite(30, LOW); //LEFT MOTOR GOES FORWARD

   digitalWrite(32, HIGH);
   digitalWrite(31, LOW); //RIGHT MOTOR GOES FORWARD
  }
  else if(i == 0)
  {
   digitalWrite(29, LOW);
   digitalWrite(30, LOW); //LEFT MOTOR STOPS

   digitalWrite(32, LOW);
   digitalWrite(31, LOW); //RIGHT MOTOR STOPS
  }
}

BLYNK_WRITE(V1)//TURN RIGHT
{
  //Print to the terminal
  BLYNK_LOG("Got a value: %s", param.asStr());
  
  int n = param.asInt(); 
  if(n == 1)
  {
   digitalWrite(29, HIGH);
   digitalWrite(30, LOW); //LEFT MOTOR GOES FORWARD

   digitalWrite(32, LOW);
   digitalWrite(31, HIGH); //RIGHT MOTOR GOES BACKWARDS
  }
  else if(n == 0)
  {
   digitalWrite(29, LOW);
   digitalWrite(30, LOW); //LEFT MOTOR STOPS

   digitalWrite(32, LOW);
   digitalWrite(31, LOW); //RIGHT MOTOR STOPS
  }
}

BLYNK_WRITE(V2)//BACKWARDS
{
  //Print to the terminal
  BLYNK_LOG("Got a value: %s", param.asStr());
  
  int m = param.asInt(); 
  if(m == 1)
  {
   digitalWrite(29, LOW);
   digitalWrite(30, HIGH); //LEFT MOTOR GOES BACKWARDS

   digitalWrite(32, LOW);
   digitalWrite(31, HIGH); //RIGHT MOTOR GOES BACKWARDS
  }
  else if(m == 0)
  {
   digitalWrite(29, LOW);
   digitalWrite(30, LOW); //LEFT MOTOR STOPS

   digitalWrite(32, LOW);
   digitalWrite(31, LOW); //RIGHT MOTOR STOPS
  }
}

BLYNK_WRITE(V3)//TURN LEFT
{
  //Print to the terminal
  BLYNK_LOG("Got a value: %s", param.asStr());
  
  int x = param.asInt(); 
  if(x == 1)
  {
   digitalWrite(29, LOW);
   digitalWrite(30, HIGH); //LEFT MOTOR GOES BACKWARDS

   digitalWrite(32, HIGH);
   digitalWrite(31, LOW); //RIGHT MOTOR GOES FORWARD
  }
  else if(x == 0)
  {
   digitalWrite(29, LOW);
   digitalWrite(30, LOW); //LEFT MOTOR STOPS

   digitalWrite(32, LOW);
   digitalWrite(31, LOW); //RIGHT MOTOR STOPS
  }
}

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

Credits

Ali Soomar

Ali Soomar

11 projects • 36 followers
Student at the University of Texas at Austin

Comments

Add projectSign up / Login