I want to detect change in on of digital pins of Arduino . First step is connecting digital pin to ground or vcc according to internal condition of pin.

So in ARDUIO i set one of digital pins (GPIO) to "OUTPUT" then i set it to "INTERNAL PULLUP" ... When i connect it to GND i can detect change without problem.

I want to know if i dont use resistor between digital pin and GROUND will it damage ARDUINO in long time ?

  • \$\begingroup\$ Why would you connect a GPIO pin directly to ground and then set it as an output? \$\endgroup\$
    – DKNguyen
    Jan 11 at 4:21
  • 2
    \$\begingroup\$ Pull up and pull down resistors are used when the GPIOs are set as inputs. If you connect an output directly to ground you may damage the pin on the arduino when it’s set high. \$\endgroup\$
    – Ryan
    Jan 11 at 4:22
  • 1
    \$\begingroup\$ @Ryan is right. You only can use internal pullup when you set the PIN as input. other than that, if you set a PIN as output and connect it directly to ground, there is no limiting element. therefore the current flowing from that can go very high and might as well damage the PIN. If you want to detect change in any pin, you should set it as input and use internal or external pullup and read the input in software. \$\endgroup\$
    – Momo
    Jan 11 at 4:32
  • 1
    \$\begingroup\$ It depends on whether you want to use internal pullup or not. If you don't want to use internal pullup, then you can use external pullup. \$\endgroup\$
    – Momo
    Jan 12 at 12:06
  • 1
    \$\begingroup\$ It would be helpful to us if you clarified "where" you want the detection; either (1) inside the Arduino from code detecting a change made by an outside device, or (2) some external device that detects when the Arduino pin has changed by your software. This will set the precedence on configuring the Arduino pin and the choice of using a resistor. \$\endgroup\$ Jan 12 at 21:14


Your Answer

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

Browse other questions tagged or ask your own question.