I needed a motor driver for a 4WD wheeled platform. While a lot of single and double controllers are out there, there aren’t many that are able to control 4 DC motors. I considered the Adafruit Mshield, but it’s pins are set by the factory and used pins I had in mind for other tasks –like a SpeakJet. So I decided to build one. I chose the Toshiba TA8050P motor controller chip because I just happened to have 14 of them. It will accept voltages from 6 to 32 and so it should get along swimmingly with the 12v LiPo battery pack I’m using. The TA8050P will allow control for forward, backward, stop and brake, and uses PWM for speed control.
To build this device I used the following parts:
1 x Radio Shack prototyping board (276-150) $1.99
4 x 7 pin female header (for TA8050P) $1.95
2 x compression terminal – 4 pin $2.50
1 x compression terminal – 2 pin $1.00
8 x 301 ohm 1/2w resistors $1.00
4 x red LED 3mm $1.20
4 x blue LED 3mm 1.20
1 x 220 uF capacitor $0.50
4 x Toshiba TA8050P controller chip $10.00
Pins 1 and 2 on the TA8050P are the digital control lines and they connect to digital PWM pins on the Arduino. I happen to be using a Seeeduino Mega because of all the pins I needed and the greater memory for sketches. The robot I have in mind uses a lot of pins and memory. However, this controller could have been made as a shield, clamping it to an Arduino like any other. I chose to make this work whether a microcontroller was used with it or not. Also, if my great plans for robotic construction goes south, well I still have a controller out of the deal.
The circuit is very simple, given the TA8050P. There are a total of 7 pins and it actually only uses 6 of them. (Pin 6 is NC). Pins 1 and 2 are the digital control lines and they control the direction of the motors as well as their speed. Pin 3 is +motor out and Pin 5 is -motor out. Pin 4 is ground. Pin 7 is Vcc, in my case 12v.
I fancied it up by installing LEDs to show motor direction by color and intensity to show power. If a chip set for FORWARD, the blue LED lights. If BACKWARD, the red LED lights. I use a 5mm Green LED to show power to the controller. All of the LEDs have 301 ohm resistors for protection.
I found some fancy terminal strips at the Robot Shop and I’m using those to connect the motors to the board and to connect power to the controller. They are pressure connectors and so no screw driver is needed. Wires connect by pushing a button, inserting the stripped wire end, and letting go. Easy Peasy.
Each of the TA8050Ps are able to push 2 amps. This is more than suitable for the little DFRobot motors that came with the robot platform.
The following sketch shows a code example for controlling the motors with an Arduino.
const int d1 = 4;
const int d2 = 5;void setup() {
pinMode(d1, OUTPUT);
pinMode(d2, OUTPUT);
Serial.begin(9600);
}const int FORWARD = 0;
const int BACKWARD = 1;void loop() {
Serial.println(“d2 FORWARD – d1 falling”);
digitalWrite(d2, FORWARD);
for (int i = 256; i >= 0; i–) {
analogWrite(d1, i);
delay(20);
}
delay(1000);
Serial.println(“d2 BACKWARD – d1 rising”);
digitalWrite(d2, BACKWARD);
for (int i = 0; i <= 256; i++) {
analogWrite(d1, i);
delay(20);
}
delay(1000);
}


