Go Down

Topic: Arduino – Control a DC motor with TIP120, potentiometer and multiple power suppl (Read 3341 times) previous topic - next topic

gshubham96

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. :D :)
Regards,
Shubham
Regards
Shubham Garg

growler

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?

AWOL

Quote
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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

gshubham96

Quote
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
Regards
Shubham Garg

AWOL

Quote
the problem is speed of motor can not be controlled

You've done something wrong then.
Quote
The code has to be modified to drive in both direction but how?

What code?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

MikMo

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.

gshubham96

@ AWOL and MikMo
Quote
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.

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

Code: [Select]
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.
Regards
Shubham Garg

AWOL

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

And PWM isn't just on/off?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

gshubham96

Regards
Shubham Garg

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


AWOL

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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up