Locomotion

There are different kinds of electric motors and each has its uses.
Here are the types you can use with IoT.Cafe

  • DC motor - the simplest kind, with the simples wiring - just two terminals for power. You can control this simply by turning it's power on or off via a digital output pin peripheral. You can also control it's speed by using a PWM pin peripheral.
    Note that a pin on your main board can't nearly provide enough power for the motor, so instead you should use the pin to pwer a MOSFET, which in turn would power the motor itself.
    To reverse the direction of its rotation, you'd need to reverse its polarity, i.e. to swap the connection of its wires. Or if you want to have control over it, you'd need to make an H-bridge.
  • Servo motor - this one doesn't usually provide constant rotation, but instead turns at a certain angle.
    It has three wires - two for power and one signal wire.
    To use it, you simply need to add a servo peripheral to your project and connect as your project suggests.
  • Stepper motor - as the name suggests, it rotates by making discrete steps and you control it by setting how many steps you want it to make and in which direction.
    Steppers come with electronic controllers, so the motor is wired to its controller and the controller is wired to your main board.
    Similarly to servos, steppers rotation is precisely controlled and it can rotate a certain amount of steps, which is similar to rotating up to a certain angle.
    The differences however are, that steppers can rotate indefinitely and that they don't keep track of their rotational position (unless backed by an additional device like an encoder), so you can't know for certain their turning state. Also, their turning speed can be controlled by the speed at which they make steps.
    To use it, you simply need to add a stepper motor peripheral to your project and connect as your project suggests.
  • Brushless motor - these motors are come with an ESC - that's an Electronc Speed Controllers and are commonly used for hobby projects such as drones and RC (Remote Controlled) toy cars, boats and etc.
    As with steppers, here the motor is wired to a controller (the ESC) and the controller is wired to your main board.
    As the name suggests, the speed of rotation of these motors can be controlled and they have relatively high torque even at low RPM (Revolutions Per Minute)
    Their turning direction can be changed by either switching any two of the thee wires between the motor and the ESC, or electronically, if the ESC has such feature.
    To use it, you simply need to add a brushless motor peripheral to your project and connect as your project suggests.

Types of motion

All of the mentioned motors directly provide rotational motion.
As per specific requirements, you might need to convert to other kinds of motion and most commonly to linear motion.
Here are a few ideas of how to attain linear motion

  • Crank - can be used easily with servos or steppers. Frequently used for steering on toy RC models
  • Threaded rod - it can convert fast rotation to a very precise and powerful linear motion
  • Belt drive - faster than the threaded rod, uses a timing belt and a (toothed) wheel to move along the line of the belt
  • Rack and pinion - similar to the belt drive with the pinion mounted on the motor, it can move along the rack. Can be 3d printed
  • Pulleys - can convert to linear motion and with a system of pulleys, can produce change in power ratio