Arduino Uno AS a button

Hi! So I was trying to do a little project in which I wanted to use the Arduino Uno as a button, meaning that it could "simulate" the press of a button.
I was thinking of connecting one contact of the "button" to ground and another contatct to a digital pin, so basically with digitalWrite, by setting a value of 1, the circuit is open, and by setting the value to 0, both contacts are connected to ground, so the circuit is closed.
Is this going to work? Is it a stupid idea? Could I fry something? Is there a better way (that still involves the Uno)?

These are the questions I need at least an answer for.
Thanks in anticipation.

(deleted)

May work - depending on whatever you want to connect to that "switch".

A relay is an electronically controllable switch, which can replace any button. Other solutions are restricted to a certain environment.

Domnulvlad:
Hi! So I was trying to do a little project in which I wanted to use the Arduino Uno as a button, meaning that it could "simulate" the press of a button.

And then you describe an output pin action which might as well be led13. You use an output to simulate an input?

Hi,
Have you measured the voltage between the two wires from the switch that you want the Arduino to work with?

What is the button connected to?

Can you tell us your electronics, programming, Arduino, hardware experience?

Thanks.. Tom.. :slight_smile:

Without knowing anything whatsoever about your switch, an electromechanical relay is the first option to consider.
If your switch is a physical switch that does nothing more than complete a circuit, a relay will work.

Other options that may be more elegant include using an optocoupler, transistor, or some variety of duping the signal as you seem to maybe are trying to do except you are doing it without understanding the fundamentals of circuits. But those options require you to know a lot more about the device to be switched which will require some testing equipment which I'm going to guess you don't have else you wouldn't have needed to ask this question.