RC car robot project

I am new to Arduino having little bit knowledge about it
I want to make a RC car using Arduino Uno , Bluetooth module HC-06 , Motor Driver module L-293D and robot car chassis and is control by Android app.
I try again again and again but i failed... please help me
Please help me in this project. I want to learn more about use of Arduino , it seems more more interesting!!!

I'm not an expert, but I'm trying to build one myself, so...
When you say you fail, what do you mean?
Do you get an error? Or does something go against what your expectations?

when i done all connection and upload program
dc motor shows no response and i don't know where is problem

posting your code would be a good starting point.

Here’s code:-

/CODE

//L293 Connection
const int motorA1 = 5;
const int motorA2 = 6;
const int motorB1 = 10;
const int motorB2 = 9;
//Leds connected to Arduino UNO Pin 12
const int lights = 12;
//Buzzer / Speaker to Arduino UNO Pin 3
const int buzzer = 3 ;
//Bluetooth (HC-06 JY-MCU) State pin on pin 2 of Arduino
const int BTState = 2;
//Calculate Battery Level
const float maxBattery = 8.0;// Change value to your max battery voltage level!
int perVolt; // Percentage variable
float voltage = 0.0; // Read battery voltage
int level;
// Use it to make a delay… without delay() function!
long previousMillis = -100010;// -100010=-10sec. to read the first value. If you use 0 then you will take the first value after 10sec.
long interval = 100010; // interval at which to read battery voltage, change it if you want! (101000=10sec)
unsigned long currentMillis; //unsigned long currentMillis;
//Useful Variables
int i=0;
int j=0;
int state;
int vSpeed=200; // Default speed, from 0 to 255

void setup() {
// Set pins as outputs:
pinMode(motorA1, OUTPUT);
pinMode(motorA2, OUTPUT);
pinMode(motorB1, OUTPUT);
pinMode(motorB2, OUTPUT);
pinMode(lights, OUTPUT);
pinMode(BTState, INPUT);
// Initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}

void loop() {
//Stop car when connection lost or bluetooth disconnected
if(digitalRead(BTState)==LOW) { state=‘S’; }

//Save income data to variable ‘state’
if(Serial.available() > 0){
state = Serial.read();
}

//Change speed if state is equal from 0 to 4. Values must be from 0 to 255 (PWM)
if (state == ‘0’){
vSpeed=0;}
else if (state == ‘1’){
vSpeed=100;}
else if (state == ‘2’){
vSpeed=180;}
else if (state == ‘3’){
vSpeed=200;}
else if (state == ‘4’){
vSpeed=255;}

/Forward*****/
//If state is equal with letter ‘F’, car will go forward!
if (state == ‘F’) {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 0);
}
/Forward Left**/
//If state is equal with letter ‘G’, car will go forward left
else if (state == ‘G’) {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, 200); analogWrite(motorB2, 0);
}
/Forward Right**/
//If state is equal with letter ‘I’, car will go forward right
else if (state == ‘I’) {
analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 200);
}
/Backward*****/
//If state is equal with letter ‘B’, car will go backward
else if (state == ‘B’) {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 0); analogWrite(motorB2, 0);
}
/Backward Left**/
//If state is equal with letter ‘H’, car will go backward left
else if (state == ‘H’) {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 200); analogWrite(motorB2, 0);
}
/Backward Right**/
//If state is equal with letter ‘J’, car will go backward right
else if (state == ‘J’) {
analogWrite(motorA1, 0); analogWrite(motorA2, vSpeed);
analogWrite(motorB1, 0); analogWrite(motorB2, 200);
}
/Left**/
//If state is equal with letter ‘L’, wheels will turn left
else if (state == ‘L’) {
analogWrite(motorA1, 0); analogWrite(motorA2, 0);
analogWrite(motorB1, 200); analogWrite(motorB2, 0);
}
/Right**/
//If state is equal with letter ‘R’, wheels will turn right
else if (state == ‘R’) {
analogWrite(motorA1, 0); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 200);
}
/Lights*****/
//If state is equal with letter ‘W’, turn leds on or of off
else if (state == ‘W’) {
if (i==0){
digitalWrite(lights, HIGH);
i=1;
}
else if (i==1){
digitalWrite(lights, LOW);
i=0;
}
state=‘n’;
}
/Horn sound*****/
//If state is equal with letter ‘V’, play (or stop) horn sound
else if (state == ‘V’){
if (j==0){
tone(buzzer, 1000);//Speaker on
j=1;
}
else if (j==1){
noTone(buzzer); //Speaker off
j=0;
}
state=‘n’;
}
/Stop*****/
//If state is equal with letter ‘S’, stop the car
else if (state == ‘S’){
analogWrite(motorA1, 0); analogWrite(motorA2, 0);
analogWrite(motorB1, 0); analogWrite(motorB2, 0);
}
/Battery******/
//Read battery voltage every 10sec.
currentMillis = millis();
if(currentMillis - (previousMillis) > (interval)) {
previousMillis = currentMillis;
//Read voltage from analog pin A0 and make calibration:
voltage = (analogRead(A0)*5.015 / 1024.0)11.132;
//Calculate percentage…
perVolt = (voltage
100)/ maxBattery;
if (perVolt<=75) { level=0; }
else if (perVolt>75 && perVolt<=80) { level=1; } // Battery level
else if (perVolt>80 && perVolt<=85) { level=2; } //Min ------------------------ Max
else if (perVolt>85 && perVolt<=90) { level=3; } // | 0 | 1 | 2 | 3 | 4 | 5 | >
else if (perVolt>90 && perVolt<=95) { level=4; } // ------------------------
else if (perVolt>95) { level=5; }
Serial.println(level);
}

}

/*CODE

First thing, we also need to know whats happening on the android end. What app are you using? Are you even receiving anything via bluetooth (have you monitored the serial rx from the bluetooth to make sure you're even receiving the data you want)?

Second, have you done a serial.print on all your variables (vSpeed, state, j, i) to make sure they're reading what you expect them too when you're operating your phone app?

it also looks as though you have no enable pins from the arduino to the l293 motor driver.

and instead of just writing "/code" you should use the code button to wrap your text.

also, instead of “int state;” you need “char state;”

cwhummel:
also, instead of "int state;" you need "char state;"

?

he was expecting capital letters over serial. putting them in int form only produces ascii values.

I tested it here:

cwhummel:
he was expecting capital letters over serial. putting them in int form only produces ascii values.

I tested it here:

https://123d.circuits.io/circuits/1909885-forum-help

?

what are you ? (not that it matters since this guy hasnt answered at all)

I'm the guy who is trying to understand what

he was expecting capital letters over serial. putting them in int form only produces ascii values

means

I'm just going off of what he has in his code. he has android app that supposedly is going to send something like "W" or "F" over bluetooth into the serial input. He was putting that into an int, which instead of "W" was producing "87". changing it to a char gives him the expected result.

He was putting that into an int, which instead of "W" was producing "87"

'W' has the value 0x57, decimal 87 whether it is represented in a char or an int.

I stand corrected. Was going off a similar issue I had on a project awhile back.