Remote car

I am building a two wheels car that is controlled by my smart phone using bluetooth module and i power this project by 9V battery my proplem is when i power it only arduino and motor driver work while the bluetooth module and the motor does not work i tested every part Separately and every part worked but when i mix them all they do not work does this mean that the voltage is not enough or is this because something wrong in the code but i do trust it is about the voltage as my 9V battery died after i had done few Experiences so i hopr you can help me

this is my code:

DIY Simple Arduino Bluetooth Controlled Robot Car Coder - Mayoogh Girish Website - http://mgprojecthub.com/ Download the App : */

char data = 0; //Variable for storing data

int RMA = 8; int RMB = 9; int LMA = 10; int LMB = 11;

void setup() { Serial.begin(9600); //Sets the data rate in bits per second (baud) for serial data transmission pinMode(8, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); } void loop() { if (Serial.available() > 0) { data = Serial.read(); //Read the incoming data and store it into variable data Serial.print(data); //Print Value of data in Serial monitor Serial.print("\n"); //New line

if (data == 'S') stop_();

else if (data == 'F') forward_();

else if (data == 'B') backward_();

else if (data == 'L') left_180();

else if (data == 'R') right_180();

else if (data == 'G') forwardLeft();

else if (data == 'I') forwardRight();

else if (data == 'H') backwardLeft();

else if (data == 'J') backwardRight(); } }

void stop_() { Serial.print("STOP"); digitalWrite(LMA, LOW); digitalWrite(LMB, LOW); digitalWrite(RMA, LOW); digitalWrite(RMB, LOW); }

void forward_() { Serial.print("FORWARD"); digitalWrite(LMA, HIGH); digitalWrite(LMB, LOW); digitalWrite(RMA, HIGH); digitalWrite(RMB, LOW); }

void backward_() { Serial.print("BACKWARD"); digitalWrite(LMA, LOW); digitalWrite(LMB, HIGH); digitalWrite(RMA, LOW); digitalWrite(RMB, HIGH); }

void left_180() { Serial.print("LEFT 180"); digitalWrite(LMA, LOW); digitalWrite(LMB, HIGH); digitalWrite(RMA, HIGH); digitalWrite(RMB, LOW); }

void right_180() { Serial.print("RIGHT 180"); digitalWrite(LMA, HIGH); digitalWrite(LMB, LOW); digitalWrite(RMA, LOW); digitalWrite(RMB, HIGH); }

void forwardLeft() { Serial.print("FORWARD - LEFT"); digitalWrite(LMA, LOW); digitalWrite(LMB, LOW); digitalWrite(RMA, HIGH); digitalWrite(RMB, LOW); }

void forwardRight() { Serial.print("FORWARD - RIGHT"); digitalWrite(LMA, HIGH); digitalWrite(LMB, LOW); digitalWrite(RMA, LOW); digitalWrite(RMB, LOW); }

void backwardLeft() { Serial.print("BACKWARD - LEFT"); digitalWrite(LMA, LO digitalWrite(LMB, LOW); digitalWrite(RMA, LOW); digitalWrite(RMB, HIGH); }

void backwardRight() { Serial.print("BACKWARD - RIGHT"); digitalWrite(LMA, LOW); digitalWrite(LMB, HIGH); digitalWrite(RMA, LOW); digitalWrite(RMB, LOW); }

Welcome to the Forum. It isn't good Karma to hijack someone else's post. Start by reading the stickies at the top of every section which tell you how to post on the forum and what information to provide. This will help others to help you get the answer you need. |500x238 In particular make sure that your code is inside code tags. You can edit a post to include them. If the code is too big attach it as a file or create a smaller code that is able to compile and incudes the problem (do not use snippets). |500x135

This question seems to be hardware related. Please post a complete schematic diagram showing exactly what components you have used, and exactly how they are connected together.

i power this project by 9V battery

I think you may have answered your own question.

@moaaz11

TOPIC SPLIT
PLEASE DO NOT HIJACK / NECRO POST !

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

As you seem to have a problem understanding the forum rules I am giving you a 48 hour timeout to catch up by using the links above.
Use the time wisely.

Please don't PM me copies of your original post, I can see it here where you have not followed the advice given. Read the guidelines as previously advised.

Ban extended to LOGIN to prevent unwanted PM's