I'm trying to use the arduino as a type of switch for example having the negative of a circuit to the GND and the positive but idk what pins to use, i believe the circuit is digital. I'm not sure how to connect the pins up using code to one another. If anyone can help that would be great.
Thanks
You cannot connect two pins to each other internally. Those pins can read a voltage or they can output 0V or they can output 5V. That's all they can do.
You're going to have to describe your circuit and how you want to control it.
If this is something that you could accomplish with a simple manual switch along the circuit, then chances are you'll need a transistor or relay for the Arduino to do the same job.
Yeah it is something i could use a switch for but i need to be controlled remotely as i wont have access to the arduino to be able to press a button, i thought about using a transistor but idk how to approach it.
You could try approaching it with a transistor, as a switch.
You could google transistor as switch. There's plenty of great tutorials on how that works.
How would the Arduino know when to switch? What do you mean controlled remotely?
No one is suggesting you use a manual switch. Read again and about 83 times more carefully. Especially the part about describing the circuit you want to control.
I will try and explain this but I'm not great with electronics, I have a printed board as part of a machine that uses an infrared sensor to detect when something is present I was able to bypass this by soldering wires to two of the connectors and when I touched them together they would complete the circuit like a switch, I want to be able to control this with the arduino and was wondering if I can just connect the negative wire to GND and the positive to a pin either digital or analog I'm not sure, am I able to do this to say complete the circuit or is a transistor/relay the only way to go? So if this doesn't make sense but thanks for the help
What do the pins of the IR detector connect to? What voltage is all of that running at?
Short of knowing that you are pretty much limited to the transistor option if all you want to do is make a connection between those two wires.
You really need some details of that circuit either way. Even with the transistor you'd need to know which way round to put it.
I don't really know anything about the circuit as it as a manufured one for a different product and wouldn't even know where to look for the schematic, I think the best option as you say is with a transistor and using trial and error to figure out the direction although on the board itself one of the pins of the IR sensor is labelled with a plus which I assume is positive. Thanks for your help everyone sorry for the horrible post '
Do you have a multimeter? Do you have a camera? Do you have an ability to imagine what it's like for someone who isn't you to try and understand what it is you're talking about?
Btw, the Arduino cannot do what it is you're imagining it can do. But without a useful description of what you're trying to do, the best solution you're going to get right now is a transistor or a relay or an optocoupler.
There may in fact be a way to approach the problem more simply by intercepting the circuit elsewhere, but since you have not described or shown anything useful other than "wants to connect two wires", start doing some reading on transistors as switches.
Don't worry about it all I really needed to know was if the arduino could act as a transistor and from the looks of it, it can't. Thanks for the help
But, it can.