Motordriver voor Arduino om twee DC-motoren met PWM aan te sturen en stand-bycontrole te gebruiken.
SKU: OT2065-A44 Número do artigo: NA272 EAN: 8720589817388 Localização: AD04.05
Alternativa
Driver de motor de passo TB6600 para Nema 17/23/34 | 9-42V 4A
€ 11,95
Ver esta alternativa
Como ligar o Módulo controlador de motor TB6612FNG para Arduino a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.
This project controls a DC motor channel using the dual H-bridge TB6612FNG driver. The sketch enables the driver via the standby pin and alternates running the motor forward, stopping, and running in reverse with PWM speed control. Open the Serial Monitor at 115200 baud to observe the operating status.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : TB6612FNG Dual Motor Driver Control
* Board : Arduino UNO (arduino:avr:uno)
* Parts : TB6612FNG Motor Driver
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
const int PIN_PWMA = 5;
const int PIN_STBY = 6;
const int PIN_AIN1 = 7;
const int PIN_AIN2 = 8;
void setup() {
Serial.begin(115200);
pinMode(PIN_PWMA, OUTPUT);
pinMode(PIN_STBY, OUTPUT);
pinMode(PIN_AIN1, OUTPUT);
pinMode(PIN_AIN2, OUTPUT);
// Take driver out of standby mode
digitalWrite(PIN_STBY, HIGH);
Serial.println(F("TB6612FNG Motor Driver Initialized"));
}
void driveMotorA(bool forward, int speed) {
speed = constrain(speed, 0, 255);
if (forward) {
digitalWrite(PIN_AIN1, HIGH);
digitalWrite(PIN_AIN2, LOW);
Serial.print(F("Motor Forward at speed: "));
} else {
digitalWrite(PIN_AIN1, LOW);
digitalWrite(PIN_AIN2, HIGH);
Serial.print(F("Motor Reverse at speed: "));
}
analogWrite(PIN_PWMA, speed);
Serial.println(speed);
}
void stopMotorA() {
analogWrite(PIN_PWMA, 0);
digitalWrite(PIN_AIN1, LOW);
digitalWrite(PIN_AIN2, LOW);
Serial.println(F("Motor Stopped"));
}
void loop() {
// Drive forward at speed 200
driveMotorA(true, 200);
delay(2000);
// Stop
stopMotorA();
delay(1000);
// Drive reverse at speed 200
driveMotorA(false, 200);
delay(2000);
// Stop
stopMotorA();
delay(1000);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project demonstrates controlling a DC motor using the TB6612FNG dual H-bridge motor driver and an ESP32. The sketch enables the driver via the STBY pin and cycles motor channel A through forward rotation, deceleration, reverse rotation, and braking. Open the Serial Monitor at 115200 baud to view the current motor state and speed.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : TB6612FNG Motor Driver with ESP32
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : TB6612FNG Motor Driver
* Libraries : none (built-in)
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
// TB6612FNG Dual H-Bridge Motor Driver Demo on ESP32
const int PIN_STBY = 13;
const int PIN_AIN1 = 12;
const int PIN_AIN2 = 14;
const int PIN_PWMA = 27;
void setup() {
Serial.begin(115200);
pinMode(PIN_STBY, OUTPUT);
pinMode(PIN_AIN1, OUTPUT);
pinMode(PIN_AIN2, OUTPUT);
pinMode(PIN_PWMA, OUTPUT);
// Enable driver
digitalWrite(PIN_STBY, HIGH);
Serial.println("TB6612FNG Motor Driver Initialized");
}
void driveMotor(bool forward, int speed) {
if (forward) {
digitalWrite(PIN_AIN1, HIGH);
digitalWrite(PIN_AIN2, LOW);
} else {
digitalWrite(PIN_AIN1, LOW);
digitalWrite(PIN_AIN2, HIGH);
}
analogWrite(PIN_PWMA, constrain(speed, 0, 255));
}
void stopMotor() {
digitalWrite(PIN_AIN1, LOW);
digitalWrite(PIN_AIN2, LOW);
analogWrite(PIN_PWMA, 0);
}
void loop() {
// Forward acceleration
Serial.println("Motor Forward: Accelerating");
for (int spd = 50; spd <= 255; spd += 25) {
driveMotor(true, spd);
delay(150);
}
delay(1000);
// Stop
Serial.println("Motor Stop");
stopMotor();
delay(1000);
// Reverse acceleration
Serial.println("Motor Reverse: Accelerating");
for (int spd = 50; spd <= 255; spd += 25) {
driveMotor(false, spd);
delay(150);
}
delay(1000);
// Stop
Serial.println("Motor Stop");
stopMotor();
delay(2000);
}
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Características:
1. Controlo de standby para poupar energia.
2. Modos de controlo do motor CW / CCW / travagem curta / stop.
3. Circuito de desligamento térmico integrado e circuito de deteção de baixa tensão.
Descrição:
O driver de motor TB6612FNG pode controlar até dois motores DC com uma corrente constante de 1,2 A (3,2 A de pico). Dois sinais de entrada (IN1 e IN2) podem ser usados para controlar o motor em um dos quatro modos de funcionamento: sentido horário, sentido anti-horário, travagem curta e stop. As duas saídas do motor (A e B) podem ser controladas separadamente, a velocidade de cada motor é regulada através de um sinal de entrada PWM com uma frequência até 100 kHz. O pino STBY deve ser puxado para nível alto para tirar o motor do modo de standby.
A tensão de alimentação lógica (VCC) pode estar na faixa de 2,7-5,5 VDC, enquanto a alimentação do motor (VM) é limitada a uma tensão máxima de 15 VDC. A corrente de saída é nominal até 1,2 A por canal (ou até 3,2 A para um pulso curto e único).
A placa é fornecida com todos os componentes como mostrado, incluindo os pinos header.
Especificações:
Tensão de alimentação: VM = 15V máx, VCC = 2,7-5,5V
Corrente de saída: Iout = 1,2 A (média) / 3,2 A (pico)
Dimensões
Comprimento: 2cm
Largura: 2cm
Altura: 0,3cm

| Largura | 2 cm |
|---|---|
| Comprimento | 2 cm |
| Tensão de alimentação | VM = 15V máx, VCC = 2,7-5,5V |
| Frequência | 100 kHz |
| Altura | 0,3 cm |
| Corrente de saída | Iout = 1,2 A / 3,2 A |
Ainda sem avaliações.
Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.
Tudo sobre devoluções
Módulo controlador de motor TB6612FNG para Arduino