DRV8833 Motor Driver Module
This module is much more efficient than the traditional L298N, and its size is significantly reduced. Within the rated range, the chip hardly generates heat, making it more delicate. Therefore, we recommend it for users with some hands-on experience. Please be extra careful when wiring, paying close attention to the polarity.
The DRV8833 motor driver module can directly replace the TB6612 driver module as the pins are mostly fully compatible.
Module Source
Specifications
VM Motor Voltage: <12V
VCC Chip Voltage: 2.7~5.5V
Output Current: 1A
Control Method: PWM
Instructions for Use
The STBY pin is connected to the microcontroller's IO pin. When STBY is set to 0, the motors will stop completely, and they will only work when STBY is set to 1. Once STBY is set to 1, the motor's forward and reverse directions are controlled through AIN1, AIN2, BIN1, and BIN2.
The A side (AIN1 and AIN2) can only control the AO1 and AO2 pins, while the B side (BIN1 and BIN2) can only control the BO1 and BO2 pins. Therefore, it is a dual-channel motor driver. The speed is controlled by the PWM duty cycle, which adjusts the motor speed through the duty cycle.
Hardware Connection
Hardware Connection
The main pins of the DRV8833 driver module include: VM, GND, xIN1, xIN2, xOUT1, xOUT2, (where x can be A or B for different drive channels).
- VM connects to the motor power supply (make sure the voltage matches your motor's specifications).
- GND Connects to the Arduino's GND and the power supply's GND.
- AIN1 and AIN2 control the motor direction and speed of channel A. They are connected to the PWM output pins of the development board.
- BIN1 and BIN2 control the motor direction and speed of channel B, and are also connected to the PWM output pins of the development board.
- AOUT1, AOUT2 are connected to the two endpoints of motor A. BOUT1, BOUT2 are connected to the PWM output pins on the development board.
- BOUT1, BOUT2 are connected to the two endpoints of Motor B.
The following wiring is adapted to this example:
Usage Method
The following is a basic routine for controlling a TB6612FNG module to drive a DC motor using the development board. This example only shows controlling one motor; to control a second motor, simply repeat the setup and use BIN1, BIN2.
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: April 12, 2024
* Function Overview:
*****************************************************************************
* Open-source development board hardware and software information and related projects hardware and software information on official website
* Development board official website: www.lckfb.com
* Technical support resident forum, any technical problems are welcome at any time to exchange learning
* LCSC Forum: club.szlcsc.com
* Follow our Bilibili account: [立创开发板], stay toned to our latest news!
* We focus on cultivating Chinese engineers rather than profiting from board sales.
******************************************************************************/
#define AIN1 5
#define AIN2 6
void setup() {
// 设置AIN1, AIN2为输出模式
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
}
void loop() {
// 电机正转
analogWrite(AIN1, 255); // 使用PWM控制速度,0 (停止) 到 255 (最大速度)
analogWrite(AIN2, 0); // 使用PWM控制速度,0 (停止) 到 255 (最大速度)
delay(1000); // 电机运行1秒
// 电机停止
analogWrite(AIN1, 255);
analogWrite(AIN2, 255);
delay(1000); // 停止1秒
// 电机反转
analogWrite(AIN1, 0);
analogWrite(AIN2, 255);// 改变PWM值可以控制速度
delay(1000); // 电机运行1秒
// 可以在这里添加更多的控制逻辑
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42