element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino and Electric Motor
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 13 replies
  • Subscribers 402 subscribers
  • Views 1114 views
  • Users 0 members are here
  • help
  • hardware
  • diy
  • uno
  • electrical
  • arduino
Related

Arduino and Electric Motor

iseeall
iseeall over 12 years ago

I am new to the site. I have been having a blast with some projects with my arduino.  I do have a question that I am uncertain about.  I would like to control an external electric motor that already has its own power supply, such as a box fan.  I am not an electrical engineer by any means, just a tinkerer.   I would like to control the speed of the fan programatically.  But not sure if I can just interrupt the power flow to it and use something similar to like a dimmer.  Or if I need to use some sort of power regulating relay sheild. 

 

Any suggestions and help are appreciated!  Again, thanks for the great tutorials and I hope to be on the site more!

  • Sign in to reply
  • Cancel
Parents
  • ntewinkel
    ntewinkel over 12 years ago

    If it's a DC fan, this tutorial from Oomlout might help:

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

     

    See the "Making it Better" section at the bottom on how to control speed.

     

    Depending on your motor, you might need a more powerful transistor to match. It might be a good idea to start with something small like a power-toothbrush motor just to help figure things out.

     

    Hope that helps!

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • iseeall
    iseeall over 12 years ago in reply to ntewinkel

    That looks like what I was hoping was going to be the case. 

     

    I am going to attempt to do this with some smaller motors (toothbrush, rc car, ect) and then I would like to step up.  Obviously something like a box fan or even a small desk fan will require something larger to handle the power.  Any suggestions on the circuit layout for that?  You mentioned larger transistors.  Sounds like maybe this is something you might have done? image

     

    Thanks again!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntewinkel
    ntewinkel over 12 years ago in reply to iseeall

    Hi Jason,

     

    I haven't tried anything much bigger yet, but have run into trouble with slightly bigger motors just not working with that oomlout circuit with the recommended transistor, even when using a second power supply to run just the motor. On that note, if your motor doesn't run, you can test the circuit with an LED in place of the motor.

     

    To run with a separate power supply, you can use the same circuit - just connect the breadboard +/- rails to the new power supply, and connect the Arduino ground to the ground rail. Don't connect the Arduino 5v to anything (ie, remove that connection from the original circuit), and pin9 stays on the transistor where it was.

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntewinkel
    ntewinkel over 12 years ago in reply to iseeall

    I just thought I'd try that circuit again, but I get the same results as before: Only one of the little motors actually works with that Oomlout circuit (even when using an external supply to run just the motor circuit).

     

    The other motor works fine when connected directly to 5v and gnd, but not when through the pn2222 transistor. A while back I checked, and the motor didn't seem to draw more amps than the transistor was rated for (I think that's 600mA, and the motor was like 400mA), so I don't know what's up with that!

     

    So I'm hoping someone else will have some brilliant advice as to what kind of transistor can be used, if it is indeed possible to use a transistor, and/or how to properly run a bigger motor image

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • iseeall
    iseeall over 12 years ago in reply to ntewinkel

    is there a way to have something regulating the power of the other power supply, and that regulator controlled by the arduino?

     

    external power ->  arduino controlled regulator ->  electric motor

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntewinkel
    ntewinkel over 12 years ago in reply to iseeall

    This tutorial says a TIP120 can be used:

    http://playground.arduino.cc/Main/DCMotorControl

     

    It looks like the relay is to control forward/backward, and the TIP120 controls speed...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ntewinkel
    ntewinkel over 12 years ago in reply to ntewinkel

    A Google search for TIP120 and Arduino shows a lot of results, including this Instructable:

    http://www.instructables.com/id/Use-Arduino-with-TIP120-transistor-to-control-moto/

     

    So I've just ordered some of those image  Thanks for the inspiration, Jason!!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 12 years ago in reply to iseeall

    Jason

     

    When you start getting into electric motors, speed control is a whole other game.

     

    Some can be controlled, and some can't.

    You CANNOT use a transistor to switch ac motors on/off and certainly CAN'T control their speed with a transistor.

     

    There is the added complication of mains voltage which is potentially lethal and therefore needs VERY careful design.

    I will not give information about controlling mains devices, as I can't check the handywork prior to connection ....

     

     

    Transistor size ( for Nico and others )

    You should be able to measure the full load current of the motor, by hooking it across whatever supply you intend to use, and loading the motor.

    Motors draw twice or more current when starting than they do running at their rated speed.

    Be aware that some of the larger motors may draw more than the lowly batteries you pulled out the bottom draw.

     

    It is then a matter of getting a suitably rated transistor that has the Ic (I = current c = collector) higher than that.

    The next problem is the gain (hFE) and how much current you have to control the base, which controls the collector.

    Most larger transistors have gains of only 100-200 and some as low as 25.

     

    So your 2amp (2000mA) motor with a transistor gain of 100 needs a base current of 20mA which is just on the limit of the arduino.

    Hence its like having a car capable of towing the boat, but not enough throttle to get up the hill.

     

     

    The TIP120 is a darlington (two transistors) with Ic = 5Amps, and hFE of 1000.

    Using a TIP120, your 2amp motor only needs 2mA from the arduino, but with two junctions it needs 1.2v to turn on (1.5v at full load)

    It won't hurt either the Arduino or the transistor, if you use a 220 resistor between the pin and the base.

     

    The other option is mosfets which have higher current rating and much higher gains.

     

     

    Mark

     

    The schematic also forgot to add the diode across the relay coil .....

     

    Message was edited by: Mark Beckett 10:36 6/6/13

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • mcb1
    mcb1 over 12 years ago in reply to iseeall

    Jason

     

    When you start getting into electric motors, speed control is a whole other game.

     

    Some can be controlled, and some can't.

    You CANNOT use a transistor to switch ac motors on/off and certainly CAN'T control their speed with a transistor.

     

    There is the added complication of mains voltage which is potentially lethal and therefore needs VERY careful design.

    I will not give information about controlling mains devices, as I can't check the handywork prior to connection ....

     

     

    Transistor size ( for Nico and others )

    You should be able to measure the full load current of the motor, by hooking it across whatever supply you intend to use, and loading the motor.

    Motors draw twice or more current when starting than they do running at their rated speed.

    Be aware that some of the larger motors may draw more than the lowly batteries you pulled out the bottom draw.

     

    It is then a matter of getting a suitably rated transistor that has the Ic (I = current c = collector) higher than that.

    The next problem is the gain (hFE) and how much current you have to control the base, which controls the collector.

    Most larger transistors have gains of only 100-200 and some as low as 25.

     

    So your 2amp (2000mA) motor with a transistor gain of 100 needs a base current of 20mA which is just on the limit of the arduino.

    Hence its like having a car capable of towing the boat, but not enough throttle to get up the hill.

     

     

    The TIP120 is a darlington (two transistors) with Ic = 5Amps, and hFE of 1000.

    Using a TIP120, your 2amp motor only needs 2mA from the arduino, but with two junctions it needs 1.2v to turn on (1.5v at full load)

    It won't hurt either the Arduino or the transistor, if you use a 220 resistor between the pin and the base.

     

    The other option is mosfets which have higher current rating and much higher gains.

     

     

    Mark

     

    The schematic also forgot to add the diode across the relay coil .....

     

    Message was edited by: Mark Beckett 10:36 6/6/13

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • ntewinkel
    ntewinkel over 12 years ago in reply to mcb1

    Thanks Mark!

     

    For the "cannot" line, are you referring to AC motors?

     

    So for the PN2222A transistors I have here (are they the same as the PN2222AG used in Oomlout circ-3?), what size (mA) motor can they run? I come to 700mA using the 35 minimum gain on the datasheet x 20mA.

     

    Just so you know my intentions - I want to run little DC toy motors for small RC type vehicles. The ones I have right now all seem to run well at 5v. I think the RC car I want to pull apart to make a base runs on 6AA's, so about 9v.

     

    Thanks,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 12 years ago in reply to ntewinkel

    Nico teWinkel wrote:

     

    Thanks Mark!

     

    For the "cannot" line, are you referring to AC motors?

     

    Yes (I've edited the original to be clearer ...thks)

    Mains electric motors (110 or 230vac) cannot be controlled by transistors directly.

     

    There are some devices that use 10v dc to control a mains device.

    This was a common means to safely control stage lighting that wasn't using DMX.

    Some of the new dimmable lighting incorporate 10v control, either you supply the voltage, or connect a pot across the control line.

     

    The PN2222A datasheet I have says its 1A with a gain of anything from 35-75 but drops to 40 at 500mA (and that was pulsed not steady)

    generally the industry uses the same code, so a 2222 from xyz is likely to be the same as from abc.

     

    for your motor control

    The problem you start running into, is the voltage drop across the transistor tends to increase, then the heat increases, and its gain drops.

    The problem is not always the running current, but the start current, so using the car example...

    We have a big enough car, but we can't get moving as we don't have enough throttle and the brakes drag until it gets to speed.

     

    Personally I'd be using the TIP120 as I think your motors will draw more than 700mA.

    You can measure the maximum current by stalling the motor (stop) and seeing how much current it draws (1 or 2 secs ONLY as they get real hot, real quick)

     

     

    I sent you a link to the 300g bot I made ...

    I used the mosfet driver IC's and added the diodes across the outputs (the TIP120 has them, but others don't.)

    This gives a full bridge (ie backwards and forwards) without using a relay and well within the Arduino capabilities.

     

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • iseeall
    iseeall over 12 years ago in reply to mcb1

    So with the tip120 there is a chance of me being able to speed control a bigger electric motor that has its own power supply and requires more current than the arduino can supply? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 12 years ago in reply to iseeall

    Jason Brunk wrote:

     

    So with the tip120 there is a chance of me being able to speed control a bigger electric motor that has its own power supply and requires more current than the arduino can supply? 

    Yes BUT we are talking a DC 'electric motor'

     

    Do you know how much current the motor draws (some have the stall current rating, others don't)?

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube