Introduction: Accelerometer Bluetooth Controlled Mini Car

About: I am a tech savy guys and I love electronics and Arduino. These enable a new world to me. Imagination is more important than knowledge to me.I wish to post instructables and use my imagination for further deve…

Hi Folks,

I just recently entered into the world of arduino and its amazing open source programming and developing.So i decided to make a cool accelerometer controlled Bluetooth mini car . This Sounds amazing but the concept is simple it is controlled by your android device (uses accelerometer and gyro sensor) via Bluetooth. So let's make it! and i call this mini bot as spoke runner.


EDIT: NOW IT CAN BE HAND CONTROLLED!

Step 1: What Are the Required Parts?

Now , that's really simple and quite low expensive materials you can get easily on eBay, dealxtreme,etc...

Electronics:

2x 500 rpm geared dc motors (minimum 100 rpm.)

1x Hc-05(The cheap bluetooth module available for arduino.)

1x Arduino Uno R3

1x L293D IC (Or the h bridge driver will do.)

1x mini breadboard.

Get some bunch of jumper wires.

Some 2-way tape required .

Get a base for you mini car! ;)

1x LED

1x 9v clip and battery.

Skills required:

Its nothing but to:

know how to use the Arduino board.(Don't worry about the codes . i will provide them ;) )

know how to use breadboard.

Step 2: Getting Started With Concepts....(The Schematic)

The concepts are very simple or to say really simple and cool for spoke runner.

I believe that concepts must be clear and concepts are very important in life so i have also included a white board schematic.

What we do here is just connect the two dc motors to the L293d IC or to the H bridge driver so that we can make motors to spin both the ways we want ie..Clockwise and anti-clockwise.

The H bridge sends 4 pins to arduino ie..2 pin for each motor. To make this car run we require a transmitter (tx) but here we wont use a transmitter but we will use our android device as our transmitter and connect it to our car via the HC-05 module (via bluetooth basically).

Many people make these mistakes but be sure that you connect HC-05 Tx to arduino RX and HC-05 RX to arduino TX.

Note:In the breadboard the fritzing didnt have power rails so i took the first one from above as positive and the second from above as negative in the mini breadboard

Step 3: Take You IC Into Some Action...

So now nothing but just wire u the L293D Ic either on a mini breadboard or on a PCB . If you dont know how to use the L293D IC then visit my another instructable "Working with H bridge" .This will guide you through how to wire the IC and stuff.IF You have the H bridge then skip this step and proceed.

Step 4: Code It Up!

As i promised you before , I will provide you the code and yes don't forget to change the baud rate according to your HC-05 module's baud rate the default baud rate is 9600, but mine was 38400, so i had to change it and i recommend you all to go through the comments in the code.

The code:


// This Code is developed by Hemanth Krishna for educational
purposes only.

// Spoke Runner.

int M1P1 = 10; // Declaring all variables for the L293D Ic pins.

int M1P2 = 11;

int M2P1 = 5;

int M2P2 = 6;

int LED = 3; // A LED pin declaring.

void setup() {

// put your setup code here, to run once:

pinMode(M1P1, OUTPUT);// Setting the pin as output for all pins.

pinMode(M2P1, OUTPUT);

pinMode(M1P2, OUTPUT);

pinMode(M2P2, OUTPUT);

pinMode(LED, OUTPUT);

Serial.begin(38400);// Begins the serial communication at 38400 baud, but the default is 9600 baud.

// Change the baud rate according to yours.

}

void loop() {

// put your main code here, to run repeatedly:

if (Serial.available()); // We command the arduino that if there is a some command incoming.

char val = Serial.read(); // Then store the incoming command into the char 'val'

digitalWrite(LED, HIGH);

if (val == '1') { // If the command is 1 then do this.(the below command.)

digitalWrite(M1P1, HIGH);

digitalWrite(M2P1, HIGH);

digitalWrite(M1P2, LOW);

digitalWrite(M2P2, LOW);

delay(200);

digitalWrite(M1P1, LOW);

digitalWrite(M2P1, LOW);

Serial.println('Forward'); // GO Forward

}

if (val == '2') {//If the command is 2 then do this.(the below command.)

digitalWrite(M1P1, HIGH);

digitalWrite(M2P1, LOW);

digitalWrite(M1P2, LOW);

digitalWrite(M2P2, LOW);

delay(200);

digitalWrite(M1P1, LOW);

Serial.println('Left'); // GO Left

}

if (val == '3' ) {//If the command is 3 then do this.(the below command.)

digitalWrite(M2P1, HIGH);

digitalWrite(M1P1, LOW);

digitalWrite(M2P2, LOW);

digitalWrite(M1P2, LOW);

delay(200);

digitalWrite(M2P1, LOW);

Serial.println('Right'); // GO Right

}

if (val == '4' ) { //If the command is 4 then do this.(the below command.)

digitalWrite(M1P2, HIGH);

digitalWrite(M2P2, HIGH);

digitalWrite(M1P1, LOW);

digitalWrite(M2P1, LOW);

delay(200);

digitalWrite(M1P2, LOW);

digitalWrite(M2P2, LOW);

Serial.println('Backward'); // GO Backward

}

if (val == 's') { //If the command is s then do this.(the below command.)

digitalWrite(M1P1, LOW);

digitalWrite(M1P2, LOW);

digitalWrite(M2P1, LOW);

digitalWrite(M1P2, LOW);

Serial.println('Stop!'); // STOP

}

}

So now i suppose , we are ready to go and lets proceed!

Step 5: Spoke Runner Assemble!

I just assembled it just simply and i also included a motor guard which you can see using a cardboard so that my motor doesn't get damaged in any way . Designing the body is all you choice , your creativity , your work and stuff but i just made spoke runner simple.

Step 6: The Android Device ...

Go and download the app ArduinoRC this is a real cool app from Estacado's ltd. This app is really great and simple to use and setup is awesome

Steps for installation:

1. Go to the app and click proceed.

2.Then select your Hc-05 device Make sure your arduino is turned on.

3.Then select vehicle mode once it is successfully connected.

4.Then you press your menu button./settings button.

5.Then you set your commands as per the picture.

Gesture_Front= 1

Gesture_Left= 2

Gesture_right= 3

Gesture_Back= 4

stop_button= s

6. Go back .

7.Now Enjoy!

Step 7: Let Us Make It Hand Controlled!!

Creativity always welcome!

We are going to make spoke runner hand controlled!

What you need is:

1x rubber band

your device

1x tissue paper

Your hand.

Just wrap your device to your hand using your rubber band and tissue to protect your devices screen.

Make sure you keep you device horizontal.

Now we are ready to go!

Step 8: Thats All Folks!

So now I hope you have made your own accelerometer mini car. So enjoy guys, and if any problems persists just leave a comment i will try to resolve it . I will assure you that i will posts more interesting instructables. I am joining for the mind for design contest and move it contest. So if you really like this instructable just Vote for me

Thanks for reading !!

Mind for Design

Participated in the
Mind for Design

Move It

Participated in the
Move It