Will RC filter damage Sampe-and-hold? - Page 1
Forum section: electronics / projects

author: webgiorgio
author_rank: Regular Contributor
timestamp: January 29, 2018, 10:25:35 am
content: I want to filter away the 50 Hz noise from 5 analog signals before they go into the Arduino ADC (one adc multiplexed internally on 5 pins).The RC filter is 56 k, 100 nF, 28 Hz cut off.In a situation where the different 100 nF capacitors are charged at different voltages, I am concerned of the "short circuit" that the MUX will cause when connecting the S&H capacitor in parallel.Will that current be a problem for the input pins?(I expect people would say to add an op-amp in the voltage follower configuration, but first I want to understand if that over current would be a problem or not)

author: rs20
author_rank: Super Contributor
timestamp: January 29, 2018, 10:31:59 am
content: First, here's some questions for you to answer:- How much will 50 Hz be attenuated by your low pass filter? In dB? Is this degree of attenuation acceptable for your use case?- Would it be easier to just take 10 ADC readings over 20ms, and average them out in software? This would almost totally remove 50 Hz hum, unlike a 28 Hz cutoff filter.- What's the difference between a charged capacitor and a voltage follower/buffer? They will both deliver large currents in an attempt to hold voltage constant.- If over current was a concern (which, to actually answer your question, it is not), wouldn't adding a small resistor to the ADC pin be the solution? (Hint: the IC's sampling FET probably has enough resistance to prevent the problems you're describing; as it would be pretty dumb if an ADC input could be damaged by a voltage source that was too strong.)

author: webgiorgio
author_rank: Regular Contributor
timestamp: January 29, 2018, 11:10:38 am
content: You are right, the capacitor is a voltage source just like the op-amp.I looked into the datasheet of the uC. The input resistance is 1...100 kOhm. So, the current to the S&H C is limited.Page 312http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42735-8-bit-AVR-Microcontroller-ATmega328-328P_Datasheet.pdfTo answer your question: 32 Hz would be -3dB attenuation. Then we have -20db/decade. At 50 Hz is around -8dB. Whether it is enough, I don't know.Thanks for the advice on averaging the samples over 20 ms, I will implement it.Actually, the RC filter is there also to suppress transients (when connecting/disconnecting the long wires of the sensors).

author: Kleinstein
author_rank: Super Contributor
timestamp: January 29, 2018, 04:18:00 pm
content: For 50 Hz suppression averaging over 20 ms is the much better way.For the RC filter, there is one more point: if used with a cap smaller than about 10 nF the cap will be too small to fully buffer the sampling cap (around 10-20 pF) and will slow down the settling time quite a lot. So such a filter can add extra errors. So if an RC filter is used to avoid aliasing or suppress transients (which is a good thing), keep the cap large enough or use a different (e.g. active) filter or buffer.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 29, 2018, 08:01:43 pm
content: The internal mux has an equivalent resistance of something like 10kohms. The worst case surge current is less than a milliampere, and for less than a microsecond in duration.Tim

author: rs20
author_rank: Super Contributor
timestamp: January 30, 2018, 03:59:24 am
content: One thing that's always bothered me -- why is the value of that internal resistor given as such a vague value ("1..100 kOhm")? Is the process control in the Atmel factory so vague that they can't constrain it to a range within, say, just one order of magnitude as opposed to the two that they say?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 30, 2018, 05:49:56 am
content: It should be typical of the process, i.e., about a 3x range (like passive pullups and output pins). One factor may be, if it's a single (N or P) switch rather than a complementary pair, the resistance varies with bias voltage. That would be sneaky -- it would manifest as a reduction of analog bandwidth towards the rail (presumably AVCC or AVREF).Otherwise, could be a number of reasons for the vagueness, but I would tend to think it's not because of the process, it's just because they don't care any further than that...Tim