

The TB12FNG is a motor driver IC designed to control both DC motors and stepper motors. It is equipped with high current handling capabilities, enabling efficient and reliable motor control. This component is widely used in applications such as robotics, automation systems, and other projects requiring precise motor direction and speed control. Its compact design and versatile functionality make it an excellent choice for hobbyists and professionals alike.








The TB12FNG motor driver IC is designed to handle a wide range of motor control tasks. Below are its key technical details:
The TB12FNG has 24 pins, each serving a specific function. Below is the pin configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply for the motor driver (4.5V to 13.5V) |
| 2 | OUT1 | Output for motor winding 1 |
| 3 | OUT2 | Output for motor winding 2 |
| 4 | GND | Ground |
| 5 | IN1 | Input signal to control OUT1 |
| 6 | IN2 | Input signal to control OUT2 |
| 7 | PWM1 | PWM input for speed control of OUT1 |
| 8 | PWM2 | PWM input for speed control of OUT2 |
| 9 | ENABLE | Enable/disable the motor driver |
| 10 | VM | Motor power supply (connect to motor voltage) |
| 11-24 | NC | Not connected |
The TB12FNG motor driver is straightforward to use in motor control circuits. Below are the steps and considerations for using this component effectively:
Power Supply:
Motor Connections:
Control Inputs:
Enable Pin:
Below is an example of how to connect and control a DC motor using the TB12FNG and an Arduino UNO:
// Example code to control a DC motor using TB12FNG and Arduino UNO
#define IN1 8 // Define IN1 pin
#define IN2 9 // Define IN2 pin
#define PWM1 10 // Define PWM1 pin
#define ENABLE 7 // Define ENABLE pin
void setup() {
pinMode(IN1, OUTPUT); // Set IN1 as output
pinMode(IN2, OUTPUT); // Set IN2 as output
pinMode(PWM1, OUTPUT); // Set PWM1 as output
pinMode(ENABLE, OUTPUT); // Set ENABLE as output
digitalWrite(ENABLE, HIGH); // Enable the motor driver
}
void loop() {
// Rotate motor in one direction
digitalWrite(IN1, HIGH); // Set IN1 high
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(PWM1, 128); // Set motor speed (0-255)
delay(2000); // Run for 2 seconds
// Rotate motor in the opposite direction
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, HIGH); // Set IN2 high
analogWrite(PWM1, 128); // Set motor speed (0-255)
delay(2000); // Run for 2 seconds
}
Motor Not Spinning:
Overheating:
Erratic Motor Behavior:
Q: Can the TB12FNG drive two DC motors simultaneously?
A: No, the TB12FNG is designed to drive a single DC motor or a single stepper motor.
Q: What is the recommended PWM frequency for speed control?
A: A PWM frequency between 1 kHz and 20 kHz is recommended for optimal performance.
Q: Does the TB12FNG support reverse polarity protection?
A: No, external circuitry is required to protect against reverse polarity.
By following this documentation, users can effectively integrate the TB12FNG motor driver into their projects for precise and reliable motor control.