Pages: [1]   Go Down
Author Topic: Problem with Motor Shield v3 and Tamiya Tank Gearbox  (Read 1590 times)
0 Members and 1 Guest are viewing this topic.
Istanbul,Turkey
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello everyone.

i have a problem with my arduino based bluetooth controlled tank.
when i press a key to start the motors, arduino resets and tank doesn't move at all.

i've bought a tamiya tank kit at my local robotics shop and it comes with the motor gearbox like this one:



i also bought a motor shield (http://arduino.cc/it/Main/ArduinoMotorShieldR3) to operate the gearbox.

i've already got this bt module for arduino, and i used it with another projects without any problems.
so i know that my problem isn't related with the bt module.



i use a 7.4 li-po battery connected to the vin and ground connections on the motor shield.
my arduino code is like this:
Code:
#define A_direction 12
#define B_direction 13
#define A_speed 3
#define B_speed 11
#define A_brake 9
#define B_brake 8
int speed = 150;

void setup()
{
  pinMode(A_direction,OUTPUT);
  pinMode(B_direction,OUTPUT);
  pinMode(A_speed,OUTPUT);
  pinMode(B_speed,OUTPUT);
  pinMode(A_brake,OUTPUT);
  pinMode(B_brake,OUTPUT);
  Serial.begin(9600);
  Serial.println("Use numpad keys to operate the tank");
  Serial.println("Use numpad key 0 to stop the tank");
}

void loop()
{
  if (Serial.available() > 0)
  {
   
    int data = Serial.read();
    switch (data)
    {
      case '8' :
      digitalWrite(A_direction,HIGH);
      digitalWrite(B_direction,HIGH);
      digitalWrite(A_brake,LOW);
      digitalWrite(B_brake,LOW);
      analogWrite(A_speed,speed);
      analogWrite(B_speed,speed);
      Serial.println("N");
      break;
     
      case '2' :
      digitalWrite(A_direction,LOW);
      digitalWrite(B_direction,LOW);
      digitalWrite(A_brake,LOW);
      digitalWrite(B_brake,LOW);
      analogWrite(A_speed,speed);
      analogWrite(B_speed,speed);
      Serial.println("S");
      break;
     
      case '4' :
      digitalWrite(A_direction,LOW);
      digitalWrite(B_direction,HIGH);
      digitalWrite(A_brake,LOW);
      digitalWrite(B_brake,LOW);
      analogWrite(A_speed,speed);
      analogWrite(B_speed,speed);
      Serial.println("W");
      break;
     
      case '6' :
      digitalWrite(A_direction,HIGH);
      digitalWrite(B_direction,LOW);
      digitalWrite(A_brake,LOW);
      digitalWrite(B_brake,LOW);
      analogWrite(A_speed,speed);
      analogWrite(B_speed,speed);
      Serial.println("E");
      break;
     
      case '0' :
      digitalWrite(A_direction,LOW);
      digitalWrite(B_direction,LOW);
      digitalWrite(A_brake,HIGH);
      digitalWrite(B_brake,HIGH);
      analogWrite(A_speed,0);
      analogWrite(B_speed,0);
      Serial.println("Stop!");
      break;
     
      default:
      digitalWrite(A_direction,LOW);
      digitalWrite(B_direction,LOW);
      digitalWrite(A_brake,HIGH);
      digitalWrite(B_brake,HIGH);
      analogWrite(A_speed,0);
      analogWrite(B_speed,0);
      break;     
  }
 }
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First make sure your battery has a full charge. However, note that the standard motors that come with tamiya gearboxes are rated for 3 volts, it is possible that you will burn out the motors.

Logged

Istanbul,Turkey
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i don't think that the problem is related with motors.
btw, i forgot to mention that when the usb cable is plugged, i don't have any problems at all.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i don't think that the problem is related with motors.
btw, i forgot to mention that when the usb cable is plugged, i don't have any problems at all.

Ok, to me that indicates a power issue, as in your battery needs a better charge. Maybe toss 4 AAs at it if you have some, just to verify.

Logged

Istanbul,Turkey
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

nope. before i switched to li-po i used 4 AA batteries. did the same.
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 11
Posts: 1309
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


 You are better off with separate power for the Arduino. To make it easy, I use a 9volt for the Arduino and I have a 4 cell pack for my motor driver. The main point is to have one battery supply for the Arduino, and one supply for the motors.
Logged


Pages: [1]   Go Up
Jump to: