0
\$\begingroup\$

The question says it all - I want to connect (possibly) VCC (e.g. via a pushbutton) to an NodeMCU input pin, and read the value (to see if the pushbutton is depressed).

If you connect VCC to ground-level (with no resistor), too much current will flow, and you risk (almost certain) damage to your board.

Does this apply to input pins?

If "sometimes", when? Is the answer the same for Arduino/Atmel? For other chips?

\$\endgroup\$
  • \$\begingroup\$ A choke may help reduce supply ripple. What loads? but a current limited lab supply or an just enough brick supply will help save inadvertent faults \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jun 4 '17 at 1:19
  • \$\begingroup\$ The chips in question are rated at 12mA (nodeMCU) and 20mA (Arduino) supply per pin; if it draws enough to ripple, the chip is going to be pretty dead anyway. \$\endgroup\$ – AMADANON Inc. Jun 4 '17 at 1:26
  • \$\begingroup\$ that not what I meant, I was thinking your were driving big loads with power transistors from the board. Its pretty marginal to choose a current limit of 0.5W but I suppose possible with a lab supply on the edge of CV mode. Just dont short anything \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jun 4 '17 at 1:28
  • \$\begingroup\$ That's my question - does connecting VCC to an input pin constitute a short? \$\endgroup\$ – AMADANON Inc. Jun 4 '17 at 1:37
  • \$\begingroup\$ useINPUT_PULLUPmode instead so that you can short a pin to ground to activate; prevents floating pin errors while reducing the part count as you won't need an external resistor. \$\endgroup\$ – dandavis Jun 4 '17 at 2:46
2
\$\begingroup\$

No, it should not. The input for the GPIO pins are high impedance and you can tie them to VCC (3.3V Not 5V) or Gnd without issue. If you are trying to switch the input with a push button though, you need to switch between one state to the other. A pull up or pull down is used to set the default state, while being weak enough that it can be overridden when switching to the second state, and preventing a direct short.

Note that an input is a 3rd state, High-Z, not a direct connect to ground or vcc. This is fairly standard between different micro controllers.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Thanks. I was aware of the 3rd state, and some experimentation confirms that the NodeMCU uses this when in 'input' mode (which I guess confirms that little or no current flows through the pin). Having accidentally hooked up the wrong pin, I've decided to put a resistor on each pin anyway, just in case. \$\endgroup\$ – AMADANON Inc. Jun 4 '17 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.