Small DC Motors

Pick a gearmotor (one with a set of gears up front) if you want to go slow with high torque. Match the motor to your battery supply source. Most motors will run on a wide range of voltages. The higher the voltage, the higher the speed and torque. If the motor heats up, or if it sounds like the bearings are giving out because the shaft speed is too high, your voltage is too high.

To slow your motor down you can (1) add a transmission, (2) lower the supply voltage, (3) add a low ohm, high wattage resistor or potentiometer (variable resistor), (4) pulse the motor on and off. For the latter, try a loop where you turn the motor on for 20 msec and off for 60 msec. See what happens. Play with the on and off times until you get what you want. This type of motor speed control is called "pulse width modulation" (PWM) and is commonly used for precision control. Note that PWM methods generate lots of electrical noise spikes which may cause your processor to crash. Test and see.

Note that hardly any mechanisms require variable speed (if you think yours does, design around it), so the preferred solution is not to slow the motor down, but rather to slow the output down by using a mechanical transmssion.

To run a motor in two directions, you need a double-pole, double-throw (DPDT) relay for direction control and another relay or transisitor for on-off control. See the interfacing note on bi-directional motor control for details.