Continue to Site

RC Low Pass Filter Design Problem

Status
Not open for further replies.

Jimmylee

Banned
I’ve read this note RC Low-pass Filter Design (Sample) to design a a low pass filter for converting 120 VAC to 0-5V to input as analog into the arduino.

Attached is the filter I’ve got on the bread board now and it isn’t working and I can’t come up with where I’ve went wrong.

The voltage divider gets the voltage to 120*(680/68680) ~ 1.188 volts (plus or minus of course), then I pass it through the filter and DC offset. (The measured offset is a little more than 2.5 v due to 5% resistors), and I would expect something between 3.68v and 1.312 volts.

Where I would expect 3.68/(5v/1023steps) ~754 and 1.312/(5/1023)~268, so if I read the analog volts and then print them to the screen I’d expect the AC signal to oscillate between 754 and 268 with a center of roughly 500.

The problem is I’m seeing roughly 500 to 520.
I think its the filter taking out the 60hz signal but according to the design it should be passing the signal with minimal phase offset.

Can you spot where I’ve gone wrong? Thanks in advance!

Attachments

• RC Low Pass Filter.pdf
2.9 MB · Views: 86

FvM

Super Moderator
Staff member
Please show the actually implemented circuit to allow a serious discussion.

You may have forgotten to consider the voltage divider output impedance which becomes part of the low-pass resistor.

Last edited:

c_mitra

I’ve read this note RC Low-pass Filter Design (Sample) to design a a low pass filter for converting 120 VAC to 0-5V to input as analog into the arduino.
You cannot use a low pass filter to convert AC to DC; in other words, you cannot make a low pass filter with 0Hz as the pass band.

These filters are associated with specific slopes that tell us the amount of the signal being attenuated. Thus it is impossible to have a filter that passes only one frequency.

To get exact answer you need to ask clear questions. And a diagram will be helpful. As the saying goes, a picture is worth a thousand words.

betwixt

Super Moderator
Staff member
Based on amplitude reduction by filtering and then applying a DC offset I assumed this was measuring AC by sampling the waveform rather than measuring DC. What reading does it give if the AC is removed? Ideally it should be about 512 (half FSD). If it is, the loading on the filter needs to be taken into consideration (FvM in post #2) or it could be a software issue with the sampling rate or RMS calculation.

Brian.

KlausST

Super Moderator
Staff member
Hi,

Please define/explain what you want to do:
120V AC sounds like mains voltage. Without DC. Just 50Hz or 60Hz.

So what do you expect the filter to do?
In your case it seems to be a low pass filter.
So it lets "low frequencies pass" while it attenuates higher frequencies.

So what frequencies do you want to pass and what frequencies fo you want to attenuate.

But you should have in mind: the output will still be AC. Sine shape. So if you do an ADConversion you gat values from min to max.

Klaus

Jimmylee

Banned
Thanks a lot for helping!
I just realized after looking at my resistor values they aren’t set correctly anymore to pass 60hz so please ignore that.

I indeed had redesigned a high pass after looking at the low pass filter pictured I saw the mistake.

I’ve updated my my drawing a bit here to reflect the grounds/neutrals. I was planning on fusing the high voltage link (not in the drawing) but separating the resistors is a great ideas as well.

I had lowered the values of all my resistors to be pretty much as low as possible because I was thinking that they were influencing my flawed low pass filter. I’ve got it designed closer to the parameters you’ve described at home so I’ll have to take a look into that now.

betwixt

Super Moderator
Staff member
Please consider that if you are looking at mains voltages and reduce them with a high-pass filter, the fundamental 50/60Hz may be adequately reduced but harmonics and line borne interference will be less attenuated. There is no problem with that if you are aware of it and take precautions not to let too much voltage through to the ADC.

Brian.

KlausST

Super Moderator
Staff member
Hi

A low pass filter in front of an ADC should atbleast fulfill anti aliasing requirements...all the rest can be done by software.
But if you get alias frequencies at the ADC output, the software is not able to handle them.

Thus I'd not focus on the line frequency but on the sampling frequency.

Klaus

Status
Not open for further replies.