I made a bluetooth RC car using the instructions on this link:
I followed all the steps however I am using an Arduino Uno instead of an Arduino Nano and i'm using 2 motors instead of 4. When I power up the car everything lights up and the bluetooth module connects to my phone. When the app is connected to the car the correct values on the serial monitor so i think its working. The only thing not working is the motors for the car. It wont drive. What should I do?
I made a bluetooth RC car using the instructions on this link:
I followed all the steps however I am using an Arduino Uno instead of an Arduino Nano and i'm using 2 motors instead of 4. When I power up the car everything lights up and the bluetooth module connects to my phone. When the app is connected to the car the correct values on the serial monitor so i think its working. The only thing not working is the motors for the car. It wont drive. What should I do?
Please read the "how to use this forum" above, especially how to include code and pictures.
You can upload your pictures e.g. to imgbb.com
and include the generated "BBCode full linked" in your post.
// Smartphone Controlled Arduino Robot
int izqA = 5;
int izqB = 6;
int derA = 9;
int derB = 10;
int vel = 255; // Velocidad de los motores (0-255)
int estado = 'g'; // inicia detenido
void setup() {
Serial.begin(9600); // inicia el puerto serial para comunicacion con el Bluetooth
pinMode(derA, OUTPUT);
pinMode(derB, OUTPUT);
pinMode(izqA, OUTPUT);
pinMode(izqB, OUTPUT);
}
void loop() {
if(Serial.available()>0){ // lee el bluetooth y almacena en estado
estado = Serial.read();
}
if(estado=='a'){ // Forward
Serial.println(estado);
analogWrite(derB, 0);
analogWrite(izqB, 0);
analogWrite(derA, vel);
analogWrite(izqA, vel);
}
if(estado=='d'){ // right
Serial.println(estado);
analogWrite(derB, vel);
analogWrite(izqB, 0);
analogWrite(derA, 0);
analogWrite(izqA, vel);
}
if(estado=='c'){ // Stop
Serial.println(estado);
analogWrite(derB, 0);
analogWrite(izqB, 0);
analogWrite(derA, 0);
analogWrite(izqA, 0);
}
if(estado=='b'){ // left
Serial.println(estado);
analogWrite(derB, 0);
analogWrite(izqB, vel);
analogWrite(izqA, 0);
analogWrite(derA, vel);
}
if(estado=='e'){ // Reverse
Serial.println(estado);
analogWrite(derA, 0);
analogWrite(izqA, 0);
analogWrite(derB, vel);
analogWrite(izqB, vel);
}
if (estado =='f'){ // Boton ON se mueve sensando distancia
}
if (estado=='g'){ // Boton OFF, detiene los motores no hace nada
}
}
You need to make a simple pencil drawing showing how everything is connected and post a photo of the drawing. It is too easy to make a mistake when trying to figure out the connections from photos of the hardware.
A Nano is just a small version of an Uno so there should be no difficulty using an Uno.
It looks as if you are trying to power stuff from a 9v PP3 style battery. They are completely useless as they can't provide enough current. Use a pack of 6 x AA alkaline cells
GND -> Connect Battery Black wire and Arduino GND pin
5V -> Connect to Arduino 5V pin
Does it matter what pins I used to connect my H Bridge ( LM 298 Module ) to? I read somewhere that for each motor one of the pins needs to be PWM and the other needs to be digital. Also, does it matter what kind of Double AA batteries I use?
As well as all the above, appears the motor is directly connected to the wheel which will never work successfully.
Some gear reduction unit would be required here.
frasheed:
So I need to get a gear motor to make it work? I can't use the motor I have to make it run?
No, that's why I brought it up.
Those motors are designed to run at maybe 3,000 to 6,000 rpm and you have it connected to a wheel of possibly 40mm diameter.
Motor will simply stall and draw wacks of current.
You still didn't say what the Arduino was supposed to be doing either.
Speaking personally I would feel a great deal more confident giving advice if you present a diagram of the connections rather than a verbal description. To make sense of your verbal description I would need to make a diagram and I am not at all confident that my digram would be the same as the one you would make.
In my experience the process of drawing the diagram can often bring anomalies to light.
Simple test - take the wheels off, hold the chassis in the air so the motor spindles aren't touching anything and use the 6 x AA batteries NOT the useless little 9V battery. Try it and see if the motors will spin. If not either your connections or the code are wrong.
If they do spin then there's nothing wrong except that those motors (which are nothing like the ones used in the instructable that you say you "followed") are completely wrong for what you're trying to do with them.