ASK AN EDUCATOR – “How do I make things move with an Arduino?”

Dr. Ew asks:

Making things move with an Arduino – How do you choose the correct size motor to drive your project? And the correct batteries or power supply to drive that motor.

Ahh…I love hardware questions!

There are a ton of ways to get your Arduino to turn a motor, but choosing the right method can get a bit tricky. In order to get started there are a few things you first want to nail down that will ultimately dictate the approach you take. (BTW there is a awesome overview on motors here)

  1. What kind of motors do you have available?
  • DC motors (High speed)
    • Brushed
      • Probably the most common and widely available. It operates by spinning a coil of wire (armature) within a magnetic field. These can create a lot of electrical noise, and unless you use an encoder, cannot be positioned. They can be driven in a variety of ways including Transistor, Relay/SSR, Darlington Array, and H-Bridge. Depending on how much torque you require to move your project you can also find some with an attached gearbox.
    • Brushless
      • A little more complicated the the brushed version. The advantage though is that brushless DC motors do not produce the same amount of electrical noise as the brushed, as they spin a permanent magnet within a controlled electromagnetic field. They can be driven using a transistor array that sequentially cycles the coils. An advantage of this process is that the motors RPM can be easily calculated based on your pulse frequency.
  • Stepper motors (Low speed, positionable, high torque at low RPM)
    • Unipolar
      • Contains a series of coils that spin a permanent magnet. Each coil is attached to a common “tap” that is typically attached to the positive side of your power source. These typically have five or six wires and in the case of six-wire motors, the two “tap” wires can be both attached to the same power source. An advantage of the Unipolar motor is that they can be driven by a transistor array, unipolar stepper driver or bipolar stepper driver and have the ability to be driven to a specific angle, allowing for accurate positioning.
    • Bipolar
      • Very similar to Unipolar steppers although their coils do not have a common tap. This type needs to be driven by a stepper driver or H-bridge as the polarity within the coil switches.
  • Servo motors (Typically low speed, positionable, high torque, can be made for continuous rotation)
    • Analog
      • Works by referencing the position of the output to the position of an internal potentiometer. This allows for very accurate positioning via the control frequency. Arduino has a very easy to use library for this. If you want to use them as a continuously rotating geared motor, you can remove the plastic stop inside the gearbox and decouple the potentiometer. This allows for bi-directional rotation as well as speed control.
    • Digital
      • Essentially the same as the analog, but often have higher holding torque
  • How do you want to drive the motor?
    • Transistor
      • Super simple and scalable. The attached is a good tutorial that uses the infamous TIP120, although I would recommend a current limiting transistor on the base.
    • Transistor Array
      • Essentially a prepackaged series of darlingtons as mentioned above. A common one is the ULN2803.
    • H-Bridge
      • Allows for CW and CCW rotation of a DC motor. A common one is the L293D. These can also be used to drive a stepper and is a cheap alternative to a stepper driver.
    • Relay/SSR
      • Allows for isolation between your Arduino and a large electrical load. If you need to move a really big motor, these might be the way to go. These can be used to drive a DC motor both CC and CCW if you use a DPDT relay.
      • Preconfigured for all your needs and might be your best answer. It includes 2 H-bridges (so you can drive steppers or DC motors) as well as servo headers.
  • And as you asked above: What is your power source?
    • Each motor comes with its own sets of requirements. The maximum operating voltage and current requirements are usually listed on the motor. If they are not, you can easily determine the current draw of your motor by picking a low voltage on your power supply…say 5V…and put a multimeter configured for current sensing in series with the supply. Observe the current draw both with no load and while stalled (stopped). This will give you a good idea as to how you would want to drive it. You could also do your calculations using the motors internal resistance. I=V/R
    • Servos can typically sometimes handle up to 7.2V which makes battery configuration easy. 6 x NiMh AA’s or 2 x LiIon packs, etc.
    • Oh and make sure you measure the power coming out of a wall-wart as they are usually wrong. Use switching supplies as they tend to be much more accurate.
    I hope I have answered your question and got you moving in the right direction!

    Next up is Kris with a question about diodes!

    Don’t forget, everyone is invited to ask a question!

    Click here!

    “Ask an Educator” questions are answered by Adam Kemp, a high school teacher who has been teaching courses in Energy Systems, Systems Engineering, Robotics and Prototyping since 2005.

    Make a robot friend with Adafruit’s CRICKIT – A Creative Robotics & Interactive Construction Kit. It’s an add-on to our popular Circuit Playground Express, FEATHER and other platforms to make and program robots with CircuitPython, MakeCode, and Arduino. Start controlling motors, servos, solenoids. You also get signal pins, capacitive touch sensors, a NeoPixel driver and amplified speaker output. It complements & extends your boards so you can still use all the goodies on the microcontroller, now you have a robotics playground as well.

    Join 7,500+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

    CircuitPython in 2018 – Python on Microcontrollers is here!

    Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

    Join us every Wednesday night at 8pm ET for Ask an Engineer!

    Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/

    Maker Business — Fewer startups, and other collateral damage from the 2018 tariffs

    Wearables — Battery wash cycle

    Electronics — How to make your own magnetic field probe!

    Biohacking — The State of DNA Analysis in Three Mindmaps

    Python for Microcontrollers — One year of CircuitPython weeklies!

    Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !

    1 Comment

    1. Thanks for posting this, I’m almost embarrassed at how helpful having this page in this format is.

    Sorry, the comment form is closed at this time.