Simple PWM DC motor control using MOSFET H-Bridge with AVR ATmega8

Summary of Simple PWM DC motor control using MOSFET H-Bridge with AVR ATmega8


This article details a simple project controlling a DC motor from an old cassette player using an ATmega8 microcontroller. The system utilizes two PWM channels to drive an RFD3055 MOSFET H-bridge, enabling bidirectional rotation and variable speed. Direction is managed via a toggle switch (or jumper wire), while speed adjustments are handled by two push-buttons that increment or decrement PWM duty cycle in fixed steps.

Parts used in the Simple PWM DC Motor Control Project:

  • ATmega8 microcontroller
  • DC motor from a personal cassette player
  • RFD3055 MOSFETs
  • H-bridge circuit configuration
  • Two-position toggle switch (SW1)
  • Push-button for increasing speed (S2)
  • Push-button for reducing speed (S3)
  • Jumper wire for direction control
  • 6-pin In-System Programming connector

Here is a very simple project of controlling a small DC-motor (taken from an old personal cassette player) with ATmega8. The ATmega8 is having three PWM channels, out of which two are used here. PWM waveforms are fed to MOSFET (RFD3055) H-bridge.
Here, direction is controlled using a two-position toggle switch and speed of the motor is controlled by two push-buttons, one for increasing the speed and other for reducing.
The schematic is geiven here (click on the image to enlarge):
motor control by PWM method
When switch SW1 is closed, OC1A channel is active which will feed the PWM signal to Q1 & Q4 MOSFETs. The OC1B pin will remain low keeping the Q3 & Q2 in OFF condition. When SW1 is toggled to open position, OC1A pin will become low, making Q1 & Q4 OFF and OC1B will feed the PWM signal to Q3 & Q2, resulting in the change in the direction of current flow hrough motor. Hence, motor rotation direction will change.
The speed is controlled by Push-buttons S2 & S3. Pressing S2 will increase the speed in fixed steps. Similarly, pressing S3 will reduce the speed in fixed steps.
The closer look to the motor and the circuit:
motor
circuit
Here on the bread-board, I’ve used two push-buttons but the direction control switch is replaced by a small wire which was connected to ground or kept open for changing the direction (since I was not having the toggle switch in stock at the moment). The bread-board also includes 6-pin In-System Programming connector which is not shown in the schematic.
For more details click : Simple PWM DC motor control using MOSFET H-Bridge with AVR ATmega8

Quick Solutions to Questions related to Simple PWM DC Motor Control Project:

  • How is the direction of the motor controlled?
    Direction is controlled using a two-position toggle switch that activates either OC1A or OC1B channels.
  • What components form the H-bridge in this project?
    The H-bridge is formed using four RFD3055 MOSFETs labeled Q1, Q2, Q3, and Q4.
  • Can the motor speed be adjusted?
    Yes, speed is controlled by two push-buttons that increase or decrease the speed in fixed steps.
  • Which PWM channels are utilized for this project?
    Two PWM channels out of the three available on the ATmega8 are used here.
  • How does closing switch SW1 affect the circuit?
    Closing SW1 makes OC1A active to feed PWM signals to Q1 and Q4 while keeping Q3 and Q2 off.
  • What happens when the direction switch is toggled to open?
    Toggling the switch to open makes OC1A low and feeds the PWM signal to Q3 and Q2, changing current flow.
  • Is a physical toggle switch mandatory for direction control?
    No, a small wire connected to ground or kept open can replace the toggle switch.
  • What type of motor was used in this demonstration?
    A small DC motor taken from an old personal cassette player was used.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top