🛠 First connection and startup of the 4-Encoder Motor Driver

Unit 4-Encoder Motor Driver (DRV8837DSGR) · intermediaire · Guide étape par étape pour alimenter, connecter les moteurs et initialiser le module DRV8837DSGR via I2C.

Objectives

This tutorial guides you through the initial setup of the 4-Encoder Motor Driver (DRV8837DSGR). The goal is to understand the power architecture, correctly connect an encoder motor, and verify I2C communication with an M5Stack host. We will cover the distinction between logic and motor power, which is crucial for preventing failures.

Required Materials

Steps

  1. Host Preparation: Install the host board on your computer and verify that the serial port driver is recognized. Ensure the base firmware is flashed.
  2. I2C Connection: Connect the host's Grove I2C port to one of the two Grove HY2.0-4P ports on the Motor Driver Unit. The default I2C address is 0x24.
  3. Motor Powering: For a simple first test, you can use the 5V power via the Grove port if the motor is small. However, to avoid voltage drops, it is recommended to use the external DC input (6-12V) on the dedicated connector. The integrated DC-DC converter regulates this voltage for the motors and can power the host if configured.
  4. Motor Wiring: Identify the motor wires. The 6 wires are divided into two pairs for current (motor) and two pairs for the encoder. Connect the motor pair to the M1+ and M1- terminals of the PH2.0-6P connector. Connect the encoder pair to the corresponding A and B terminals. Respect polarity for consistent rotation direction.
  5. Hardware Verification: The WS2812C RGB LED on the module usually lights up blue or green upon successful initialization, indicating that the STM32 microcontroller is receiving logic power.

Verification

To confirm communication, use a simple I2C scanner via the Arduino IDE or UIFlow. If address 0x24 appears in the list of detected devices, the physical link is correct. You can then send a test command to spin the motor at a low speed. If the motor does not spin, check the external power supply voltage and the PH2.0 connector connections.

Going Further

Once the connection is validated, explore advanced control modes such as closed-loop speed regulation. You can then configure the I2C address if you are using multiple modules on the same bus.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials