Pages: [1]   Go Down
Author Topic: Will a DC Motor Fry my board?  (Read 724 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

Let me begin by saying I'm confident on the programming side of things but when it comes to electronics I'm a novice. So if this question is too dumb, apologies in advance. 

Basically, I've bought the arduino kit from OOmlout and worked my way through a few books on Arduino. most of the books involve LED's and I want to play with a DC motor. I believe the motor I have is 9 volts. I know the arduino outputs five. I'm powering the board via USB. I know that USB can output various levels of electricity. I was wondering if I plug the motor straight into the board will it draw 5 volts ad not work OR will it start to run and fry out my arduino because its sucking too much power form the board? Given I don't want to fry my Arduino to find out, I figured I'd ask on here as a first port of call.

I am trying to learn more about electronics. I bought the Make Electronics book and it's proving useful, but it's going to take a little bit till I've got the fundamentals.

Bunzy
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26956
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

Most likely this:
"OR will it start to run and fry out my arduino because its sucking too much power form the board?"

IO pins can supply 40mA, but there is no built in limiting. DC motor looks lik a short to Gnd to an IO pin
Connect +9 to Motor'+', Motor'-' to NPN transistor collector, with emitter to Gnd.
Connect arduinon IO pin to 180 ohm resistor to transistor gate. High out will turn on transistor and let current flow thru motor.
Use a PWM pin if you want to add speed control.
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.

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12070
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

But you also need to worry about inductive spikes - DC motors are inductive so some protection is generally needed (as for relays).
Logged

[ I won't respond to messages, use the forum please ]

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

Thanks CrossRoads & MarkT

Just to make sure I understand:

If I take a line out of one of the digital pins it will get treated as a road to a ground connection and because it wants 9V it will take 9V and this will fry the board. If I put a 180Ω resistor between the pin going into a transistor this will limit the flow that the motor is trying to take(?) and allow an acceptable amount of current to charge up the transistor and then pass into the motor when it's got enough charge to discharge?
Then how do I earth this larger current from the motor negative line as it will surely have to go back into the Arduino? Do I put another resistor in before going to earth to step it down? I really am very new to the electronics bit of this.

Also if I use pin 9, 10 or 11 with analogWrite, can I limit the amount of electricity sent to the motor by limiting the flow output programmatically?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 533
Posts: 26956
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

See attached - motor drive using a MOSFET. Resistor from arduino pin prevents pin from being damaged by inherent gate capacitante.
Resistor to ground keep MOSFET off during reset when IO pins are defaulted to Input until sketch starts up.
MOSFET can be an NPN transistor as well; resistor to ground is not needed.

power supply ground must connect to arduino ground for common reference point.

PWM from whatever pin limits motor current by rapidly turning on/off at ~490 Hz, amount of High time (0 = off, 255 = full on) determines how fast motor will spin.


* motor_drive_mosfet.jpg (22.59 KB, 960x720 - viewed 29 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: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Many Thanks CrossRoads!

The diagram is most helpful.


Thanks!


Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 145
Posts: 5461
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm powering the board via USB. I know that USB can output various levels of electricity.

No it can't. USB outputs five volts, the same as an Arduino.

For 9V you need a different power supply.

(Or accept that your motor will run at 5/9 of normal speed...)
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Leeds, England
Offline Offline
God Member
*****
Karma: 14
Posts: 639
Quick, chuck it in the bin before the boss finds out...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.oomlout.com/oom.php/products/ardx/circ-03
Logged

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

Pages: [1]   Go Up
Jump to: