PWM-Based Design of DC Motor Speed and Direction Control System Using STM32 Microcontroller

Authors

  • Akshay Jangid Department of Electronics and Communication, Chandigarh University, India Author
  • Harsh Rathore Department of Electronics and Communication, Chandigarh University, India Author
  • Ajay Yadav Department of Electronics and Communication, Chandigarh University, India Author
  • Sukhpreet Singh Department of Electronics and Communication, Chandigarh University, India Author

Keywords:

STM32 microcontroller, pulse-width modulation (PWM), H-bridge motor driver, bidirectional motor control, embedded system design, real-time user interface, TouchGFX graphical framework, USB-CDC communication protocol.

Abstract

This paper presents a comprehensive design and implementation of a DC motor control system that utilises an STM32 microcontroller to achieve precise speed regulation through pulse-width modulation (PWM), integrates an H-bridge driver circuit for bidirectional motor operation, and incorporates a versatile user interface for real-time adjustment of both speed and direction. The STM32’s advanced timer peripherals are configured to generate high-frequency PWM signals (20–25 kHz), enabling fine-grained control of the motor’s effective voltage and delivering smooth performance across the entire duty-cycle range. Bidirectional control is accomplished using an H-bridge driver—such as the DRV8833 or DRV887x—which interprets complementary logic inputs to transition seamlessly between forward, reverse, coasting, and braking modes. This ensures safe switching, minimal electrical stress, and stable dynamic response during direction changes. The user interface component is designed to support multiple interaction modalities, including: (i) an analog potentiometer paired with a direction toggle switch for intuitive hardware-based control, (ii) a USB-CDC (Virtual COM Port) interface enabling PC-based control through sliders or command-line inputs, and (iii) a touchscreen interface developed using TouchGFX, providing an embedded graphical slider and direction toggle for enhanced usability. The key contributions of this work include the seamless integration of PWM-based speed regulation, robust and responsive H-bridge direction control, and flexible multi-modal user interaction. Experimental evaluation demonstrates smooth low-speed performance—with optional decay-mode tuning—fast and reliable direction switching, and effective real-time response across all user interface options. Overall, this system provides a modular, scalable, and educationally valuable framework suitable for applications in robotics, industrial automation, and embedded mechatronics. [1]

Downloads

Published

13-03-2026

How to Cite

Jangid, A. ., Rathore, H. ., Yadav, A. ., & Singh , S. . (2026). PWM-Based Design of DC Motor Speed and Direction Control System Using STM32 Microcontroller. DMPedia Lecture Notes in Multidisciplinary Research, IMPACT26, 997-1008. https://digitalmanuscriptpedia.com/conferences/index.php/DMP-LNMR/article/view/52