Project showcase
CARMAGEDDON: The Agile Arduino Car

CARMAGEDDON: The Agile Arduino Car © CC BY-NC-SA

A simple and easy to assemble car controlled via smartphone using bluetooth technology.

  • 4,981 views
  • 12 comments
  • 9 respects

Components and supplies

Apps and online services

About this project

Since I was a kid I have always wanted a RC car. Unfortunately, for many reasons, I have never got one. So, one day, I decided to make one all by myself.

I thought it would have been better if I had controlled it directly with my smartphone and if it had been simple, without any camera or sensor. I did not want to make it too fancy, I just wanted something that you can turn on, make it going around an have fun with it.

I ended up making, in my opinion, one of the best demonstration of how easy and satisfying is creating something with Arduino. Without almost any effort, everyone can replicate this project and start learning Arduino.

And that's how it works!

Code

Carmageddon's Head.inoC/C++
char command;                  
int const directionA = 12;		   
int const directionB = 13;
int const speedA = 3;		                    //A is the left wheel, B is the right one
int const speedB = 11;
int const brakeA = 9;			   
int const brakeB = 8;
bool flagBackward;

void setup() {
  Serial.begin(9600);          
  pinMode(directionA, OUTPUT);
  pinMode(directionB, OUTPUT);
  pinMode(speedA, OUTPUT);             
  pinMode(speedB, OUTPUT);
  pinMode(brakeA, OUTPUT);
  pinMode(brakeB, OUTPUT);
}

void loop() {

  if (Serial.available() > 0) {             

    command = Serial.read();                 

    switch (command) {
      case ('='):                                //stop command
        flagBackward = false;
        analogWrite(speedA, 0);
        analogWrite(speedB, 0);
        digitalWrite(brakeA, HIGH);
        digitalWrite(brakeB, HIGH);
        break;

      case ('F'):                               //forward command
        flagBackward = false;
        digitalWrite(brakeA, LOW);	   
        digitalWrite(brakeB, LOW);
        digitalWrite(directionA, LOW);	
        digitalWrite(directionB, LOW);
        analogWrite(speedA, 255);
        analogWrite(speedB, 255);
        break;

      case ('B'):                               //backward command
        flagBackward = true;
        digitalWrite(brakeA, LOW);
        digitalWrite(brakeB, LOW);
        digitalWrite(directionA, HIGH);
        digitalWrite(directionB, HIGH);
        analogWrite(speedA, 255);
        analogWrite(speedB, 255);
        break;

      case ('R'):                               //right command
        digitalWrite(brakeA, LOW);
        digitalWrite(brakeB, HIGH);
        if (flagBackward == false) {
          digitalWrite(directionA, LOW);
        } else {
          digitalWrite(directionA, HIGH);
        }
        digitalWrite(directionB, HIGH);
        analogWrite(speedA, 255);
        analogWrite(speedB, 0);
        break;

      case ('L'):                               //left command
        digitalWrite(brakeA, HIGH);
        digitalWrite(brakeB, LOW);
        digitalWrite(directionA, HIGH);
        if (flagBackward == false) {
          digitalWrite(directionB, LOW);
        } else {
          digitalWrite(directionB, HIGH);
        }
        analogWrite(speedA, 0);
        analogWrite(speedB, 255);
        break;

    }
  }
}

Schematics

Carmageddon's Body.fzz
carmageddons_body_zbcGzzBfPA.fzz

Comments

Similar projects you might like

Smartphone Controlled Arduino 4WD Robot Car

Project in progress by Andriy Baranov

  • 53,419 views
  • 43 comments
  • 99 respects

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 12,850 views
  • 2 comments
  • 15 respects

Robotic Car controlledover Bluetooth with Obstacle Avoidance

Project showcase by S.Ranjith Reddy

  • 9,582 views
  • 5 comments
  • 17 respects

Jrobot - Android and Arduino-Based Global Control Robot Car

Project showcase by joechen

  • 5,662 views
  • 4 comments
  • 20 respects

Android Apps Controlled Arduino Robot Car

by Team platinum

  • 3,597 views
  • 0 comments
  • 16 respects

Bluetooth Controlled Car

Project tutorial by JANAK13

  • 2,294 views
  • 7 comments
  • 15 respects
Add projectSign up / Login