Skip to main content
Added a little disambiguation as most responses seemed to address the reason for a pullup resistor
Source Link
Tom Auger
  • 275
  • 1
  • 9

I've been using Arduinos for years but one thing I have just taken for granted without understanding is why, for example, in a simple button circuit using the internal pullup, you connect the button to ground rather than 5V.

But now I'm trying to teach my kids and they have me stumped and I'd really like a good answer that even a kid can understand (and hence me as well). I've spent the last 2 hours reading articles on the internet but no one has explained it like I'm a 5th grader.

A simple LED control circuit with a pin set to OUTPUT treats the pin like a voltage source - and the circuit connects to GND.

It would seem logical (to a 5th grader) that when the pin is set to INPUT, it's "receiving" the voltage, hence acting like GND, but as we all know this is definitely not the case.

So what exactly is happening at the pin when set to INPUT or INPUT_PULLUP that allows it to "read" the voltage level while still acting like the voltage source?

CLARIFICATION: the question is not about why a pullup (or pulldown) resistor is needed, but more about how the pin can "read" voltage (when set to INPUT) even as it's "sourcing" 5V, as in the button shorting to ground example.

I've been using Arduinos for years but one thing I have just taken for granted without understanding is why, for example, in a simple button circuit using the internal pullup, you connect the button to ground rather than 5V.

But now I'm trying to teach my kids and they have me stumped and I'd really like a good answer that even a kid can understand (and hence me as well). I've spent the last 2 hours reading articles on the internet but no one has explained it like I'm a 5th grader.

A simple LED control circuit with a pin set to OUTPUT treats the pin like a voltage source - and the circuit connects to GND.

It would seem logical (to a 5th grader) that when the pin is set to INPUT, it's "receiving" the voltage, hence acting like GND, but as we all know this is definitely not the case.

So what exactly is happening at the pin when set to INPUT or INPUT_PULLUP that allows it to "read" the voltage level while still acting like the voltage source?

I've been using Arduinos for years but one thing I have just taken for granted without understanding is why, for example, in a simple button circuit using the internal pullup, you connect the button to ground rather than 5V.

But now I'm trying to teach my kids and they have me stumped and I'd really like a good answer that even a kid can understand (and hence me as well). I've spent the last 2 hours reading articles on the internet but no one has explained it like I'm a 5th grader.

A simple LED control circuit with a pin set to OUTPUT treats the pin like a voltage source - and the circuit connects to GND.

It would seem logical (to a 5th grader) that when the pin is set to INPUT, it's "receiving" the voltage, hence acting like GND, but as we all know this is definitely not the case.

So what exactly is happening at the pin when set to INPUT or INPUT_PULLUP that allows it to "read" the voltage level while still acting like the voltage source?

CLARIFICATION: the question is not about why a pullup (or pulldown) resistor is needed, but more about how the pin can "read" voltage (when set to INPUT) even as it's "sourcing" 5V, as in the button shorting to ground example.

tags
Link
Ralph
  • 3.7k
  • 1
  • 5
  • 25
Became Hot Network Question
edited body; edited title
Source Link
ocrdu
  • 9.3k
  • 23
  • 32
  • 42

Why are Arduino pins configured as Inputsinputs more like a source than a sink?

I've been using Arduinos for years but one thing I have just taken for granted without understanding is why, for example, in a simple button circuit using the internal pullup, you connect the button to ground rather than 5V.

But now I'm trying to teach my kids and they have me stumped and I'd really like a good answer that even a kid can understand (and hence me as well). I've spent the last 2 hours reading articles on the internet but no one has explained it like I'm a 5th grader.

A simple LED control circuit with a pin set to OUTPUT treats the pin like a voltage source - and the circuit connects to GndGND.

It would seem logical (to a 5th grader) that when the pin is set to INPUT, it's "receiving" the voltage, hence acting like GndGND, but as we all know this is definitely not the case.

So what exactly is happening at the pin when set to INPUT or INPUT_PULLUP that allows it to "read" the voltage level while still acting like the voltage source?

Why are Arduino pins configured as Inputs more like a source than a sink?

I've been using Arduinos for years but one thing I have just taken for granted without understanding is why, for example, in a simple button circuit using the internal pullup, you connect the button to ground rather than 5V.

But now I'm trying to teach my kids and they have me stumped and I'd really like a good answer that even a kid can understand (and hence me as well). I've spent the last 2 hours reading articles on the internet but no one has explained it like I'm a 5th grader.

A simple LED control circuit with a pin set to OUTPUT treats the pin like a voltage source - and the circuit connects to Gnd.

It would seem logical (to a 5th grader) that when the pin is set to INPUT, it's "receiving" the voltage, hence acting like Gnd, but as we all know this is definitely not the case.

So what exactly is happening at the pin when set to INPUT or INPUT_PULLUP that allows it to "read" the voltage level while still acting like the voltage source?

Why are Arduino pins configured as inputs more like a source than a sink?

I've been using Arduinos for years but one thing I have just taken for granted without understanding is why, for example, in a simple button circuit using the internal pullup, you connect the button to ground rather than 5V.

But now I'm trying to teach my kids and they have me stumped and I'd really like a good answer that even a kid can understand (and hence me as well). I've spent the last 2 hours reading articles on the internet but no one has explained it like I'm a 5th grader.

A simple LED control circuit with a pin set to OUTPUT treats the pin like a voltage source - and the circuit connects to GND.

It would seem logical (to a 5th grader) that when the pin is set to INPUT, it's "receiving" the voltage, hence acting like GND, but as we all know this is definitely not the case.

So what exactly is happening at the pin when set to INPUT or INPUT_PULLUP that allows it to "read" the voltage level while still acting like the voltage source?

Source Link
Tom Auger
  • 275
  • 1
  • 9
Loading