Pages: [1]   Go Down
Author Topic: Arduino – Control a DC motor with TIP120, potentiometer and multiple power suppl  (Read 3088 times)
0 Members and 1 Guest are viewing this topic.
Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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-grin smiley
Regards,
Shubham
« Last Edit: July 04, 2011, 03:08:41 am by gshubham96 » Logged

Regards
Shubham Garg

Portland, OR
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26326
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: July 04, 2011, 03:28:58 am by gshubham96 » Logged

Regards
Shubham Garg

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26326
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

"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.

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ 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:
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.
Logged

Regards
Shubham Garg

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26326
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

"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.

Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Regards
Shubham Garg

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26326
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes.
And braking or free-running stop.
Logged

"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.

Delhi, India
Offline Offline
Jr. Member
**
Karma: 0
Posts: 80
~
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Regards
Shubham Garg

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26326
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

"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.

Pages: [1]   Go Up
Jump to: