Introduction: Arduino Controlled Pc Power Switch

this project is the first step in an advanced pc power switch.
this first installment will show you how to power your arduino from your computers power supply even when your computer is off.
and take control of the computers power switch using your arduino.
After this there are many different things you can do to activate your pc 


Supplies you will need:
an arduino, any will do!
and jumper wires (two f-f and one f-m)

Tools:
phillips head screw driver (to open your computer case)




Step 1: Powering the Arduino

now obviously we cant get power from the usb port when the pc is off!

you will be tapping into the +5v standby pin on your computers power supply.
the easiest way to do this is simply to take the male end of your female to male jumper wire (or any wire) and stick it down the back of the connector and secure it there.
this is a constant 5v source when the pc is off and on.
then you just run that wire to the 5v pin on your arduino. dont use vin unless you have a 3.3v board (like my pro mini).
the ground can come from anywhere be it the 24 pin atx connector, a hard drive connector, or like what i did an unused usb header.

Step 2: The Other Connection.

there will be two wires from your power switch to your motherboard.
unplug them both and connect your jumper wire to the ground on your arduino being powered by your computer.
touch the other end to one of the two pins. if the pc starts to shut down or power on (depending on which state its in) then thats the pin you need if not connect it to the other pin and connect it to adruino digital 13

Step 3: The Code

the code i used to test this was very simple it was just a modified version of the arduino physical pixel sample. 

to test your setup:
load the code 
plug the arduino in to a separate computer
open arduino on the second computer
open the serial monitor at 9600baud
 type an "O" and hit enter.
if your computer is on it should now act as if you have hit the power button and begin to shut down.

/*
  Physical Pixel

The circuit:
* LED connected from digital pin 13 to ground

created 2006
by David A. Mellis
modified 30 Aug 2011
by Tom Igoe and Scott Fitzgerald

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/PhysicalPixel
*/

const int ledPin = 13; // the pin that the LED is attached to
int incomingByte;      // a variable to read incoming serial data into

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // see if there's incoming serial data:
  if (Serial.available() > 0) {
    // read the oldest byte in the serial buffer:
    incomingByte = Serial.read();
    // if it's a capital O (ASCII 72), turn on the computer:
    if (incomingByte == 'O') {
      digialWrite(ledPin, LOW);
      delay(500);
      digitalWrite(ledPin, HIGH);
    }
  }
}

thats the very basic modified code use pin 13 to power on and off your pc

Step 4: IT WORKED...now What?

now is where creativity comes in. some ideas to make this cool are

rfid card to start your computer
bluetooth! fire up your computer from across the room.
PIR have your arduino sense when your around and turn you computer on
IR use your tv remote to fire up your pc.

or add other code and more uses!
 a fancy light show
 built in fan controller
 hard drive power switch

the possibilities are endless!

Arduino Contest

Participated in the
Arduino Contest

Epilog Challenge V

Participated in the
Epilog Challenge V