The IBT-2 H-Bridge Motor Driver is a robust electronic component designed for controlling DC motors' direction and speed. It is capable of driving high-power motors in both forward and reverse directions. This makes it an ideal choice for robotics, automation projects, and any application requiring bidirectional motor control.
Pin Number | Pin Name | Description |
---|---|---|
1 | RPWM | Right PWM input for motor speed and direction |
2 | LPWM | Left PWM input for motor speed and direction |
3 | R_EN | Right Enable input |
4 | L_EN | Left Enable input |
5 | Vcc | Power supply for motor (6V to 27V) |
6 | GND | Ground |
7 | B+ | Motor power supply positive |
8 | B- | Motor power supply negative |
Power Connections:
Control Connections:
// Define the control pins for the IBT-2
const int RPWM = 3; // Right PWM pin connected to Arduino pin 3
const int LPWM = 5; // Left PWM pin connected to Arduino pin 5
const int R_EN = 4; // Right Enable pin connected to Arduino pin 4
const int L_EN = 6; // Left Enable pin connected to Arduino pin 6
void setup() {
// Set all the control pins as outputs
pinMode(RPWM, OUTPUT);
pinMode(LPWM, OUTPUT);
pinMode(R_EN, OUTPUT);
pinMode(L_EN, OUTPUT);
// Enable the motor driver
digitalWrite(R_EN, HIGH);
digitalWrite(L_EN, HIGH);
}
void loop() {
// Spin motor forward at full speed
analogWrite(RPWM, 255); // Full speed forward
analogWrite(LPWM, 0); // Ensure LPWM is low
delay(2000); // Run for 2 seconds
// Spin motor in reverse at half speed
analogWrite(RPWM, 0); // Ensure RPWM is low
analogWrite(LPWM, 127); // Half speed reverse
delay(2000); // Run for 2 seconds
// Stop the motor
analogWrite(RPWM, 0);
analogWrite(LPWM, 0);
delay(2000); // Stop for 2 seconds
}
Q: Can I control two motors with one IBT-2? A: No, the IBT-2 is designed to control one motor. For two motors, you would need two IBT-2 modules.
Q: What is the maximum PWM frequency for the IBT-2? A: The IBT-2 can handle PWM frequencies up to 25kHz.
Q: How do I reverse the motor direction? A: To reverse the motor direction, invert the PWM signals: apply the PWM signal to LPWM for forward and RPWM for reverse.
Q: Can I use the IBT-2 with a microcontroller running at 3.3V logic? A: While the IBT-2 is designed for 5V logic, it may work at 3.3V. However, it is recommended to use a logic level converter for reliable operation.