When working with MCUs and the like, blinking lights and OLED outputs are fun, but to create something that actually moves, your first choice will normally be a DC motor. Fortunately, these can be found with a quick web search online, and options vary from a few dollars to thousands depending on your budget and needs. Let’s look at the types available and their relative advantages and disadvantages.
While all the devices here could broadly be considered DC motors, what this term generally refers to is an unguided motor that uses a rotating magnetic field between the inner rotating armature and an outer stator section that surrounds it. The magnetic field is varied mechanically by a commutator ring to attract the inside in a correct sequence and create rotation. While unguided, the motor’s speed can be varied by changing the voltage applied to it, or mechanical gear reduction can be used to reduce speed and increase torque. If feedback is needed, external sensors can be applied to guide the process.
Stepper motors work by dividing up a full motor rotation into steps that can be precisely controlled by a series of electromagnets. Internally, this takes the form of an iron rotor on the inside shaped similarly to a gear with a series of electromagnets that attract these teeth. When properly sequenced, this causes the rotor to move in a forward or reverse direction at a precise angle. Driving a motor in this manner requires a much more sophisticated control scheme than a DC motor, but can provide control reliable enough for precise operations such as running a CNC router without feedback. The motors apply magnetic force even when not moving to hold the rotor in place, which is advantageous for positioning, but does require a constant input of power.
Servo or servomotor
Unlike the other motors mentioned so far, servos feature closed-loop control where the controller commands the motor’s shaft to move to a certain position and the motor moves there based on internal sensors. A simple type of servo is common to hobbyist applications as a rectangular motor that can be commanded via a PWM signal from an RC receiver or microcontroller in a limited rotational range. The device moves to the desired position comparing its reading to an internal potentiometer for feedback.
This type of simple control can be had for a few dollars, but systems capable of full 360° rotation, gear reduction, and higher torque and/or speed can cost thousands. Another interesting idea would be to add an encoder like this one to a hobby servo to enable 360° rotation with feedback.
Brushless DC motor
Brushless DC motors could be considered a sub-species of stepper motors, in that they use a series of electromagnetic pulses to move a rotor in a controlled manner, and they even feature closed loop feedback like a servo. While they share these characteristics, brushless DC motors are setup for speed, not positional accuracy. As such, they are used where the RPM is important, but how many rotations or even what individual angle has been traveled is not. Applications include computer fans, quadcopters (drones), and electric vehicles.
As every project is different, there’s no “one size fits all” solution motor-wise. Fortunately, there is a variety of motor types, and huge differences in quality, cost, and specs within each. No matter what your needs, there’s a good chance that the motor you need is just a click or phone call away. As for motor control options, you might consider dev boards such as the Arduino Uno, Adafruit Trinket, or even the WeMos D1 Mini.