Arduino bluetooth hc-06 car

Hello there! So i m trying for 2 days to make this car run, but nothing happens. i ve tryed a lot of android apps to send data to the board but nothing. When i send data from the serial monitor works perfectly, but when i send it from android nothing happens. Can someoane help me plsss?
</>
char t;

void setup() {
pinMode(13,OUTPUT); //left motors forward
pinMode(12,OUTPUT); //left motors reverse
pinMode(11,OUTPUT); //right motors forward
pinMode(10,OUTPUT); //right motors reverse

Serial.begin(9600);

}

void loop() {
if(Serial.available()){
t = Serial.read();
Serial.println(t);
}

if(t == 'F'){ //move forward(all motors rotate in forward direction)
digitalWrite(13,HIGH);
digitalWrite(12,LOW);
digitalWrite(11,HIGH);
digitalWrite(10,LOW);
}

else if(t == 'B'){ //move reverse (all motors rotate in reverse direction)
digitalWrite(13,LOW);
digitalWrite(12,HIGH);
digitalWrite(11,LOW);
digitalWrite(10,HIGH);
}

else if(t == 'R'){ //turn right (left side motors rotate in forward direction, right side motors doesn't rotate)
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,HIGH);
digitalWrite(10,LOW);
}

else if(t == 'L'){ //turn left (right side motors rotate in forward direction, left side motors doesn't rotate)
digitalWrite(13,HIGH);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
}

else if(t == 'S'){ //STOP (all motors stop)
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
}
delay(100);
}
</>

Hi @adix1123

welcome to the arduino-forum.

please Re-edit your posting to have your code in a code-section

speeding up solving your problem.
I have encountered so many misunderstandings that I insist on everyone to post all relevant basic information that is nescessary to proceed fast

If you want to proceed slow post only short postings always waiting for an answer where the "answer" is just aksing back for another detail you left out trying to be fast. You should post information about:

  • exact type of microcontroller you are using
  • typenumbers and links todatasheets of all parts that are connected
  • no Fritzing picture !!
  • instead a handrawn schematic how things are wired together

best thing is to take 15 minutes of your time to read this guide

do yourself a favor and really read it!

best regards Stefan

This implies your code is kosher, and I assume the connection between HC-06 and Android is fine. That leaves two obvious possibilities:

  1. inadequate power, bearing in mind that, when connected to the serial monitor, you are also getting power from the PC, but you say nothing about power when trying to use Bluetooth.

  2. Improper connection of Bluetooth. Have you checked the connection Rx>Tx and Tx>Rx?

Is your bluetooth module getting paired with your mobile phone?

Yes

Probably the power is the problem but I ve tried to connect to 5v and 3.3v also and nothing works, but the Bluetooth adapter is connecting to the phone correctly

as a first step you should test the send/receive of the bluetooth module with a test-code that does nothing more than that.

You can go on with guessings for days, weeks, months. Please do yourself and us a favor to
speeding up solving your problem.
I have encountered so many misunderstandings that I insist on everyone to post all relevant basic information that is nescessary to proceed fast

If you want to proceed slow post only short postings always waiting for an answer where the "answer" is just aksing back for another detail you left out trying to be fast. You should post information about:

  • exact type of microcontroller you are using
  • typenumbers and links todatasheets of all parts that are connected
  • no Fritzing picture !!
  • instead a handrawn schematic how things are wired together

best thing is to take 15 minutes of your time to read this guide

do yourself a favor and really read it!

best regards Stefan

All that proves is that there is power to Bluetooth. It has nothing to do with Arduino, but I guess it does prove there is enough of it. What does have something to do with Arduino is how the signal pins are connected.

The power requirement should be very clearly stated on the Bluetooth breakout board - 3.6>6v. This rather suggests that leaning 3.3v against it is a waste of time.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.