Pressing/activating a push button logically?

I have an external circuit board that is powered by 3v. It has a physical push button that I would like to push/activate logically. One side of this button has ground, when the button is pressed the other side is connected to ground and the circuit completes.

Now using an arduino, I know it might be easier to do this using a relay, transistor or optocoupler but I am trying to do this without any other components - is it possible?

I can connect one of the Arduino GPIO5 pin to the button and then do

pinMode(5, OUTPUT);
digitalWrite(5, LOW);

The above will work but the big question is when I do digitalWrite(5, HIGH) which essentially would be the rest state of the GPIO5 denoting that the button is not pressed, wouldn't this send a +3v causing a short circuit?

arduino-circuit

Only if you press that button at the same time and connect it also to ground.

A 1K or so resistor in the line between the GPIO and the other device could remedy that.

Would you care to share what model of Arduino? They are not all the same, you know?

Ah, makes sense!

I don't think it matters for the context of the question? (I don't have a specific board that I am using yet)

I know it does.

If you choose a 5V Arduino and connect it's GPIO pin to the input of a 3.3V device, the device could be damaged.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.