STEP TWO: Driving One Motor

Overview

In this lesson, you will be turn a motor on and off and control its direction using logic.

Set Up

Set up our initial breadboard circuit with a Metro Mini and the motor controller

  1. Set up a breadbord with just a Metro Mini and the usual power and ground connections. (DO NOT CONNECT A USB CABLE YET)

  2. Add the MD17A to your board.

  3. Following the diagram in the previous lesson, connect both GND pins on the MD17A to ground on your breadboard.

  4. Connect the two leads of your motor to AOUT2 and AOUT1 of the MD17A. It does not matter which lead of the motor goes to which pin.

  5. Using long jump wires, connect the AIN1 pin to ground and AIN2 to power. These are you control pins and will be used to turn the motor on and off and control its direction.

The Power Supply

You will be using your bench power supply to power your motor. Motors draw far too much current to be driving by the 5V logic of the USB and trying to draw this much power from the USB or your microcontroller would likely dammage both. In addtion, the motors run on higher voltages than are safe for your microcontroller. For these reasons, you need to be very careful about adding the bench power to your circuit. IMPORTANT DO NOT CONNECT THE RED LEAD OF THE POWER SUPPLY TO THE POWER BUS OF YOUR BREADBOARD.

  1. Turn on the power supply and set the voltage to 8 volts.

  2. Turn off the power supply.

  3. Find a pair of aligator leads.

  4. Connect the black lead to the black or ground socket on your bench supply.

  5. Connect the red lead to the positive side of your bench supply.

  6. Using a long jumpwire connect the alligator clip of the black lead to the ground bus of your breadboard. Normally when using two power supplies, you need to connect the grounds of both power supplies together.

  7. Now connect the red lead from the red socket on your bench supply to the VIN pin of the MD17A. DO NOT CONNECT THE RED LEAD OF THE POWER SUPPLY TO THE POWER BUS OF YOUR BREADBOARD.

  8. Have your teacher check your circuit.

Driving the Motor

You will now be able to the motor on and off and control its direction.

  1. Power up your Metro Mini with the USB cable.

  2. Turn on the power supply. At this point your motor should be turning either clockwise or counterclockwise.

  3. Following the Control Logic table in the previous lesson, use wires connected to AIN2 and AIN1 to turn the motor on and off and control its direction.