Let's Make Robots!

track wheel set and twin motor gearbox

hi guys!i have my arduino and the motor shield. the robot is in picture:


The problem is: when i start the two motors, they go for a few moments and then they block, but i dont' know why. they should go costantly. help plz:)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Quick question. Does your arduino reset? If that is not the case then I would imagine we will need some more information. It may be something as simple as your code doesn't do what you think it should be doing.

This is the code:


#include <AFMotor.h>

AF_DCMotor motor2(2, MOTOR12_64KHZ);
AF_DCMotor motor1(1, MOTOR12_64KHZ);
char message=0;
int FOT1 = 5;
int FOT2 = 4;

// this vars will be used in the loop function
int FOTVal1 = 0;
int FOTVal2 = 0;
int DiffVal=0;

void setup(){

void loop(){
    FOTVal1 = analogRead(FOT1); 
    FOTVal2 = analogRead(FOT2);
    // print LDR values into the console
    Serial.print("Differenza val");
    if (DiffVal<=75){
    if (FOTVal1<FOTVal2){
    if (FOTVal2<FOTVal1){


I think the problem is the external power supply for the motor shield. What battery i should use? i need to supply the small DC motors of the tamiya twin motor gearbox.


  • Have you determined that it is not a code issue?
  • What power source are you using?
  • Is the same power being used for data and motors?
  • Are the treads too tight?
  • Gears full of dog-hair?
  • Batteries full?
  • Battery voltage high enough above your volt reg requirements?
  • Are you trying to drive your robot straight down like that? --I think it is going to fall off the wall.

I think the problem is the power supply for the shield. i need to supply two small DC motors of the tamiya twin motor gearbox. what kind of battery i have to use?

I have a feeling that as soon as your motors start, they suck just enough power to brown-out (and reset) your arduino. Yes, I think you need a second battery for your gearbox. Check this, but I think they are around 6v units --4 AA's would probably be just fine.

thanks i would try it:)

I am guessing about the need for a second supply --You have not yet told us what you are using now.

for the motor shield supply i used a 9v battery but the motors seem to go very slow. maybe the battery is spoiled?

The 9v battery can not supply the current you need. Try 4-6 AA's instead.

Thanks a lot guys! it works:)