Motor speed controller tutorial – PWM how to build

Alphabets Sounds Video

share us on:

In this tutorial, we learn how to build a pulse width modulation (PWM) speed controller for a DC motor using a 555 timer and a MOSFET. The guide covers the entire process from circuit design in Altium Designer to creating a printed circuit board (PCB), including component connections, protective measures, and testing the prototype. By the end, you’ll be able to control motor speed effectively and gain insights into electronics engineering.

Motor Speed Controller Tutorial: Building a PWM Circuit

In this tutorial, we’ll explore how to build a simple pulse width modulation (PWM) speed controller for a DC motor using a 555 timer. This guide will walk you through the circuit design process and show you how to create a professional-looking printed circuit board (PCB). You can even download the circuit board design to build your own.

Understanding the 555 Timer

The 555 timer is the core component of our PWM speed controller. It’s an integrated circuit that simplifies the design process. We’ll use Altium Designer for this project, which offers a free trial for those interested in trying it out.

Starting the Project

First, we create a new project in Altium Designer, setting up our schematic and PCB files. We then add components, starting with the 555 timer, which we source from Mouser’s website. The 555 timer can handle up to 200 milliamps, but our motor requires more power, drawing around 1.4 amps from a 12-volt supply. To manage this, we’ll use a MOSFET, specifically the IRF520, which can handle the necessary voltage and current.

Connecting the Components

The motor connects to the MOSFET’s drain pin, with the source pin connected to ground. The MOSFET acts as a switch, controlled by the voltage applied to its gate pin. The 555 timer outputs this voltage to the MOSFET gate pin, adjusting the motor speed through PWM.

To protect the components, we place a 1-kilo-ohm resistor between the MOSFET gate pin and the 555 timer’s pin 3. Another resistor provides a discharge path to ground in case of a malfunction.

Adding External Connections

We add terminals for the motor and power supply connections, along with a switch to turn the controller on and off. The input terminal connects to ground, and the power supply connects through the switch to the motor terminal, which links to the MOSFET drain pin.

Protecting the Circuit

Motors act as inductors, storing energy in their magnetic fields. When power is cut, this energy can surge and damage the circuit. To prevent this, we add a flyback diode (1N4007) to safely dissipate the energy.

Configuring the 555 Timer

We connect pin 8 of the 555 timer to the positive supply and pin 1 to ground. Three 5-kilo-ohm resistors between pins 1 and 8 reduce the voltage, providing a reference for the timer. Two comparators connected to these resistors help manage the timing intervals by comparing voltage levels.

The comparators’ outputs control a flip-flop, which in turn manages the timing of the PWM signal. We connect pins 2 and 6 to a capacitor, using a resistor and potentiometer to adjust the charging time, thus controlling the PWM frequency.

Finalizing the Circuit

Pin 7, the discharge pin, connects to the timing capacitor. The flip-flop’s output controls an internal transistor, managing the capacitor’s charge and discharge cycle. This creates a sawtooth wave, with the 555 timer outputting a square wave for PWM.

We add a 0.1-microfarad capacitor to pin 5 to stabilize the control voltage and connect pin 4 to the positive supply to prevent accidental resets.

Building and Testing the Prototype

We build a prototype on a breadboard to test the circuit. Once confirmed, we complete the PCB design, arrange components, and use auto-routing to connect everything. After checking the design in 3D, we export the files for printing.

Printing and Assembling the PCB

Using JLC PCB, we print the circuit board. After receiving it, we solder the components, starting from the center. A holder for the 555 timer helps prevent heat damage. We use tape to secure tricky components during soldering.

After assembling, we connect the power supply and motor. Adjusting the potentiometer allows us to control the motor speed smoothly.

Conclusion

This concludes our tutorial on building a PWM DC motor speed controller. For more electronics engineering insights, check out additional resources and follow us on social media.

  1. What was the most challenging aspect of understanding the 555 timer’s role in the PWM speed controller, and how did you overcome it?
  2. How did the use of Altium Designer enhance your understanding of circuit design, and what features did you find most beneficial?
  3. Reflect on the process of sourcing components like the 555 timer and MOSFET. What considerations did you have to keep in mind, and how did you address them?
  4. Discuss the importance of the flyback diode in the circuit. How did learning about its function change your perspective on circuit protection?
  5. How did the hands-on experience of building a prototype on a breadboard contribute to your learning process?
  6. What insights did you gain from the process of designing and assembling the PCB, and how might these apply to future projects?
  7. In what ways did adjusting the potentiometer to control motor speed help you understand the practical applications of PWM?
  8. After completing the tutorial, what additional topics or skills are you interested in exploring to further your knowledge in electronics engineering?
  1. Hands-On Breadboard Assembly

    Gather the necessary components and build the PWM circuit on a breadboard. This will help you understand the physical connections and layout. Pay attention to the placement of the 555 timer, MOSFET, and other components. Test the circuit with a DC motor to see how PWM affects motor speed.

  2. Simulation with Circuit Design Software

    Use Altium Designer or a similar circuit simulation tool to create a virtual model of the PWM circuit. Simulate the circuit to observe the PWM signal and its effect on the motor speed. This activity will reinforce your understanding of circuit design and the role of each component.

  3. Component Function Analysis

    Research and present on the function of each component in the PWM circuit, such as the 555 timer, MOSFET, resistors, and capacitors. Explain how these components work together to control motor speed. This will deepen your understanding of electronic components and their interactions.

  4. PCB Design and Fabrication

    Design a PCB layout for the PWM circuit using Altium Designer. Focus on component placement and routing. Once designed, discuss the process of sending the design for fabrication and the considerations involved in creating a professional PCB.

  5. Group Discussion on Circuit Protection

    Engage in a group discussion about the importance of circuit protection, such as the use of flyback diodes. Discuss potential risks and how to mitigate them in electronic circuits. This will enhance your understanding of safety and reliability in circuit design.

Here’s a sanitized version of the provided YouTube transcript, with unnecessary filler words and phrases removed for clarity:

This is a simple pulse width modulation speed controller for a DC motor using a 555 timer. I will show you how the circuit works, how to design one, and how to turn it into a professional-looking printed circuit board. You can download a copy of my circuit board and build your own; I’ll leave a link in the video description for that.

The heart of our system is the 555 timer, an integrated circuit that simplifies our design process. We will see how this component works as we build the circuit. We will be using Altium Designer for this project, which has kindly sponsored this video. All viewers can get a free trial of their software; I’ll leave a link in the video description for you.

We start a new project and create our schematic and PCB file. We then need to start adding components. I will use an add-on tool to find components on the supplier’s website, Mouser. I found the 555 timer, copied the part number, and added it to the design.

The 555 timer can handle a maximum load of around 200 milliamps, but we will be controlling a DC motor from a 12-volt supply that draws around 1.4 amps with no load. This exceeds the 555 timer’s capacity, so we will need to use a MOSFET, which is an electronic switch. I will use an IRF520 MOSFET because it can handle the voltage and current and has a low drain-source on-resistance.

The motor will be connected to the MOSFET’s drain pin, and the source pin connects to ground. The MOSFET normally blocks current flow, so the motor doesn’t rotate. However, applying a small voltage to the gate pin allows current to flow, and the higher the voltage, the faster the motor rotates. The 555 timer will provide the voltage to the MOSFET gate pin from pin 3 to control the motor speed using pulse width modulation.

The current to the gate pin is small, but we will place a 1-kilo-ohm resistor between the MOSFET gate pin and pin 3 of the 555 timer to protect the component. If the MOSFET malfunctions and allows current to flow out of the gate, a charge of electrons will build up at the gate pin, so we will place another 1-kilo-ohm resistor to ground to provide a discharge path.

I want to connect the motor and power supply externally, so I will add a terminal for the input and another for the motor connection. I also want an inbuilt switch to turn the controller on and off, so I will add a suitable switch.

Next, we connect the input terminal to ground and the power supply to the switch, then connect the switch output to the motor terminal and the motor terminal to the MOSFET drain pin. The electrical motor contains coils of wire, so we can consider it an inductor. When inductors are powered, they store energy in their magnetic field. When the power is cut, this magnetic field collapses, causing a surge of energy that can damage our circuit. To prevent this, we add a flyback diode, a 1N4007 diode, to safely dissipate the energy.

Now we connect pin 8 from the 555 timer to the positive supply and pin 1 to ground. We have three 5-kilo-ohm resistors between pins 1 and 8, reducing the voltage at pin 8 from 12 volts to 8 volts after the first resistor and down to 4 volts after the second. The 555 timer uses these as a reference.

Connected to the resistors are two comparators. The first comparator is connected to the resistors through the negative input, while the positive input is connected to pin 6 (the threshold pin). The second comparator is connected to the resistors via the positive input, with its negative input connected to pin 2 (the trigger pin).

The comparators compare the voltages; if the positive input voltage is higher, it outputs a high signal. If the negative input voltage is equal to or higher, it outputs a low signal. We connect pins 2 and 6 together so that the voltage is the same. The output from the comparators connects to a flip-flop.

When the flip-flop receives a high signal from comparator 1, it outputs a high signal. When it receives a high signal from comparator 2, it outputs a low signal. If both comparators provide a low signal, the flip-flop remains unchanged.

As we apply a small voltage to pins 2 and 6, the comparators output signals that set the timing interval. The output of the flip-flop then controls the timing.

To control the voltage and timing interval, we connect pins 2 and 6 to a capacitor. When connected to a power supply, the capacitor instantly reaches the battery voltage, but if connected via a resistor, the resistor slows down the charging time. We will use a fixed 1-kilo-ohm resistor and a 100-kilo-ohm potentiometer to vary the capacitor charging time.

We will also add two diodes to create separate charge and discharge paths for the capacitor. The current in this part of the circuit is small, so we will use two 1N4148 diodes. The capacitor will be a 10-nanofarad ceramic capacitor.

Pin 7 is the discharge pin connected to our timing capacitor. The output of the flip-flop connects to the gate pin of an internal transistor, controlling the current flow from the capacitor to ground. When the flip-flop output is low, the transistor is off, allowing the capacitor to charge. When the voltage increases enough, the flip-flop output becomes high, turning on the transistor and discharging the capacitor.

We also have pin 5, the control voltage, which we will connect to ground via a 0.1-microfarad ceramic capacitor to prevent accidental override. Pin 4, the reset pin, will be connected to the positive supply.

When charging, the current flows through the resistor, diodes, and potentiometer to the capacitor. The flip-flop output is low, so the discharge transistor is off, and pin 3 outputs a high signal. Once the capacitor charges to 8 volts, the flip-flop output becomes high, turning on the transistor and discharging the capacitor until it reaches 4 volts, at which point the cycle repeats.

This creates a sawtooth wave, and the 555 timer outputs a square wave, which is pulse width modulation. We can calculate the performance based on the charge and discharge times.

I will now build a simple prototype on a breadboard to check functionality. After confirming it works, we will finish the PCB design, add annotations, import components, and rearrange them. Once ready, we will outline the board and define the shape, adding text for polarity.

We will use the auto-route feature to connect everything, increase the width of routes carrying large voltage and current, and check the design in 3D. Once satisfied, we create our polygon and export our files for printing.

We will use JLC PCB to print our circuit board, which offers exceptional value. After uploading our files and customizing the design, we proceed to checkout and submit our order. A few days later, our circuit board arrives, and I am very happy with the result.

Now, we start soldering the components to the board, beginning from the center and working outward. I use a holder for the 555 timer to prevent damage from heat and allow for easy replacement. For tricky components, we can use tape to hold them in place while soldering.

After soldering all components, we connect the bench power supply and the motor to the board. When powered on and adjusting the potentiometer, the motor shaft begins to rotate, allowing for easy speed adjustment.

This concludes our basic pulse width modulation DC motor speed controller. Check out one of the videos on screen now to continue learning about electronics engineering. Don’t forget to follow us on social media and visit engineeringmindset.com.

This version maintains the technical content while improving readability and clarity.

MotorA device that converts electrical energy into mechanical energy to perform work. – The engineering students used a DC motor to drive the wheels of their robotic project.

SpeedThe rate at which an object moves or operates, often measured in revolutions per minute (RPM) in mechanical systems. – By adjusting the voltage, the team was able to increase the speed of the conveyor belt in their automated system.

ControllerAn electronic device or software that manages the operation of a machine or system. – The microcontroller served as the main controller for the drone, ensuring stable flight and navigation.

PWMPulse Width Modulation, a technique used to control the amount of power delivered to an electrical device by varying the width of the pulses in a pulse train. – The students implemented PWM to control the brightness of the LED in their circuit design project.

CircuitA closed path through which an electric current flows or may flow. – In their lab assignment, the students were tasked with designing a circuit to power a series of LEDs.

TimerAn electronic device or software function that counts down from a specified time interval and triggers an action when the time elapses. – The microcontroller’s timer was used to create precise delays in the signal processing application.

ComponentsIndividual parts or elements that make up an electronic circuit or system. – The students carefully selected the components for their project to ensure compatibility and efficiency.

DesignThe process of planning and creating a system, component, or process to meet desired needs and specifications. – The engineering team focused on the design of a new energy-efficient power supply for their senior project.

VoltageThe electrical potential difference between two points, which drives current through a circuit. – The lab experiment required measuring the voltage across different components to analyze the circuit’s behavior.

ResistorAn electrical component that limits or regulates the flow of electrical current in a circuit. – By adding a resistor to the circuit, the students were able to control the current flowing to the LED, preventing it from burning out.

All Video Lessons

Login your account

Please login your account to get started.

Don't have an account?

Sign in

Register your account

Please sign up your account to get started.

Already have an account?

Sign up