Getting Started

This section lists common failures and troubleshooting guidance for the N20 UART motor module, including initialization failure, communication issues, power supply, wiring and parameter configuration checks.

Frequently Asked Questions

Q1: Motor initialization failed, serial port keeps printing "Motor initialization failed, retrying..."

Troubleshooting steps:

  1. Check if TX/RX of UART are wired in reverse Motor module pin definition: R = Module RX (Receive), T = Module TX (Transmit); Wiring rule: Main controller TX → Motor R; Main controller RX → Motor T. Reversed wiring will result in complete communication failure and initialization failure.

  2. Check for sufficient power supply, and common GND is required Module operating voltage: DC 3.7‑5V.

    • For single motor: Make sure the input voltage is within 3.7‑5V;
    • For multiple motors in parallel: An independent external power supply is required for the motors. GND of the motor power supply, external power supply and main controller must be connected together. Communication exceptions will occur if only signal wires are connected without shared GND;
    • The current will rise when the motor is stalled. If the LDO of the main controller cannot supply enough current, the module will work abnormally. Independent power supply is recommended for multi-motor scenarios.
  3. Verify the Modbus slave address matches

    • The MOTOR_ADDR defined in your code must be identical to the actual address of the motor;
    • If you forget the motor address, upload the address scanner example sketch to scan the bus and read the real address of the motor on the bus;
    • Valid address range: 1‑247. Address 0 is not allowed.
  4. Confirm baud rate and hardware serial port selection are correct

    • Factory default baud rate: 9600, 8 data bits, 1 stop bit, no parity. The serial port configuration in your code must match the module;
    • For ESP32: Double-check the pin assignment for hardware Serial1. Do NOT use the USB virtual Serial for motor communication;
    • If you have changed the baud rate, the module must be power-cycled for new settings to take effect, and update the baud rate in your code accordingly.
  5. If the above checks do not work, call restoreFactory() to restore factory settings, power cycle the motor module and test again.

Q2: No motor rotation after sending commands

  1. Make sure the initialization return value is 0 (initialization succeeded). Speed commands like setSpeed() will not work if initialization fails;
  2. Valid speed range: ‑255 ~ 255. 0 means stop;
  3. Recheck power supply voltage. Voltage drop under heavy load may prevent motor rotation;
  4. For multi-motor bus connection: Maximum 4 motors on one bus. More motors will cause unstable communication.

Q3: Cannot communicate with the motor after changing address / baud rate

New address and baud rate are saved to register, but they only take effect after power cycling the motor module. After reboot, update the address and baud rate in your controller code to match the new settings. If you lose the parameters after modification, connect the motor via USB-to-TTL and run the address scanner sketch. Alternatively, send factory reset command, then power cycle to restore default: address 1, baud rate 9600.

Q4: Some motors do not respond on a multi-motor bus

  1. Connect T, R, +, ‑ of all motors in parallel, and share a common GND;
  2. Each motor on the bus must have a unique Modbus address;
  3. It is recommended to power all motors with one independent external power supply. Do not power motors directly from IO pins of the main controller;
  4. Keep bus wiring short. Long cables cause signal attenuation, packet loss and no response.

Was this article helpful?

TOP