Arduino – Control a DC motor with TIP120, potentiometer and multiple power suppl

How to modify this circuit to drive 2 DC motors?
http://luckylarry.co.uk/arduino-projects/arduino-control-a-dc-motor-with-potentiometer-and-multiple-power-supplies/comment-page-1/#comment-6235
Do I have to make a exact same circuit for the 2nd motor or can i merge it in this one?
I am making a R/C car and want to controll the speed of motor by the pot.
Any Help is appreciated. :smiley: :slight_smile:
Regards,
Shubham

The circuit you have posted above will only drive the motor in one direction.

If all you want is something that drives straight, that circuit will be fine and you don't need two motors, one will work.

If, as I suspect, you want something a little more interesting than that I do not think that circuit will work for you.

You will need separate circuits for each motor assuming you want them to be able to do two different things, which again I'm assuming you do.

I would read this as I think it might be more apropos. http://itp.nyu.edu/physcomp/Labs/DCMotorControl

Do you plan on steering like a car or like a tank?

The circuit you have posted above will only drive the motor in one direction.

It could drive two motors (or more), but not independently.
It isn't clear from the OP what is required.

I would read this as I think it might be more apropos. http://itp.nyu.edu/physcomp/Labs/DCMotorControl

I have made this circuit, the problem is speed of motor can not be controlled and also i want to drive motor in both direction.
The code has to be modified to drive in both direction but how?

Regards,
Shubham

the problem is speed of motor can not be controlled

You've done something wrong then.

The code has to be modified to drive in both direction but how?

What code?

It is not enough to modify the code to drive the motors in both directions.

You should use a H bridge for each motor.

Just google Arduino + H bridge there are tons of examples on how to do it.

@ AWOL and MikMo

the problem is speed of motor can not be controlled
You've done something wrong then.

speed of motor can not be controlled using a h-bridge coz it's just on/off, if I'm wrong plz let me know.

The code has to be modified to drive in both direction but how?
What code?

int potPin = 0;                           // Analog pin 0 connected to the potentiometer
int transistorPin = 9;                  // connected from digital pin 9 to the base of the transistor
int potValue = 0;                       // value returned from the potentiometer
void setup() {                          // set  the transistor pin as an output
  pinMode(transistorPin, OUTPUT);
}
void loop() {                           // read the potentiometer, convert it to between 0 - 255 for the value accepted by the digital pin.
  potValue = analogRead(potPin) / 4;    // potValue alters the supply from pin 9 which in turn controls the power running through the transistor
  analogWrite(9, potValue);
}

code from http://luckylarry.co.uk/arduino-projects/arduino-control-a-dc-motor-with-potentiometer-and-multiple-power-supplies/comment-page-1/#comment-6235

I was guessing that can I use three pots,
2 will control the direction of two motors(actually a joystick)
1 will control the speed.

speed of motor can not be controlled using a h-bridge coz it's just on/off,

And PWM isn't just on/off?

so, we can use h-bridge to control speed?

Yes.
And braking or free-running stop.

does this work
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1172437164

Does the link work?
Yes.

Don't know about the tutorial - I can't read those cutesy "circuit diagrams", and I saw they used a 9V battery, so stopped at that point.