

The WeMos D1 Mini Motor Shield is a compact motor driver shield designed specifically for the WeMos D1 Mini development board. It enables users to control DC motors and stepper motors with ease, making it ideal for robotics, automation, and other motor-driven projects. The shield supports PWM (Pulse Width Modulation) control for precise speed and direction management and is fully compatible with the Arduino IDE for programming.








The WeMos D1 Mini Motor Shield connects directly to the WeMos D1 Mini board. Below is the pin configuration:
| Pin | Description |
|---|---|
| AIN1 | Input for Motor A direction control |
| AIN2 | Input for Motor A direction control |
| BIN1 | Input for Motor B direction control |
| BIN2 | Input for Motor B direction control |
| PWMA | PWM input for Motor A speed control |
| PWMB | PWM input for Motor B speed control |
| VM | Motor power supply (2.5V to 12V) |
| GND | Ground |
Below is an example code snippet to control two DC motors using the WeMos D1 Mini Motor Shield:
// Include the Arduino library for motor control
#define AIN1 D1 // Motor A direction control pin 1
#define AIN2 D2 // Motor A direction control pin 2
#define PWMA D3 // Motor A speed control (PWM) pin
#define BIN1 D4 // Motor B direction control pin 1
#define BIN2 D5 // Motor B direction control pin 2
#define PWMB D6 // Motor B speed control (PWM) pin
void setup() {
// Set motor control pins as outputs
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
pinMode(PWMA, OUTPUT);
pinMode(BIN1, OUTPUT);
pinMode(BIN2, OUTPUT);
pinMode(PWMB, OUTPUT);
}
void loop() {
// Motor A: Forward at 50% speed
digitalWrite(AIN1, HIGH);
digitalWrite(AIN2, LOW);
analogWrite(PWMA, 128); // PWM value (0-255)
// Motor B: Backward at 75% speed
digitalWrite(BIN1, LOW);
digitalWrite(BIN2, HIGH);
analogWrite(PWMB, 192); // PWM value (0-255)
delay(2000); // Run motors for 2 seconds
// Stop both motors
analogWrite(PWMA, 0);
analogWrite(PWMB, 0);
delay(2000); // Wait for 2 seconds
}
Motors Not Running:
Motors Running in the Wrong Direction:
Overheating:
PWM Control Not Working:
Q: Can I control a stepper motor with this shield?
A: Yes, the shield can control a single stepper motor by using both motor channels (Motor A and Motor B). You will need to write or use a stepper motor control library for precise control.
Q: Is the shield compatible with other boards?
A: The shield is designed for the WeMos D1 Mini but may work with other boards that have a similar pinout and logic voltage (3.3V).
Q: What is the maximum PWM frequency supported?
A: The shield supports PWM frequencies up to 100 kHz, which is sufficient for most motor control applications.