• Nvis Technology
  • Nvis Technology
  • Nvis Technology
  • Nvis Technology
  • Nvis Technology
  • Nvis Technology
Nvis Technology

Head Office

141-A, Electronic complex, Pardesipura,Indore - 452010 India

Phone: +91 73899 00887 , +91 98932 70303

Email:info@nvistech.com

Request a Quote

Looking for a quality and affordable builder for your next project?




    Nvis Technology

    Toll Free

    +91 73899 00887

    We are happy to meet you during our working hours. Please make an appointment.

    • Monday-Saturday: 9:00 AM - 5:30 PM (IST)
    • Sunday: Closed

    Motor Control Using Microcontroller: PWM, H Bridge and Interfacing Basics

    TL;DR

    1. This blog is for ECE, EEE, and mechatronics students, freshers, and GATE or SSC JE aspirants who want to understand motor control using microcontroller techniques from ground up.
    2. Many motor-control applications need control over two key parameters: speed and direction. A microcontroller cannot supply current a motor needs, so it relies on PWM signals and an H bridge circuit to do its job safely.
    3. PWM (Pulse Width Modulation) controls motor speed by rapidly switching power on and off, while H bridge controls direction by reversing current flow through the motor.
    4. The term “motor control” is also used in industrial electrical systems, where a Motor Control Center (MCC) panel controls and protects multiple motors. This is different from microcontroller-based motor control and is explained later for clarity.
    5. Understanding this topic well can open doors to embedded systems, robotics, EV, and industrial automation roles at companies and PSUs like ISRO, DRDO, BHEL, and Tata Motors, along with strong marks in GATE and SSC JE papers.

    Motor control is an important part of many robotics, automation, embedded, and mechatronics projects. A microcontroller determines when to start a motor, how fast to spin it and in which direction, but it cannot do this on its own. It requires two concepts: Pulse Width Modulation (PWM) to control speed, and an H bridge circuit to control direction. This blog explains both concepts in plain english, goes over a worked numerical example and even clears up a common point of confusion between motor control with a microcontroller and a Motor Control Center (MCC) panel in industrial plants, both of which are frequently mentioned in electrical engineering courses and papers.

    Also read,

    Why Can’t a Microcontroller Drive a Motor Directly?

    Imagine a microcontroller pin as a small control switch. It can send a signal to tell another circuit when to turn on or off, but it cannot supply the large amount of current needed to drive a motor directly. A motor driver acts as the power-handling stage between the microcontroller and the motor. The microcontroller sends a 3.3V or 5V control signal to the driver, while the driver handles the higher current required by the motor.

    A DC motor can draw a much higher current during startup than during normal operation because the motor initially has little or no back EMF. This startup or stall current can be several times the motor’s normal running current. When a motor is connected directly to a pin on a microcontroller, it is not being powered. You’re cooking your microcontroller.

    That is why a microcontroller-based motor-control system normally uses a motor-driver or power-switching stage between the microcontroller and the motor. Depending on the motor and required control, this stage may use an H bridge, half-bridge, MOSFETs, or another suitable driver circuit. PWM may then be used to control speed.

    What Is PWM and How Does It Control Motor Speed?

    Imagine you are filling a bucket using a tap that only has two positions: fully open or fully closed. You cannot set it to a gentle trickle. But if you open and close that tap very quickly, say open for 7 seconds and closed for 3 seconds, every 10 seconds, the bucket still fills up, just at 70 percent of tap’s maximum flow rate. That is the entire idea behind Pulse Width Modulation.

    PWM works by switching a digital output on and off at a fixed frequency, and the proportion of time it stays on during each cycle is called duty cycle. The motor does experience the individual switching pulses, but its electrical and mechanical dynamics prevent its current, torque, and speed from following each switching transition instantaneously. Because the motor’s electrical and mechanical characteristics smooth the switching waveform, PWM produces an average effect on motor current and torque. For basic calculations, the average applied voltage is often approximated as

    Vavg​=Vs​D.

    relationship is refreshingly simple:

    Average Voltage = Supply Voltage × Duty Cycle

    So if a 12V motor is driven with a 60% PWM duty cycle, the **average terminal voltage over a PWM cycle** is approximately 7.2V under ideal switching conditions. However, the motor’s actual speed will not necessarily be exactly 60% of its full-speed value because speed also depends on load, motor characteristics, back EMF, winding resistance, and the driver circuit. Increase the duty cycle and the motor will generally speed up under the same load. Decrease it and the motor will generally slow down. PWM switching can be much more efficient than using a linear voltage-control method, although the motor, switching devices, wiring, and driver still have power losses.

    Worked Numerical Example on PWM Duty Cycle

    This is a useful practice problem because it combines duty cycle, switching frequency, and average-voltage calculations that are relevant to power-electronics fundamentals.

    Question: A DC motor is rated for 24 V. It is being driven by a PWM signal at a switching frequency of 1 kHz with a duty cycle of 65%. Calculate the average voltage applied to the motor and the corresponding on-time of each PWM pulse.

    Step 1: Calculate average voltage. Average Voltage = Supply Voltage × Duty Cycle Average Voltage = 24V × 0.65 Average Voltage = 15.6V

    Step 2: Calculate total time period of one PWM cycle. Time Period (T) = 1 / Frequency T = 1 / 1000 Hz T = 1 millisecond (1 ms)

    Step 3: Calculate on time using duty cycle. On Time = Duty Cycle × Time Period On Time = 0.65 × 1 ms On Time = 0.65 ms (or 650 microseconds)

    So in every 1 millisecond cycle, the motor receives a full 24V pulse for 0.65 ms and 0V for remaining 0.35 ms,giving an average terminal voltage of 15.6V over each PWM cycle under ideal switching conditions. This single formula, average voltage equals supply voltage multiplied by duty cycle, is worth memorizing cold for exams, since this type of duty-cycle and average-voltage calculation is useful for power-electronics fundamentals and exam preparation.

    What Is an H Bridge and Why Does Direction Control Need One?

    Speed is only half a story. Most real applications, robots that reverse, wipers that go back and forth, elevators that go up and down, also need motors to spin in both directions. This is where the H bridge comes in.

    Picture four gates arranged in the shape of letter H, with a motor sitting across the middle bar of that H. In the basic forward-drive state, current flows from the positive supply through one high-side switch, the motor, and one low-side switch to the negative supply. If one diagonal pair of switches is turned ON, current flows through the motor in one direction. Turning that pair OFF and activating the opposite diagonal pair reverses the current through the motor, causing it to rotate in the opposite direction. That is the whole trick. No moving parts, no manually swapping wires, just electronically choosing which diagonal path gets activated.

    In practice, these “gates” are transistors or MOSFETs, and they are usually packaged into a ready made driver IC so students and engineers do not need to build a switching circuit from scratch. The most common ones you will encounter in a lab are L293D, L298N, and more modern TB6612FNG.

    Depending on the driver IC, a microcontroller may provide two direction-control signals along with a PWM or enable signal. The direction inputs determine the motor’s current path, while PWM controls the effective power delivered to the motor. Some driver ICs also provide a separate enable input for disabling the output stage.

    One Critical Warning: Shoot Through Current

    The high-side and low-side switches on the same half-bridge must not be turned on simultaneously. Doing so can create a low-impedance path directly across the supply, producing a large shoot-through current that can damage the switching devices. Proper drivers often use interlocking or dead-time control to prevent this condition. This is why H-bridge designs must prevent both switches in the same half-bridge from being ON simultaneously. Many dedicated drivers provide interlocking and dead-time internally; in other designs, the controller or firmware may need to ensure appropriate timing when switching states.

    Comparing Popular Motor Driver ICs for Microcontroller Projects

    Driver ICMotor ChannelsMax Current per ChannelMax VoltageTypical Use Case
    L293D20.6A (1.2A peak)36VSmall hobby robots, college mini projects
    L298N22A46VMedium robots, small conveyor models
    TB6612FNG21.2A (3.2A peak)15VCompact robotics, drone ground stations
    BTS7960143A27VHigh torque robots, e bike prototypes, EV mini projects

    L293D and L298N are still widely encountered in educational projects, although newer MOSFET-based drivers are generally more efficient and produce less voltage drop due to their low cost and widespread availability across Indian electronics markets like Lamington Road in Mumbai and SP Road in Bangalore. For applications requiring substantially more current, such as higher-power robotic platforms or some small vehicle prototypes, a higher-current driver such as a BTS7960-based module or another appropriately rated motor controller may be considered.

    Microcontroller Motor Control vs Motor Control Center Panel: Don’t Confuse Two

    Here is a genuine point of confusion for many students: “motor control” appears in two very different contexts in electrical and electronics engineering, and interviewers love to test whether you know the difference.

    Microcontroller motor control, everything covered above using PWM and H bridges,is commonly used to control small and medium DC motors through an appropriate driver or power stage, with motor voltage and current determined by the motor and driver requirements. It is the domain of embedded systems, robotics, and mechatronics.

    A Motor Control Center (MCC) panel, sometimes just called a motor control panel, is an entirely different piece of industrial equipment. It is a large enclosed assembly, often the size of a cupboard or bigger, containing multiple motor starters, circuit breakers, contactors, and overload relays, all sharing a common power bus. An MCC panel distributes and controls power for multiple industrial motors, often three-phase motors. In India, many low-voltage industrial systems operate around 415V AC, although actual system voltages and configurations vary by application.

    AspectMicrocontroller Motor ControlMotor Control Center (MCC) Panel
    ScaleSingle small motorMultiple large industrial motors
    Typical Voltage5V to 24V DC415V AC, 3 phase
    Core TechniquePWM and H bridge switchingContactors, starters, overload relays
    Where You’ll Find ItRobotics, embedded projects, dronesFactories, water treatment plants, power stations
    Who Designs ItEmbedded systems or electronics engineerElectrical engineer, panel design engineer

    Both are legitimately called “motor control,” and both are worth understanding, since your career could head in either direction depending on whether you gravitate toward embedded systems or industrial electrical design.

    Interfacing Basics: Connecting It All Together

    A typical motor control using microcontroller setup follows a consistent wiring pattern regardless of which microcontroller or driver IC you choose.

    The motor should normally be powered through the driver’s motor-supply path rather than directly from a microcontroller GPIO or regulator output. The motor supply should be selected according to the motor and driver requirements. Sharing grounds between microcontroller and motor’s power supply is essential, since both circuits need a common reference point for their signals to make sense.

    The microcontroller’s PWM capable pin connects to the driver’s enable or PWM input pin. On an Arduino, this is typically a pin marked with a tilde symbol, like pin 9 or pin 10, since not every digital pin supports hardware PWM. On an STM32, this involves configuring a timer peripheral in PWM mode through the microcontroller’s timer registers.

    Two regular digital output pins from the microcontroller connect to driver’s direction control inputs, deciding clockwise or counter clockwise rotation.

    Bulk and ceramic bypass capacitors should be placed close to the motor driver according to the driver’s datasheet and the motor’s current transients. A bulk capacitor such as 47–470 µF may be appropriate in some small DC-motor circuits, but the exact value should be selected based on the supply, wiring, motor, and driver.

    Why This Topic Matters for GATE, SSC JE, and RRB JE Aspirants ?

    Motor-control concepts can overlap with several areas covered in competitive engineering exams, including power electronics, electrical machines, and control systems.

    In GATE Electrical Engineering, DC machines and motor-related speed-control concepts are relevant to the Electrical Machines portion of the syllabus, and PWM-based control can be used to frame numerical questions involving duty cycle, switching frequency, average voltage, and motor-control concepts.

    For GATE ECE and other engineering exams, related concepts such as digital timing, PWM, switching devices, and power-electronics fundamentals may be relevant depending on the syllabus and question, often as circuit identification or truth table questions asking which transistor pair should conduct for a given direction.

    For SSC JE and RRB JE preparation, these concepts can be useful when studying power electronics, electrical machines, switching devices, and motor-control fundamentals. The exact question types and topic coverage depend on the relevant syllabus and exam pattern, The exact coverage depends on the syllabus and paper pattern, but candidates may encounter both conceptual and numerical questions involving duty cycle, switching devices, and motor-control fundamentals.

    A practical tip for exam preparation: always draw an H bridge diagram from memory and label current flow for both directions before an exam. Students who can visualize current paths solve direction related questions far faster than those relying purely on memorized rules.

    Career Scope and Salary Guidance for Motor Control and Embedded Systems Roles

    Skills in motor control using microcontroller techniques translate directly into embedded systems, robotics, and increasingly EV powertrain roles, all of which are in strong demand across Indian industry right now.

    Freshers entering embedded systems roles typically start in the range of 3 to 8 LPA, with product based companies and semiconductor firms offering toward the higher end of that band compared to service based IT companies. With three to six years of experience, particularly with exposure to automotive or EV embedded systems, professionals commonly move into the 10 to 18 LPA range, and senior embedded architects at companies working on automotive or semiconductor products can cross 25 to 35 LPA.

    On government and PSU side, Organizations such as ISRO, DRDO, BEL, and BHEL recruit electrical and electronics engineers for a range of technical roles, some of which may involve control systems, power electronics, actuators, drives, or related technologies. Recruitment routes vary by organization and role; some positions use GATE scores, while others may follow organization-specific recruitment processes or examinations, making strong fundamentals in motor control, power electronics, electrical machines, and embedded systems useful for relevant technical roles and interviews.

    The growth of India’s EV sector, supported by government initiatives including PM E-DRIVE, has increased attention on electric-drive, power-electronics, battery, and embedded-control technologies. This dual understanding, small scale PWM and H bridge control alongside larger industrial motor control concepts, is increasingly what separates a strong embedded or EV engineering candidate from an average one.

    Conclusion

    Motor control using microcontroller systems boils down to two cooperating ideas. PWM handles speed by rapidly switching power to create an average voltage effect, and H bridge handles direction by rerouting current through one of two diagonal paths. Together, with a driver IC bridging the gap between your microcontroller’s weak signal and motor’s real power needs, these concepts form the backbone of everything from hobby robots to industrial drive systems. Keep distinction between this microcontroller level control and industrial Motor Control Center panels clear in your mind, since both terms will follow you through your academic and professional journey. Practice duty cycle and average voltage numerical shown above until it feels automatic, since it is one of most exam friendly calculations in this entire subject area. Start with a simple DC motor project using a suitable motor-driver module. Older drivers such as the L293D and L298N are common in educational projects, while newer MOSFET-based drivers may offer better efficiency and lower voltage losses.

    FAQs

    PWM controls motor speed by rapidly switching supply voltage on and off to create an average effective voltage, while an H bridge controls direction of rotation by reversing the current path through the motor. They work together, not as alternatives, in most motor control using microcontroller systems.

    Yes. Motor speed can be controlled using methods such as varying the applied voltage, using a linear regulator in suitable low-power applications, or using other motor-drive techniques. However, PWM is generally preferred for DC motor speed control because switching control can achieve high efficiency.

    A microcontroller pin can only supply a few milliamps of current, while even a small DC motor demands hundreds of milliamps or more, especially during startup. An H-bridge driver acts as a power-switching stage that allows the microcontroller to control a motor using a separate power supply while also reversing the motor’s current direction.

    No, these are different concepts despite sharing similar terminology. An MCC is an industrial assembly used to distribute power and provide switching, protection, and control for multiple motors, commonly three-phase motors using starters, contactors, and circuit breakers, typically at 415V AC, whereas H-bridge motor control at the microcontroller level is commonly used with small DC motors, with the motor voltage determined by the selected driver and power supply.

    L293D and L298N remain most beginner friendly choices due to low cost, wide availability across Indian electronics markets, and abundant tutorial support. Consider a higher-current driver when the motor’s rated and startup/stall current exceed the safe operating limits of the chosen driver.

    Yes. DC-motor speed-control concepts are relevant to electrical-engineering exam preparation, while PWM and switching concepts are relevant to power electronics and related electronics topics. The exact coverage depends on the syllabus and exam.

    Tags: Motor Control Using Microcontroller

    Request a Callback

    Please enable JavaScript in your browser to complete this form.

    No spam. Just a quick call.

    =