Pages: [1] 2   Go Down
Author Topic: Correct schematic for DC motor contoller  (Read 2530 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I want to make this dc motor controller
http://arduino.cc/playground/Main/DCMotorControl

but it says to contact the forum as the schematic is incorrect.  Any idea where i can find the correct one thanks
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 33
Posts: 1926
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, It's just really oversimplified and assumes that you can get a Double-pole double-throw relay that can be driven directly from Arduino.

Anyone have a pointer to something more realistic??

You could use a relay board like this with two Single-Pole Double-throw contacts, plus the transistor speed control... :
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=171

DISCLAIMER: Mentioned stuff from my own shop...!
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 543
Posts: 27348
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No, a schematic with a double pole double throw relay to change direction on a single motor was posted in the last couple of days.
Something like this.


* relay_motor.png (5.12 KB, 807x406 - viewed 31 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

Thanks. I don't need a controller to turn a motor in both directions. Im really looking for one that will turn a motor in one direction but with variable speed.  Looked round on the Arduino playground and tutorials, but not sure there's anything simple enough for me, as this is first project.  Also reading a schematic is going to be uphill...
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

See attached.


* Scan 38.JPG (69.07 KB, 1653x1165 - viewed 46 times.)
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I like also to wire a 10k ohm resistor between mosfet gate and source terminals. This forces the motor off if for any reason the Arduino is powered off or reset but the motor's voltage source is still on.


Lefty
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I like also to wire a 10k ohm resistor between mosfet gate and source terminals. This forces the motor off if for any reason the Arduino is powered off or reset but the motor's voltage source is still on.

Yes, that's a good thing to do, I usually do it myself too.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

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

thanks that.  Strugglling to read the schematic.  Is it the 'Arduino PWM pm'? and what is that?  Also am i correct in reading 'Logic level power mosfet'?

Once ive got this circuit built (with the additional resistor), do i then use the code from the original motor controller thread?
thnaks in advance.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for my poor writing, it's 'Arduino PWM pin' meaning an Arduino output pin that supports PWM. You set the power you want by making an analogWrite call to that pin.

'Logic level power mosfet' means a N-channel power mosfet with logic level gate drive (i.e designed for 5v gate drive instead of the usual 10v). I usually use type STP40NF10L but that's rated at 100v 40A (both much more than you need) and there are cheaper ones that will work in this design.

The diode connected in parallel with the motor needs to be rated at the full stall current of the motor.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you want to control the motor speed using a potentiometer (as in the playground example but in one direction only), there are a couple of things wrong with the schematic. The pot should be wired with one end connected to +5v, the other end connected to ground, and the slider to pin A0. The other thing wrong with it is the position of the diode, but if you're using my schematic then that's already dealt with.

Here is a sketch for controlling the motor from the pot:

Code:
const int PotPin = 0;
const int MotorPin = 11;

void setup()
{
  pinMode(MotorPin, OUTPUT);  
}

void loop()
{
  int value = analogRead(PotPin);
  analogWrite(MotorPin, value/4);
}
« Last Edit: October 05, 2011, 03:35:23 pm by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

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

Thanks, very helpful.  Re the diode in parallel, i've no idea what the full current of the motor. I've made a homopolar motor using a number of small neo magnets and a copper coil round an iron bar.  The motor works, but it goes far too fast.  trying to slow it down with this controller.  is the diode something i can just guess at, or do i have to figure out the current of the motor?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have a multimeter that can read a couple of amps or so, you can put it in series with the motor to find the current it takes. The worst case is the stall current, i.e. the current when the motor is prevented from rotating.

Alternatively, measure the resistance of the motor with multimeter. Divide that resistance into the voltage you want to run the motor from to get the stall current.

If the current is not more than 1A, you can use a 1N400x diode where x is any digit from 1 to 7. Actually, these diodes are probably good for 2A of motor current, because they are rated at 3A pulsed and they only have to take short pulses in this application.

If the motor current is higher, then go for a higher-rated diode as appropriate.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

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

Thanks, this is proving far tougher than i'd imagined.  I think its the different suggestions and alterations that are throwing me off, not to mention novice status and general incompetence.  Anyway a few questions re the schematic:

Where does the 'motor supply +ve' get connected to?  Is it the 5V on the arduino?

Where does the 'motor supply - ve connect?   It's not the ground, so where?

Im having a hard time picturing how the diode that bypasses the motor actually is wired on the breadboard.

Also true for the Mosfet.  If the mosfet is theis the arrow facing left, then what is the gap and next white line? a switch?  (or is that all the mosfet).  The resistor comes after than, and then that gets connectd to the PWM pin.

The diode that you show bypassing the motor, how exactly does one wire that?

I will try to put an effort together and post it.

thanks again





Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 543
Posts: 27348
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Motor+ connect to power supply, the one that feeds the power jack, generally not a good idea to supply from 5V regulated power.
Makes regulator run hot, can  starve the ATmega of current & cause resets also.

Motor- in this case is Arduino ground, as you are running 1 direction only.

Diode needs to be wired across the motor, as close to the motor as you can.


The Mosfet is all the lines.

How you connect the diode is up to you & your evolving assembly skills smiley
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Where does the 'motor supply +ve' get connected to?  Is it the 5V on the arduino?

Where does the 'motor supply - ve connect?   It's not the ground, so where?

The Arduino 5v line probably can't supply enough current for the motor, so I assumed you would be using an external supply for the motor, such as a battery or wall wart (possibly the same supply that you use to power the Arduino through the barrel jack or Vin pin). That's where the motor supply + and - come from.

If the mosfet is theis the arrow facing left, then what is the gap and next white line? a switch?  (or is that all the mosfet).

It's all the mosfet.

The diode that you show bypassing the motor, how exactly does one wire that?

In parallel with the motor, with the stripe on the diode on the end that is connected to the +ve supply.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1] 2   Go Up
Jump to: