News for hackers. Stuff that matters.

HackerJoe

Re:Ask HN: What's the purpose of the resistor in this circuit? on Thursday March 19, 2009 @10:43PM (#524417)
R2 is not a pull-down resistor.

They are taking an analog reading here, and the resistor is used as part of a voltage divider. You can use Ohm's law to calculate the output voltage.

To understand why R2 is needed, imagine the circuit without it. It would always read 5V, no matter the temperature.

Pull-down (and up) resistors are used on digital components with floating outputs, like switches, buttons, etc. For example, if a button is either open or connecting to a high potential, you would use a pull-down resistor to give meaning to that open state.