Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RC Low Pass Filter Design Problem

Status
Not open for further replies.

Jimmylee

Banned
Joined
Mar 17, 2021
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
302
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
Joined
Jan 22, 2008
Messages
50,808
Helped
14,603
Reputation
29,481
Reaction score
13,688
Trophy points
1,393
Location
Bochum, Germany
Activity points
290,925
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

Advanced Member level 5
Joined
Nov 13, 2012
Messages
3,815
Helped
929
Reputation
1,860
Reaction score
921
Trophy points
1,393
Activity points
30,126
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
Joined
Jul 4, 2009
Messages
15,731
Helped
5,069
Reputation
10,163
Reaction score
4,924
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
133,219
More information needed.
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
Joined
Apr 17, 2014
Messages
23,045
Helped
4,716
Reputation
9,448
Reaction score
5,092
Trophy points
1,393
Activity points
152,661
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
Joined
Mar 17, 2021
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
302
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
Joined
Jul 4, 2009
Messages
15,731
Helped
5,069
Reputation
10,163
Reaction score
4,924
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
133,219
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
Joined
Apr 17, 2014
Messages
23,045
Helped
4,716
Reputation
9,448
Reaction score
5,092
Trophy points
1,393
Activity points
152,661
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top