Connecting a Lego NXT motor to the Arduino
Connecting the Motor
Now that we know what a motor is, we want to connect it to the Arduino board so that the Arduino can give commands to the motors. There's just one problem: Neither the Arduino Uno nor the DFRobots Motor Shield have a connector that can accept the LEGO Motor jack. So we need to get a special part, a little chip with a NXT jack attached it and six connectors that go into the breadboard. This component is called an "Breadboard Connector Kit for NXT" and can be purchased at Mindsensors.com
Now that we have a way to get from the motor jack to individual wires, we can connect to the blue motor ports on the DFRobot Motor Shield. For this, we will only be using the two rightmost pins on the converter piece, the ones labeled AN IN and GRND. AN IN should be connected to the slot labeled M1+ for the left motor or M2+ for the right motor, and GRND should be connected either to M1- (again for the left) or M2- (for the right).
The Importance of the DFRobot Motor Shield
The DFRobot Motor Shield is a necessity for the operation of the LEGO robot because of the motor configuration of the NXT motor. Unlike many other servos, the NXT motor only has two wires, an input and a ground. Thus the pin providing input to the motor must also provide power to it, which the standard digital or analog ports do not. So, the specialized Motor Shield ports (see the pictures above) are necessary, as they provide both functions. The DFRobot Motor Shield can be purchased from robotshop.com