Wiring them together
After mounting the Arduino board, you can start to wire it with the motor driver and the ESP01.
Connecting the Arduino with motor driver
You can wire each pin of the motor driver with Arduino as follows:
- Motor Driver AIN1 -> Arduino Digital Pin 2
- Motor Driver BIN1 -> Arduino Digital Pin 7
- Motor Driver AIN2 -> Arduino Digital Pin 4
- Motor Driver BIN2 -> Arduino Digital Pin 8
- Motor Driver PWMA -> Arduino Digital Pin (PWM) 5
- Motor Driver PWMB -> Arduino Digital Pin (PWM) 6
- Motor Driver STBY -> Arduino Digital Pin 9
Connecting the motors with the motor driver
You will need the SparkFun Motor Driver - Dual TB6612FNG (1A) to drive the two motors. Figure 2.17 shows the wiring diagram that you can follow to make connections between the two motors and the motor driver:
Figure 2.17: Connecting the two motors with the motor driver
- Connect the left motor with the A01 and A02 pads of TB6612FNG.
- Connect the right motor with the B01 and B02 pads of TB6612FNG.