PWM Tutorial in HD

Uploaded by Afrotechmods on 15.11.2008

In my other videos you might have heard me talk about PWM, or "Pulse Width Modulation".
In today's video i'm going to go into more detail on what PWM is and how you
can build a PWM circuit that can dim lights, control the speed of a motor, or change
the amount of power going to pretty much anything you want.
So let's start with a description of the waveforms. Here is what 10V DC looks like.
and here is what 0V DC looks like.
Now let's see what happens when you have 10V being switched on and off.
Right now you can see that the waveform is 10V half the time and 0V half
the time. Since it is fifty-fifty, we say that the waveform has a fifty percent duty cycle.
Since the 10V is only there half the time, what you end up with is an average voltage of
5 volts.
Now let's change the duty cycle.
Now the wave is only on for ten percent of the time so we say it has a ten percent duty cycle.
Ten percent of ten volts is one volt so we end up with an effective average of 1 volt.
So you can see how by changing the pulse width we change the average voltage seen by circuit.
We call this technique pulse width modulation.
Now the easiest way to generate a waveform like this is with a function generator
but most people aren't going to spend a hundred bucks to get one.
But that's not a problem. You can build a PWM generator circuit fairly easily and all you need
is a few parts that can get from any radio shack.
So here's the circuit diagram...
The key component is a 555 timer chip. You can get one for about $2.
When you configure the 555 in this way it puts out a square wave that is
pulse width modulated.
You can change duty cycle by rotating potentiometer over here
and this will change the average power going to your load.
The potentiometer here should ideally be 100k ohms but a 50k, 10k, or even a 5k potentiometer will still work.
The diodes over here can be any type you want as long as they are not zener diodes.
For my circuit I used a pair of 1N34s.
These capacitors should be 10nF and I know that a lot of people have trouble identifying
ceramic capacitors so here's a close-up of them.
A 10nF capacitor should have 103 printed on it and that should help you find one in your parts box.
Now the NPN transistor over here is what allows you to switch heavier loads than
just the 555 chip can handle.
I'm using a TIP31 that I got from Radio Shack and it can handle 1 Amp but
if you find that it heats up with heavier loads, put heatsink on it.
In this circuit diagram I am dimming some LEDs as an example.
But let's say you want to control the speed of a fan or a motor. You would just need to
modify the circuit like this.
Don't forget to put a diode here otherwise inductive load of the motor could blow
something up.
And here's how the circuit looks fully constructed with some LEDs to start out with.
By rotating potentiometer I can dim or brighten the LEDs.
And here's the same circuit modified to control the speed of a motor.
I can speed up or slow down the motor with the potentiometer.
I am demonstrating this circuit from a 12V power supply but I found out that it works
just fine from 4V up to 15V. So it'll work with most kinds of batteries.
Now if all this seems similar to changing the speed on radio controlled car, that's because it is.
Toy boats, planes and cars will all use PWM circuits to control the speed of
the vehicle.
And dimming the backlight on your laptop is also accomplished with PWM. You'd be amazed at
how often this technique is used in the real world.
I hope you enjoyed learning about PWM and thanks for watching!