>

In this case the exact corner frequency of the RC filter is not critical.

> On Thu, April 18, 2013 6:58 am, rtstofer wrote:

>

> > Maybe you could get a better answer if you described the application. I

> > would model the circuit in LTSpice and see how it responds to frequency.

>

> Nominally DC, but the system has a 1.5KHz PWM solar charger and a 3KHz

> battery charger on it, plus a lot of harmonics from a car alternator.

>

> I am trying to filter out as much of the harmonics as possible so I can

> get a reasonable reading from an ADC.

>

You want to attenuate the high frequency noise as much as possible, but

want the ADC reading to reflect the actual voltage of the battery in a

reasonable time - say one second. So if you switch on a heavy load, and the

battery voltage instantly drops from 12V to 11V, you want the ADC to read

close to 11V within one second of turning on the load.

In order to accomplish that, the time constant of the RC should be about

1/5 of the desired settling time. If the time constant is 0.2 seconds, the

ADC reading will be .0067 times the step change away from the actual final

voltage after one second. So in the the above example with a 1V step

change, the ADC would read 11.0067V one second after the step change.

The time constant of an RC filter is simply R*C. So if you pick R=10000

ohms, 20uF would give you a time constant of 0.2 seconds (10000 * 0.00002 =

0.2).

Now, there is the complication that you want to combine the RC filter with

a voltage divider. Kerry is correct, you can just tie a capacitor from the

output of the voltage divider to ground. But I think he calculated the

value of the cap incorrectly.

The question is, what value of R should be used for the R*C time constant

calculation, when the R is the output node of a voltage divider? To answer

that question, tie the input of the voltage divider to ground, and then

figure out the resistance from the output of the voltage divider to ground.

Hopefully it's obvious that the resistance is the parallel resistance of

the two resistors of the voltage divider. For the original values of 47K

and 20K for the voltage divider, the parallel resistance is 14K, and that's

the value you should use for the time constant calculation. If you want a

time constant of 0.2 seconds, the capacitor should be 0.2 sec / 14000 ohms

= .0000142 F or about 15uF. If you want the faster response time of the

original 10K 2.2uF RC filter, the cap should be 1.57 uF.

A couple other notes:

The voltage divider and filter should be located as close to the ADC as

possible. If, on the contrary, you put the divider/filter at the source

(battery) and ran a long wire from there to the input of the ADC, that wire

could pick up noise through inductive and capacitive coupling.

Beware that your battery can supply hundreds of amps, which could burn up

wires if they get shorted to ground. So make judicious use of fuses or

series resistors to avoid burning your fingers or your house!

[Non-text portions of this message have been removed]