Where to wire a resistance?

Other simple question... or not

I would like to know if there is any different on the reply from a sensor depending where the pull up resistance is wired. I mean is the same to solder the resistance near the sensor than near the arduino.

For example, taking the simple example of the knocks sensor included into the examples library of arduino IDE, there is a 1M resistance. So the question here is clearly visible, Is better to solder the resistance near the piezo, or at the end of the wires, near the arduino?

In this case there is only one resistance, but in other circuits, there are more than one, so may be is important to know if the location could produces changes in what arduino read at digital or analogical pins.

Thanks!

If the sensor is close to the arduino it does not matter. However if the sensor is a long way then you have to send the 5V line as well as the input line out to the sensor, so its more wires.

The only time it is important is if the line is a transmission line. That is if you are trying to send short fast rising edge pulses. In that case a pull up resistor should be placed at the far end (that is the receiving end) to absorb the reflections from the line. http://info.ee.surrey.ac.uk/Teaching/Courses/EFT/transmission/html/ReflectionsOnLines.html

In the case of a simple analogue sensor it does not matter.

I see... Thanks Grumpy_Mike for your pristine explanation!

So, if in the future i need to use a long wire i should calculate how much power i lost in the way, and where to solder each component.

Great. Thanks!