We are not the first to make an Motor Shield for Arduino. But could be that we are the first that make a Motor Shield with a minimum of flexibility.
We are studing a WiFi robot with camera controlled by Arduino. The robot will be controlled by browser. But we find a problem with an existing shield: the pin SPI to controll Ethernet shield (that become WiFi shield) are the same of motor shield.
So we reengineered the Motor Shield and we allow to user the choice of what pin use to drive the L298. Infact we provided some jumper to select the pin to use.
The main power can be selected by a jumper: if the motors work at 12V and the current is less than 1A you can chose the VIN input (INT) and power the Arduino with a 12V, else if the motors work higher than 12V you must chose the EXT input anche connect the power to PWR screw.
The core of the project is a L298 H-Bridge, a motor driver with this caracteristics:
We chose the SMD version of L298 because is also simple to solder, but the profile is lower than the traditional version, so other shield could be mounted without problem.
The main power is transferred to the analog input A5 through a voltage divider (R9 and R10) to reduce the voltage on A5. This can be useful e.g. for all the application that use a battery (like our WiFi robot).
With the jumper DIRA and DIRB the user select the direction of the motor A and B.
The speed is controlled by PWMA and PWMB. All the pins conneted to these jumpers are obviously PWM pins.
The LD1 and LD2 are special leds that light on red or green in function of directions.
With this shield the user can also drive a step motor without problem.
R1: 4,7 kohm
R2: 10 kohm
R3: 4,7 kohm
R4: 4,7 kohm
R5: 10 kohm
R6: 4,7 kohm
R7: 1 kohm
R8: 1 kohm
R9: 100 kohm
R10: 10 kohm
C1: 100 nF 100
C2: 100 µF 63 VL
C3: 22 µF 35 VL
U1: L298PLD1: Led 5 mm R/G (L-57EGW)
LD2: Led 5 mm R/G (L-57EGW)
screw 2 via (3 pz.)
Strip male 3 via (9 pz.)
Jumper (5 pz.)
Strip M/F 6 via (2 pz.)
Strip M/F 8 via (2 pz.)
This code originaly is used to drive the Sparkfun’s motor shield.
I modified only the pins used to drive the L298. If you need you can chose other pin with the jumper and modify the sketch.
For more detail: Arduino Motor Shield