Controlling DC motors using a shield

For this final example, let's graduate from a simple DC motor to a wheeled platform. There are several simple, two-wheeled robotics platforms. In this example, you'll use one that is available on several online electronics stores. It is called the Magician Chassis, sourced by SparkFun. The following image shows this:

Controlling DC motors using a shield

To make this wheeled robotic platform work, you're going to control the two DC motors connected directly to the two wheels. You'll want to control both the direction and the speed of the two wheels to control the direction of the robot.

You'll do this with an Arduino shield designed for this purpose. The Galileo is designed to accommodate many of these shields. The following image shows the shield:

Controlling DC motors using a shield

Specifically, you'll be interested in the connections on the front corner of the shield, which is where you will connect the two DC motors. Here is a close-up of that part of the board:

Controlling DC motors using a shield

It is these three connections that you will use in this example. First, however, place the board on top of the Galileo, much as you did with the display shield from the last chapter's example. Then mount the two boards to the top of your two-wheeled robotic platform, like this:

Controlling DC motors using a shield

In this case, I used a large cable tie to mount the boards to the platform, using the foam that came with the motor shield between the Galileo and plastic platform. This particular platform comes with a 4 AA battery holder, so you'll need to connect this power source, or whatever power source you are going to use, to the motor shield. The positive and negative terminals are inserted into the motor shield by loosening the screws, inserting the wires, and then tightening the screws, like this:

Controlling DC motors using a shield

The final step is to connect the motor wires to the motor controller shield. There are two sets of connections, one for each motor like this:

Controlling DC motors using a shield

Insert some batteries, and then connect the Galileo to the computer via the USB cable, and you are now ready to start programming in order to control the motors.

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

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