The different kinds of servos and motors

First, we'll go over a few common servos and motors that you'll run into. But first, for those who are new to this, let's look at a quick description of motors and servos.

Defining motors and servos

A motor (or an electrical motor for our purposes) converts electrical energy to motion. Electricity goes in, motion comes out. This motion is output as a rotation motion; one of the most common uses of electronic motors is to turn wheels. Note that while you can control the speed of a motor by controlling the power being input, you cannot change the position of a motor precisely.

This is where servos come in. Servos use electricity to move to a set point—most commonly in an arc of 180 degrees. However, there are some servos that can rotate 360 degrees. We'll discuss these in a moment. Servos are technically specialized motors, and while motors are used to propel projects, servos are used to control them.

Things to keep in mind

There are quite a few servos and motors available for use with your Johnny-Five projects. While we are going to go over many of these, there are a few things to keep in mind when looking at motors to be used.

For instance, be sure to be aware of the voltage and current needed to power the motor or servo; if this is above 5 volts, you'll need to power them with something other than the Arduino's 5V OUT, and if they draw a lot of current but only use 5V, you might consider an external power supply for your Arduino board. Note that additional electric current is supplied whenever you have multiple servos—but the voltage required stays the same; for instance, if you have two servos that require 5V of voltage but 200 mA of electric current, you still only need 5 volts but you will need 400 mA current! Much of this information can be found on the data sheet for the motor or servo you are using.

Types of motors

While we're going to go over a few types of motors here, keep in mind that the functionality of most of these motors is the same; they have an on and off switch, and you can slightly adjust their speed with power adjustments. However, this doesn't rule out the use of motors entirely—there are some interesting uses as well!

Your standard hobby motor looks like a large cylinder with a few wires on one end and a rod on the other end, like the following figure:

Types of motors

A standard DC hobby motor

The motors come in various sizes and can generate different levels of work. These are mainly used for motion and propelling projects such as remote-control vehicles. Some of these motors are called directional motors—this means you can control the direction. With nondirectional motors, you can only turn the motor in one direction. Keep this in mind when considering your project.

There are also vibration motors—these are found in cell phones that alert you to calls without an audible ring. These look similar to regular motors, but the rod at the end has an asymmetrical weight attached, as shown in the following figure:

Types of motors

A vibration motor

These motors are primarily used for tactile vibration, but in the wearables and cell phone worlds, this can be a vital piece of the puzzle!

Finally, there are stepper motors. They are usually larger and require more power:

Types of motors

A stepper motor

However, stepper motors move in a discreet manner, giving you more control and precision with full rotation. One very common use of these motors is 3D printing—these motors are at the heart of most 3D printers because of their precision and speed.

Types of servos

There are two main types of servos. The first is generally called a standard servo; they are regularly used in hobby remote-control vehicles, such as cars and planes, as well as hobby robotics. These tend to look similar to a box with a plastic cylinder and a propeller, an arm, or a disc shape on top, as shown in the following figure:

Types of servos

A standard servo

These servos move in a range of motion that spans 180 degrees or half of a full range of motion. However, these can be set to a required position giving them precision over motors.

There are also continuous servos that span a full 360 degrees. Note that the two types of servos look remarkably similar; checkout the previous servo and the one shown in the following figure:

Types of servos

A continuous servo

Most continuous servos have a label on them that indicates that they are continuous servos, but you'll have to keep a track of the different types when purchasing your own.

Do I use a servo or a motor?

This is a fantastic question: if you want movement, which one do you use? A servo or a motor? The rule of thumb is, if you want precise movement, you'll need a servo; while servos can be configured to move in certain angles, motors go on and off with the speed setting varied by the amount of power sent to it—not a discrete unit such as degrees/second.

Many of you will think that if you want a full 360 degree range of motors, you're limited to using motors. This isn't always the case; continuous servos combine the precise nature of servos with a full range of motion offered by a motor.

Servo and motor controllers

Sometimes, you may want to use a lot of motors or servos on a project; a good example of this is a hexapod kit, which uses 18 high-powered servos! There are not that many pins on an Arduino Uno, but using a servo or a motor controller, you can control many motors or servos using two data pins. These controllers use the I2C method that we discussed in Chapter 4, Using Specialized Output Devices. Johnny-Five has built-in support for quite a few of these controllers. If you'd like to use one, make sure that you check the documentation at www.johnny-five.io to make sure yours is compatible.

Servo and motor controllers

An example of a servo controller with an I2C interface

Motor and servo shields

A shield is an Arduino term for a board that is placed on top of an Arduino, usually an Uno, to give it some extra capability. Shields can be used to add Wi-Fi, LED matrices, and so on. A very common shield type is the shield for motors and servos. Johnny-Five supports a few shields for motor use. Again, if you wish to use a lot of motors or high-powered motors, check out the documentation at www.johnny-five.io to see whether a motor shield is right for your project.

Motor and servo shields

An example of a motor shield

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.119.199