Control PC power with arduino

JoeN:
Every motherboard has a two pin header which is normally connected to the momentary power button on the case that if you momentarily connect the header, the motherboard send the shutdown command to the OS which then does an OS shutdown and then orders the motherboard to turn the power supply off. I would use that capability rather than using a serial port and having to write a driver. If the header is closed for about 1 second continuously that causes the motherboard to shut down the power supply without any further action from the OS.

You want to use something like an optocoupler between the Arduino and the circuit for the PC shutdown, so that there isn't an electrical connection between the Arduino and the PC. An optocoupler (or optoisolator) is an integrated circuit with a LED and a light sensor inside. When you light the LED via the input power pins, the light sensor completes the circuit on the output side. Terry King has the following on his wiki for integrated circuits: http://arduino-info.wikispaces.com/Popular-ICs

In another forum, people have suggested I put resistors on the input for the optocoupler, otherwise I would run the risk of blowing out the internal LED.