Description
The VNH3SP30 Dual Monster Motor Driver Shield is a 2-channel DC motor driver shield that can drive 2 motors at up to 9A sustained.
PACKAGE INCLUDES:
- VNH3SP30 Dual Monster Motor Shield
- Qty 1 – 1×40 breakable male header strip
- Qty 2 – 8 pin stackable M/F header strip
- Qty 2 – 6 pin stackable M/F header strip
- Qty 3 – 2-pos 5.08mm screw terminal strip
KEY FEATURES OF VNH3SP30 DUAL MONSTER MOTOR DRIVER SHIELD:
- Drive 2 DC motor at 5.5 – 16V
- 30A peak current, 6-9A sustained per channel.
- Two full H-Bridges with speed control via PWM and direction control
- Reverse power protection
- Diagnostic output to detect thermal shutdown and similar faults.
This shield is based on the VNH3SP30-E driver chip. These devices were originally designed to drive motors in automotive power seats, so they are designed to handle a fair amount of power. They technically can handle up to 30A continuous with good heat sinking applied.
In a typical shield format like used here, you can go up to 20A peak for a few seconds of in-rush current and around 6-9A sustained depending on motor drive voltage.
These are a good choice when you are either using larger motors or just want to take your motor control to the next level over what a more typical driver module can provide.
When used with DC motors, the H-Bridge drive arrangement allows the direction of the rotation of the motors to be changed. In addition PWM can be used to control the speed of the motors. This gives full control over the DC motors.
Motor Power Connections
Motor voltage must be between 5.5 – 16V. The manufacturer rates the chip for up to 36V operation but it should be limited to 16V to avoid possible issues that sometimes arise with higher voltages.
The module has reverse power protection via the use of N-Channel MOSFETS on the low side of the drivers. 5V which comes from the Arduino is only used for logic pull-ups on the board for the ENABLE pins. There are two unpopulated thru-hole capacitor locations on the board. These are in parallel with the two 470uF SMD caps that go across the motor Vcc and Gnd connections. In some high current applications it may be beneficial to add additional capacitors of 470uF or larger to these locations, but they are typically not needed.
1 x 2 Terminal (Motor Power)
- ‘+’ = Motor Vcc which must be between 5.5 and 16V.
- ‘-‘ = Motor Ground.
Motor Connections
The motor connections are via two screw terminals for each motor. Multiple motors can be driven off each connection as long as the total current stays within bounds.
The wiring of which lead of the motor connects to which terminal is somewhat arbitrary and relative to what you consider forward vs reverse motor operation. If the motor goes in the opposite direction that you expect, simply reverse the wiring.
1 x 2 Terminal (Motor 1)
- A1 – Motor 1 ‘-‘ positive lead
- B1 – Motor 1 ‘+’ negative lead
1 x 2 Terminal (Motor 2)
- A2 – Motor 2 ‘-‘ positive lead
- B2 – Motor 2 ‘+’ negative lead
Motor Control Pins
The pins A1/A2 and B1/B2 correspond to the INA and INB pins on the driver IC which control the state of the H-Bridge in the device. The basic modes are to rotate CW, rotate CCW or brake. The operation is per the table below
A1 / (A2) | B1 / (B2) | |
Forward Direction (CW) | HIGH | LOW |
Reverse Direction (CCW) | LOW | HIGH |
Stopped (Brake to GND) | LOW | LOW |
Stopped (Brake to VCC) | HIGH | HIGH |
Arduino to Shield Control Pin Connections
- D4 = A2
- D5 = PWM Motor 1
- D6 = PWM Motor 2
- D7 = A1
- D8 = B1
- D9 = B2
These connections are automatically made when the board is used in a shield configuration. If wiring discretely, these pins can be reassigned as needed.
EN/DIAG Pins
These pins serve a dual purpose and are bi-directional. First they are the Enable pins for the device and are active HIGH. The module has pull-ups on these pins, so if left unconnected or set as inputs, the drivers will always be enabled. If the pins are being used to enable/disable the drivers, they need to be driven HIGH to enable the devices.
The second purpose they serve is to indicate a fault such as a thermal shutdown. If that should occur, the pins are driven LOW by the module. See the truth table in the datasheet below on page 15 for operation of the DIAG function.
Arduino to Shield EN/DIAG Pin Connections
- A0 = EN/DIAG 1
- A1 = EN/DIAG 2
Assembling the Board
We provide this board as a kit with male headers, stackable male/female headers as well as terminal blocks for power and motor connections. This gives you the flexibility to configure the board to use as a stand-alone, or as a shield that fits on top of an Arduino Uno, Mega 2560 or similar board with the ability to mount a daughter board on top or use jumpers.
If using the screw terminals for the motor connections, it is recommended to cut the pins off flush with the board before soldering. On some Arduino boards, the USB and ICSP connectors can come close to these pins, so cutting them off provides additional clearance.
If using as a shield, use some care to ensure the stackable header pins are held straight during the soldering process so that they will align with the Arduino female headers. It is generally easiest to insert the stackable headers into the shield and then insert those partway into the female headers on an Arduino to keep everything aligned. By inserting them only partway, that leaves more room for the soldering iron tip without melting the connectors. Flip the boards over and tack solder the end pins using a small soldering iron tip to keep the connectors in place and aligned. Carefully remove the shield and finish soldering all the pins from the bottom side of the board.
The male header pins are superfluous in most applications, but can be installed in place of the stackable headers if using the module mainly for breadboard testing or using point to point wiring.
OUR EVALUATION RESULTS:
These modules work very well and are straightforward to use for basic motor control.
Our test results for thermal performance vs motor current indicates that a constant current of 6-9A is about the most that can be pulled before some heat sinking is applied and will vary depending on the motor drive voltage being used. Tmax on the case is 150C. Below are some thermal results of the case temperature under different loads at constant current @ 12VDC.
2A = 35C
3A = 50C
4A = 65C
5A = 92C
6A = 115C
If using the devices with PWM, the current handling capability is higher. At 50% PWM, the current handling capability will be about double but the power delivered to the motors will be the same. These chips can also handle a fairly significant power on current surge of 20A for 8 seconds before they start to overheat.
If you want to optimize the power handling capability, adding a good heat sink and perhaps a fan blowing across it will give you some head room. If you are driving just one motor with it, you can parallel the two drivers which will basically double the current handling capability.
If you are familiar with the common L298N motor drivers, the basic control logic is very similar and is easy enough that a library is not needed to implement the software to control them though there are some libraries available up on GitHub if you want to go that route.
It does get a little more tricky when working with the DIAG (Diagnostics) functions. A review of the datasheet will help in understanding that function better. These can be nice to have features for incorporating feedback of the system status into your code. For instance, you can tell if a motor driver has gone into thermal shutdown.
The program below illustrates the basic use of this module. It allows the user to enter commands via the Serial Monitor window to control the functions of the motors.
- S = Stop motors
- F = Forward direction
- R = Reverse direction
- Pxxx = Sets the PWM speed from 0 (P0) to 255 (P255)
- P? = Returns the current PWM setting
Note that you can use upper or lower case letters when entering commands.
To run a basic test just plug the shield onto the Arduino Uno or similar MCU. Hook motor power of 5.5 to 16V up to the motor power terminal block and hook 2 DC motors up to the 2 motor terminal blocks. Download the code and start typing commands.
Note that the pin connections in the program are dictated by the shield and cannot be changed when using it as a shield.
VNH3SP30 Dual Monster Motor Driver Shield Example Program
/* Exercise Monster Motor Shield Uses Serial Monitor window to issue commands for controlling the DC motors connected to the shield S = Stop F = Forward R = Reverse C = Returns the current reading of the motors Pxxx (P0 - P255) sets the PWM speed value P? = Returns the current PWM value */ const int MOTOR_1 = 0; const int MOTOR_2 = 1; const int BRAKE = 0; const int CW = 1; const int CCW = 2; /* Note: the pin definitions below are set by the shield pinout. If using the board as a shield, these pins must remain as specified below. If wiring the board rather than using as a shield, these can be changed. */ const int MOTOR_A1_PIN = 7; //Motor 1 control inputs const int MOTOR_A2_PIN = 4; const int MOTOR_B1_PIN = 8; // Motor 2 control inputs const int MOTOR_B2_PIN = 9; const int PWM_MOTOR_1 = 5; const int PWM_MOTOR_2 = 6; //const int EN_PIN_1 = A0; //const int EN_PIN_2 = A1; int motor_Speed = 150; //default motor speed int motor_State = BRAKE; char readString[4]; // String array to hold PWM value typed in on keyboard //=============================================================================== // Initialization //=============================================================================== void setup() { pinMode(MOTOR_A1_PIN, OUTPUT); pinMode(MOTOR_B1_PIN, OUTPUT); pinMode(MOTOR_A2_PIN, OUTPUT); pinMode(MOTOR_B2_PIN, OUTPUT); pinMode(PWM_MOTOR_1, OUTPUT); pinMode(PWM_MOTOR_2, OUTPUT); //pinMode(EN_PIN_1, OUTPUT); // Uncomment these 4 lines to use the Enable pins //pinMode(EN_PIN_2, OUTPUT); // to enable/disable the device. // To monitor for fault conditions instead, they // would be defined as inputs // digitalWrite(EN_PIN_1, HIGH); // Set EN pins high to enable drivers // digitalWrite(EN_PIN_2, HIGH); Serial.begin(9600); // Initialize serial monitor Serial.println("Enter command:"); // Printout commands Serial.println("S = STOP"); Serial.println("F = FORWARD"); Serial.println("R = REVERSE"); Serial.println("Pxxx = PWM SPEED (P000 - P254)"); Serial.println("P? = RETURNS CURRENT PWM SPEED"); } //=============================================================================== // Main //=============================================================================== void loop() { // Just loop while monitoring the serial port and then jump to DoSerial to // handle incoming characters and act on them if (Serial.available()) DoSerial(); } //=============================================================================== // Subroutine to handle characters typed via Serial Monitor Window //=============================================================================== void DoSerial() { int index = 0; int pwm_Value = 0; char ch = Serial.read(); // Read the character we know we have Serial.println(ch); // Echo character typed to show we got it // Use Switch/Case statement to handle the different commands switch (ch) { case 'f': // Motor FORWARD command case 'F': // This fall-through case statement accepts upper and lower case motor_State = CW; Motor_Cmd(MOTOR_1, motor_State, motor_Speed); Motor_Cmd(MOTOR_2, motor_State, motor_Speed); Serial.println("Motors Forward"); break; case 'r': // Motor REVERSE command case 'R': motor_State = CCW; Motor_Cmd(MOTOR_1, motor_State, motor_Speed); Motor_Cmd(MOTOR_2, motor_State, motor_Speed); Serial.println("Motors Reverse"); break; case 's': // Motor STOP command case 'S': motor_State = BRAKE; Motor_Cmd(MOTOR_1, motor_State, 0); Motor_Cmd(MOTOR_2, motor_State, 0); Serial.println("Motors Stop"); break; case 'p': // Motor SPEED command case 'P': // This command is a little trickier. We are looking for a number from 0-255 // to follow this command so we can set the PWM speed. If we see a '?' // we will report our current speed setting, otherwise we start collecting chars // into the readString array. delay(2); // Give time for more characters to arrive. for (int i; i<4; i++) readString[i] = ' '; // Clear string array while (Serial.available()) // Read what we get and put into the string array { char c = Serial.read(); readString[index] = c; index++; delay(2); } readString[3] = '\0'; // Append null to end of string array to make it a valid string index = 0; // Reset our index back to the start of the string if (readString[index] == '?') // ? means report our current speed setting and exit. { Serial.print("Current PWM Setting: "); Serial.println(motor_Speed); break; } pwm_Value = atoi(readString); // Try to convert string into integer // We assume a 0 value is because of a non-valid input and ignore the command if(pwm_Value!=0) { if (pwm_Value > 255) pwm_Value = 255; // Cap WPM setting at 255 Serial.println(pwm_Value); // Echo what we end up with to confirm we got it motor_Speed = pwm_Value; Motor_Cmd(MOTOR_1, motor_State, motor_Speed); Motor_Cmd(MOTOR_2, motor_State, motor_Speed); } break; default: break; } } void Motor_Cmd(int motor, int DIR, int PWM) //Function that writes to the motors { if(motor == MOTOR_1) { if(DIR == CW) { digitalWrite(MOTOR_A1_PIN, LOW); digitalWrite(MOTOR_B1_PIN, HIGH); } else if(DIR == CCW) { digitalWrite(MOTOR_A1_PIN, HIGH); digitalWrite(MOTOR_B1_PIN, LOW); } else { digitalWrite(MOTOR_A1_PIN, LOW); digitalWrite(MOTOR_B1_PIN, LOW); } analogWrite(PWM_MOTOR_1, PWM); } else if(motor == MOTOR_2) { if(DIR == CW) { digitalWrite(MOTOR_A2_PIN, LOW); digitalWrite(MOTOR_B2_PIN, HIGH); } else if(DIR == CCW) { digitalWrite(MOTOR_A2_PIN, HIGH); digitalWrite(MOTOR_B2_PIN, LOW); } else { digitalWrite(MOTOR_A2_PIN, LOW); digitalWrite(MOTOR_B2_PIN, LOW); } analogWrite(PWM_MOTOR_2, PWM); } }
BEFORE THEY ARE SHIPPED, THESE MODULES ARE:
- Inspected & kitted
- Packaged in quality resealable ESD bags for safe storage.
Notes:
- None
Technical Specifications
Operating Ratings | ||
Voltage Range | Motors | 5.5 – 16VDC |
Max Current per bridge | Peak | 30A |
Sustained without heat sinking | 6-9A | |
Sustained with adequate heat sinking | 12-14A | |
MOSFET | ON resistance (per leg) | 34mΩ (typ) |
Max PWM Frequency | 10kHz | |
Dimensions | ||
Driver Board (L x W) | 61 x 54mm (2.4 x 2.1″) | |
Datasheet | ST Microelectronics | VNH3SP30-E |