Summary of PWM Based DC Motor Speed Control using Microcontroller
This article explains how to control DC motor speed using Pulse Width Modulation (PWM) with an ATmega8 microcontroller. It highlights that microcontrollers offer a compact alternative to bulky mechanical or electrical methods. The project specifically utilizes Timer2's PWM mode on the ATmega8 to generate variable-width waves, adjusting motor speed by comparing values in the OCR2 register against the counter.
Parts used in the PWM Based DC Motor Speed Control:
- ATmega8 controller
- Timer1
- Timer2
- OCR2 register
In many applications, it is important to control the speed of DC motor where precision and protection are essence. Here we will use a technique called PWM (pulse width modulation) to control the speed of DC motor.
We can achieve speed control of DC motor using mechanical or electrical techniques but they require large size hardware to implement but Microcontroller based system provides easy way to control the speed of DC motor.
Earlier, we have already seen how to control the speed of DC motor using PWM without Microcontroller. Here we do the same experiment by using a microcontroller.
For that purpose, here we will use ATmega8 controller to produce PWM wave. By varying the width of this PWM wave, we can control the speed of DC motor. In ATmega8 controller, timer1 and timer2 have PWM mode. In this article we will see how to control the speed of DC motor using timer2 PWM mode.
PWM Based DC Motor Speed Control using Microcontroller Circuit Principle:
The heart of this project is ATmega8 controller. These controllers consist of 2 PWM modes. Now we will see how to generate PWM wave using timer2 PWM mode.
Before writing the program to the PWM mode we need to know the register description of all the registers that are used for PWM mode.
OCR2 register contains an 8 bit value that is continuously compared with counter value.
PWM Program:
For more detail: PWM Based DC Motor Speed Control using Microcontroller
- Why use a microcontroller for DC motor speed control?
Microcontrollers provide an easy way to control speed without requiring large size hardware needed by mechanical or electrical techniques. - Which technique is used to control the speed of the DC motor?
Pulse width modulation or PWM is used to control the speed. - Which microcontroller is used in this project?
The ATmega8 controller is used to produce the PWM wave. - How does the system vary the motor speed?
It varies the width of the PWM wave generated by the controller. - Which timers on the ATmega8 support PWM mode?
Timer1 and timer2 have PWM modes available on the ATmega8 controller. - What specific timer mode is utilized in this article?
The project uses timer2 PWM mode to control the motor. - What function does the OCR2 register serve?
The OCR2 register contains an 8 bit value that is continuously compared with the counter value.


