In this tutorial I'm going to talk about passive low-pass RC filter circuits.
So at a basic level... what are filters?
Filters are used to change the frequency content of signals.
You can experiment with this in software by playing with the graphical equalizer
settings in your MP3 player.
Here is a normal unfiltered sound clip...
Now if you decrease the low frequencies and allow the higher frequencies
to pass through unchanged,
you create a high pass filter.
It sounds like this...
You can hear that there is much less bass and only the higher frequencies
remain untouched.
Now if you decrease the high frequencies and allow the low frequencies to pass
through unchanged, you get a low pass filter.
And that sounds like this...
You can hear all the bass but the high frequency sounds are much quieter.
Now I'm going to show you how to do this in hardware and you'll be able to do
this with any signal, whether it be audio, video signals, radio-frequency signals
or whatever.
Let's start with RC low pass filters because they are easy.
An RC filter is just a filter made out of a resistor and a capacitor.
The original signal goes in and the filtered signal comes out.
The reason why this works is that the voltage on a capacitor cannot
instantaneously change.
When you have a resistor that slows the charging of the capacitor, your output
voltage might not be able to follow the sudden changes in the input voltage.
As a result higher frequencies get filtered out.
I'm going to build a low pass filter with a 10 nanofarad capacitor
and a 10 kilohm resistor
and show you how it affects different frequency signals.
There's no particular reason why I'm using these values
it's just for the sake of an example and I'll do more examples later.
So this is very important equation.
This is the equation that is used to determine the cut-off frequency
of the filter.
If I plug in my chosen values of 10 kilohms and 10 nanofarads
I get a cut-off frequency of 1592Hz.
And I'm going to round that up to 1600Hz.
Okay so this low pass filter has a cut-off frequency of 1600Hz,
but what does that mean?
This means that at frequencies below 1600Hz the signal passes
through unchanged. If I feed in sine waves of different frequencies,
you can see that from 45Hz to 200Hz
the output is the same as the input:
ten volts peak to peak.
Now at frequencies approaching 1600Hz,
the amplitude is slowly dropping on the output.
By the time we reach the 1600Hz cut-off frequency we've got a
reduction of about thirty percent.
The cut-off frequency is the point where the filtering effect really starts
being effective.
And another thing you'll notice is that the two sine waves no longer line up.
There has been a shift in phase.
That's because the filter is introducing a small delay in the signal.
Most the time you won't care but it is something you should be aware of.
Now let's increase the frequency way beyond the cut-off point.
At 15kHz there is a massive reduction in amplitude.
And as we get into higher frequencies like 50kHz and beyond,
there's almost nothing left of the signal.
Now the oscilloscope example was just a visual introduction to the concept of a
low pass filter
and how it affects voltages in your circuits.
Normally what engineers do is describe filter characteristics
with a graph called a bode plot.
Earlier I mentioned that the cut-off frequency is the point at which the
filter starts being effective.
Well you should know that in the real world you will never get
a filter like this
where as soon as you hit the cut-off frequency all the higher frequencies get
reduced to zero.
Here is a more realistic bode plot.
In realistic filters what happens is that for low frequencies you get this
flat response where the amplitude doesn't change.
Then as you slowly approach the cut-off frequency,
things start to decay a little.
At the exact cut-off frequency the amplitude is reduced by three decibels.
(Or even simpler than that,
at the cut-off frequency the amplitude is reduced by twenty nine percent.)
Now a little bit after you've hit the cut-off point, the filter keeps reducing
the amplitude by twenty decibels per decade.
That means that for every time the frequency increases by a factor of ten,
the amplitude decreases by a factor of ten.
Bode plots like this are a great way to predict how your filter will perform
at a wide range of frequencies.
In another video I will show you how to make them. (Search for "LTSpice tutorial")
For now let's get some practice creating some more low pass filters.
Let's say I want a low pass filter that goes before subwoofer's amplifier
to make sure that the woofer is only outputting really low bass frequencies.
Let's say I want a cut off frequency of about 150Hz.
Here's the equation again to calculate the cut-off frequency.
Now I can play around with random values of R and C
to get the cutoff value of 150Hz... But from experience that I
know that I should choose R, and then let the equation determine
the value of C.
I'm going to choose a 1 kilohm resistor because I don't want to overload
the audio source. In this case it's an MP3 player.
So here I've rearranged the equation to give me a way of calculating the
capacitance needed for the filter
based on a chosen resistance value.
And it turns out that the value I need is 1.06 microfarads.
Let's round that down to 1 microfarad.
So here's the 150Hz low-pass filter as a schematic,
and here it is on the breadboard.
Now I'm going to play two sound clips.
The first one has no filtering. The second one has been filtered by our
low pass filter
and amplified a little.
You can hear that the bass is clearly there, but most of the rest of the music
is missing.
Okay that was an audio example but I want to show you how low-pass filters
can be used with much more than just sine waves.
Let's say you've got a microcontroller that is outputting a
pulse width modulated square wave.
Now let's say you want to convert that to a smooth continuous voltage that is
an average of the square wave's voltage.
Essentially we want to filter out all high frequencies and be left with
D.C.
So let's take our handy cutoff equation and make the cut-off a very low value of
1Hz.
I'm going to choose a resistor value of 100 ohms so that this filter can
still power something useful like an LED.
You should always think about what resistor value will work best with your
source signal
and your chosen load.
So with R = 100 ohms, and reusing the same equation, we get a
capacitance of 1592 microfarads.
Some extra capacitance won't hurt in this case
because we want as much filtering as possible
so let's round that up to 2000 microfarads.
Now let's see how this heavy filtering affects a square wave.
Okay here I have a 54Hz PWM signal and average voltage is
4.24 volts.
At the output of the filter it looks like we've got almost pure D.C.
with an average voltage of 4.16 volts. That's pretty close!
Now I've lowered the duty cycle of the signal
and on the input the average voltage is 1.68 volts.
After the filter it looks like we're very close to clean D.C.
with an average voltage of 1.44 volts.
Again that's pretty close and as you have probably figured out, real world filters
aren't 100% efficient so you'll always lose a little energy
as heat.
Now you might be wondering... can you put filters back to back in series for an
even heavier filtering effect?
The answer is yes!
However since each filter puts a load on the previous filter, the math behind
calculating the cut-off frequencies gets really complicated.
That's the point where I bust out a circuit simulator like LTSpice and let
it do the hard work for me.
I'll make a tutorial on filter simulation with LTSpice
in another video. (Search "LTSpice tutorial")
In the meantime check out my video on passive RC high-pass filters.
The good news is they are almost exactly the same as low-pass filters!