small medium large xlarge

Back to: All Forums  Arduino
Maik_schmidt_avatar2_pragsmall
14 Mar 2011, 15:51
Maik Schmidt (122 posts)

There is a bug in version P1.0 (pages 74-75) in the explanation of the working principle of a pull-down resistor.

The last two sentences on page 74 should read:

But when the button isn’t pressed, it would be directly connected to ground and would flicker because of static and interference. Only a little bit of current flows through the resistor, and this helps prevent random noise from changing the voltage that the input pin sees.

At http://maik-schmidt.de/pull_down_resistor.png you can see a schematic of the button circuit. When the button is not pressed (as it is the case in the schematic) the digital pin #2 is connected to ground via a resistor. Even if there were some interference or noise on the line only a tiny portion would be registered on the pin. The digitalRead() function considers a signal as HIGH only when it’s greater than 2.5V, so with our resistor we are fine and the pin will remain in LOW state as long as the button is not pressed.

When you press the button electrons will follow the path of least resistance, that is they will avoid the resistor and head for the digital pin. In this case digitalRead() returns HIGH.

You must be logged in to comment