Arduino digital output to input with switch to GND

Hello all,

I'm a NOOB on the EE side of Arduino and wanted to know more from the experts whether this is considered a valid circuit or if I am missing something, i.e. just cuz it works doesn't mean it's right...

The diagram below shows how I am using two digital pins on Arduino, one to act as a digital output set to high and a second digital pin set to input that are directly connected to each other. Then I use a rotary dial switch to drive the circuit to GND through a current limiting resistor.

Here's the operating knowledge I'm working from.

  1. I need to provide a circuit that provides a consistent HIGH or LOW signal. So, if I drive the input low using the switch then I need to have an input voltage that normally reads as HIGH.
  2. The output of the digital pin is a limited current and does not need a separate resistor going into the input of the digital input pin. Am I safe to assume that it's okay to drive an input from another pin's output, or is this a bad assumption and I could damage the device somehow?
  3. Since there can only be a single connection from the switch to GND, I have a single R1 resistor to limit the current. A question here is whether the Arduino does its own current limiting on any output, so would it be okay to omit the R1 resistor? IOW, is it safe to take a digital pin output directly to GND?
  4. Are there power efficiency reasons to do this differently? I'm trying to limit how much soldering I have to do, since the real design calls for a 12 position rotary dial. So, I'm trying to limit the number of resistors and the Mega has way more digital pins that I need for my design. I get that I could run a common input from the 3.3 or 5V pins, but then I would have to have a resistor per position to allow for me to read each position independently.
  5. Finally, can someone explain to me how I should determine R1 resistor going to GND? Related to #3 and whether this is necessary or if the Arduino digital pins protect against a short or not.

Oh, one more... If I set the pin to pullup on a digital input and then drove it to GND through the switch then would that be simpler? could I get by with not having to use a separate source for the HIGH reading? Or pulldown on the pin input and when connected to the switch then it provides a current limited source to HIGH?

While this works, I don't know if this is be best way to do this. I realize that there can be different ways to skin this cat, so I'm really hoping to learn the reasons why this is okay or if I should do this differently, like with a bunch of resistors on each switch input.

Thank you in advance.

Tom

Thank you, Delta_G.

I tried the OUTPUT_PULLUP approach and it works great. No need to feed it HIGH with that other pin. Thank you.

Also, thank you for confirming that a separate R1 isn't necessary since there is not enough current from those pins going to GND when selected from the rotary dial switch.

I love these devices!