Just wondering what the maximum input voltage is for the Digital Input/Output pins of an Arduino Nano?
Is it bad practice/bad for Arduino, to wire a button to 5v then to a Digital Input/Output pin of the Arduino Nano and detect voltage to find out if the button is pressed or not pressed?
ZebH:
Just wondering what the maximum input voltage is for the Digital Input/Output pins of an Arduino Nano?
Look in the datasheet under Absolute Maximum Ratings:
Voltage on any Pin except RESET
with respect to Ground ................................-0.5V to VCC+0.5V
ZebH:
Is it bad practice/bad for Arduino, to wire a button to 5v then to a Digital Input/Output pin of the Arduino Nano and detect voltage to find out if the button is pressed or not pressed?
That won't work because the pin is left floating when the switch is open. Use pinMode(pin, INPUT_PULLUP); to enable the built-in pull-up resistor. Then connect the button between the pin and Ground. When the button is closed, the Ground causes the pin to read LOW. When the button is open, the pull-up causes the pin to read HIGH.
DO NOT connect an OUTPUT pin to either +5V or Ground. Trying to pull the +5V power to LOW or pull Ground to HIGH can harm the chip.
using pinMode(),digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive 20 mA as recommended operating condition and has an internal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller.
Input and Output Each of the 14 digital pins on the Nano can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.