I have 2 wires that are connected to 2 different pins on the arduino board (one of which is ground), and I need to short circuit them for 500 ms everytime i give an order from my computer by the serial signal. How can I program the board to short 2 pins and release?
I am doing this to create an auto-reset whenever my computer crashes and not respond to a network ping. another compuyter on the network will send a reset order through usb and short the wires which will reset the frozen computer.
If I understand what you are doing, it might pay to consider a few things. It sounds like you want the Arduino to act like a mechanical reset switch and it won't quite act like that the way you have stated the problem.
First off, I would consider not connecting the grounds of your Arduino and the computer together unless neither ground is connected to earth ground or unless the two are physically very close to each other and the earth grounds are connected at the same point.
Second, If you intend to reset the computer by driving a reset input to a logic "0", you need to make sure that that works as many if not most reset circuits for PCs utilize a mechanical switch and simply driving the input LOW may not do the trick. In that case you might consider using an opto-isolated switch.
The most foolproof way to achieve your goal would be to use a 5V relay wired across the existing reset switch, driven by an Arduino output, with the proper diode suppression connected across the relay coil. Is that approach possible?
How about i ignore the fact that one of the pins is actually ground and connect both to the Arduino. Is it possible to read voltage from the “black” pin and write it to the other pin?
Plus, are the pins all programmed to be grounded before any programming? because as soon as I connect the reset pin to the board the computer restarts.
All i need is being able to assign the voltage value of one pin the other (shorting). The last reply suggests that it is impossilbe
There's a trick some forum member shared about using a diode to a) determine if you can easily trigger an input, and b) tell you which way to connect it. Maybe google will help, as my memory is failing me.
Many inputs are triggered by momentarily connecting the line to ground. If this is the case, you can use the arduino pin in input mode (high impedance) for "button up" and momentarily change to output mode/low for "button down".
There can be issues with ground loops, but if you keep the leads short you'll probably be OK.
To clarify, you'd need a single arduino pin and a common ground. I don't think using 2 pins will work (and if it does work, it'll be the same as using 1 pin and ground).
All i need is being able to assign the voltage value of one pin the other (shorting).
Uh...what you describe is very, very different from "shorting" two points together.
You also cannot output any voltage than Vcc on an Arduino pin. The analogWrite() function does not do that.
How can I program the board to short 2 pins and release?
I think what you want is either a switching transister or a relay. Either will work, it just depends on the current and voltage involved. The Arduino would act like a switch, allowing or stopping the current from flowing through the 2 connected wires.
For that matter, I don't think you need the Arduino at all. You can probably hook up a 555 timer circuit to achieve your goal at a fraction of the cost. Just don't ask me how as electronics isn't my forte.
Edit: Apparently, it's a little more complicated than I thought. Check out http://www.instructables.com/id/Connecting_a_12V_Relay_to_Arduino/
IIRC, I did this years ago with a simple transistor.
Emitter to the Ground, Collector to your reset. (Black wire is Computer chassis ground, Blue 'Reset' wire gets pulled to ground)
Wire your Arduino output to the base with appropriate resistor, and pull down the base with 10K to ground.
I think it was a standard 2N3904 transistor, but its been years. Back then we had Pentium 233MMX's and 14,4K modems that acted as cheapo voicemail systems.