DC motors driver with encoder based on ESP32-S3



Smart Motor Driver is a dual-channel DC motor controller with encoders, designed for precise motion control in applications such as home automation, robotics, mechatronics, and positioning systems. At its core is the ESP32-S3, a powerful microcontroller with Wi-Fi connectivity, offering extensive integration possibilities with control systems, including Home Assistant, thanks to full ESPHome compatibility.
๐ง Key technical features:
- โ๏ธ Supports two DC motors with quadrature encoders
- โก Supply voltage range: 8โ36 V
- ๐ Up to 800 mA per channel โ ideal for JGA25-370 type drives
- ๐ง ESP32-S3 on board โ full flexibility for firmware (ESPHome, Arduino, custom solutions)
- ๐ Compact size: 56 ร 50 mm
Advanced motors control
Each channel is equipped with a full H-bridge implemented using the DRV8801, which allows:
- Smooth motor speed control via PWM
- Direction selection
- Active braking
- Hardware protections: short-circuit, thermal, overvoltage, and overcurrent safeguards
Limit switch support
Each channel has two independent limit switch inputs, allowing protection of the driveโs end positions (up/down, left/right, open/closed). The inputs can operate in two modes:
- ๐ Digital (ON/OFF) โ for classic mechanical or optical limit switches
- ๐ Analog with adjustable threshold โ e.g., for magnetic sensors with voltage output or phototransistors
This solution enables precise and flexible adaptation of the limit system to different types of drives and operating environments.
Advanced motion control โ ready-to-use ESPHome firmware
Smart Motor Driver comes with ESPHome firmware, enabling full integration with Home Assistant and providing smart servo functionality:
- ๐ Dual-loop PID controller:
- Position loop (external) โ precise positioning
- Velocity loop (internal) โ motion stabilization and smoothness
- ๐งฎ Trajectory planner โ dynamically generates ramps (acceleration, max speed, movement duration)
- ๐ก Live encoder position reading โ actual, non-estimated measurement
- ๐ Channel motion synchronization โ coordinated control of two motors (e.g., simultaneous raising of a dual awning)
Firmware available on: https://github.com/IoTLabs-pl/Smart-Motor-Driver
Applications
The primary intended use of the Smart Motor Driver is controlling blinds, awnings, and curtains, where precise position control, motion synchronization, and remote integration with smart home systems are required.
Thanks to real-time position feedback from quadrature encoders, it is possible to determine the exact drive position without relying on time-based estimation. This significantly improves accuracy, repeatability, and system safety.
- ๐ช Automatic blinds, shutters, awnings, curtains
- ๐ค Mobile robots and manipulators
- ๐๏ธ Rotating platforms, linear guides, XY systems
- ๐ Smart home systems (Home Assistant, ESPHome)
- ๐ Educational projects and prototyping in mechatronics and IoT