Theoretical question: I have seen in many analog signal circuits that the analog input pin is pulled down through a resistance. Sometimes it is also pulled up and sometimes there is a capacitor involved.

What is the purpose of doing this?

What decides the value of the resistance and the capacitance?

Sample circuits below

(editing in vital information from comments)

I am confused of the role of R3 in first schematic, and C2 in second schematic. Second schematic also has a LED X1 while I assume TP6 is analog input, what role could the LED X1 be playing, these LEDs are generally more than just a pretty addition and their resistances have a role to play.

(/editing in vital information from comments)

• I assume you mean "before the analog input" - that is, the resistor or capacitor is permanently connected to the analog input pin. "before the signal is read" implies that the resistor is connected momentarily, just before the ADC takes a reading. May 29 at 6:50
• @PeterBennett Yeah, sorry my language isn't clear. I mean before the analog input pin. Question edited. May 29 at 6:56
• You'd need to show a specific circuit for an answer. If there is a resistor, it might not be due to analog input, but for the analog output. We can't guess. May 29 at 7:42
• Could be to prevent floating signals due to EMI, or signal reflections in HF transmission. May 29 at 7:51
• some samples added May 29 at 8:00

R3 in the first schematic limits current into the LED, and allows U1:B amplifier's output to cover its full range, rather than being limited to the LED's forward voltage, and possibly cooking LED and/or amplifier if it tried to output a high voltage.

C2 in the second schematic will low-pass filter the drive to the LED X1. This means it will not show short glitches from the output U1.

TP6 is not an analog input. It's a testpoint, on the output end of the circuit. These tend to be realised on the PCB as an easy point to connect a probe to, at least easier than a pad used by a component, typically a 'hairpin', a via hole, or an unoccupied pad. As an easy point to solder a wire to, they are often used as inputs or outputs. Where as TP6 might be used as an output to something else, the LED limits the voltage swing in a non-linear way with R6, so I'd rather take the output from TP5.

Indicators like X1 are often very useful in debugging or setting up circuits, or the systems they are used in. It's very comforting to see a LED blinking across the room as you align some piece of equipment without using any additional test gear.

• ok, so in first schematic the purpose of the LED is clear, are you sure the resistance and LED to ground has no other benefit? I clearly remember somewhere, I don't remember where though, someone had mentioned that adding a resistance between the analog read pin and GND is to give a reference to ground. Does that make any sense? Any benefit? May 29 at 10:52
• @RocknRoll No the resistor is simply to prevent the LED from blowing up. It does not give a reference to ground. The op-amp outputs are already ground referenced because the op-amp supply is ground referenced. May 29 at 12:21
• @Justme what if the op-amp is powered by +ve and -Ve volts instead of +ve and GND? May 29 at 12:25
• The +ve and -ve still need to be referenced to 0V ground. If it isn't, the resistor still won't get you a ground referenced output. Just like you can't transfer power between two cars with one wire as they don't share a return path. May 29 at 12:35