Arduino to turn on desktop PC (Video Added)


My work computer is shut down by IT on some weekends. This prevents me from logging into it using the VPN. What I would like to do is monitor the front power button light and then push it when the light turns off. This sounds pretty simple (at least to code) but what kind of motor is available that could push the button in? I would probably need to put the light sensor inside the tip of the “finger”. Alternatively, I could possibly monitor the sound of the hard drive to cause the motor to push the button.

psuedo code:

If lightLevel (or soundLevel) < threshold Then

wait (xTime)
Push Button

End If

Not real serious about this but thought it would be fun to build. Any input would be great. I just ordered my first arduino today (starter kit).
Thanks! Matt

Update 06/16/2011:

In Action

Closer Look

Does IT shut the computer down manually, by pressing the button, or remotely? If manually, I think they'd notice your device!

It would be easier to tap in to the pushbutton's electrical contacts and just simulate them with a relay rather than mechanically push on the button.

If you did want to go the mechanical route, you would need a motorized linear actuator:

-- The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

First choice: Use a small relay and wire contacts across PC power switch.

Second choice: Using doublesided tape a servo such that servo arm can activate switch


Can you ask IT to stop turning off your computer? Put a big note over the power button saying "Please don't turn off!" Do they give you a reason for why they are shutting it down? My company wants people to shut them down on weekends to save electricity, but if you explain that you want to log on remotely, they should let you, assuming you're logging in after hours for work-related activities.

As far as modifying the computer, it would be much easier to hack into the innards of the switch inside the case, but that might get you in trouble with your employer if you're hacking into their hardware and probably voiding the computer's warranty. A linear actuator would be your best bet for the outside, but it'll definitely be noticed by people. Y

The easist solution: you could try modifying the BIOS of your computer to automatically turn on every day at a certain time. I've never done this, but I've seen that option when I was in the BIOS a long time ago. Here's one article:

Thanks for the replies!

I will try to answer your questions:

  • Needs to be outside the box (no connecting to power switch)

They send out an email (usually Fridays...letting you know that they will be shut down)

I do not think they do it manually as there are over 100 PC's (they can easily shot them down remotely)

PC is under desk in cube so they would have to be really looking

I am really doing this just to see if I can...probably won't use it unless I know I am going to be working remotely over the weekend

I just found this:

So what I really need is a way to sense that the computer is off so i can push the button without the light sensor getting in the way (may have to go by the sound of the internals (fan, drive, etc.)

I saw a video where someone built a sensor that could detect electrical current nearby...?

Look forward to hearing your input and ideas! Matt

You probably need to talk to the IT people. Maybe it isn't them turning off your computer. If the computer is not your personal property, best not start hacking it.

I really just want to build something just to see if I can and then do something else. This is just for fun. Got tired of watching videos of folks lighting up LEDs and want to see if I can do it and then go on from there. Thought it would be fun.

I like this guys setup. What do I need to buy to replicate this?

and detect current like this:



Anyone know where I can get a case like this one (link below)? All I see are smaller ones. It would need to fit the UNO and servo.

Looks like he us doing almost exactly what I am trying to do!



While I'm all for throwing hardware at a problem, sometimes there are simpler solutions. I really think you shouldn't overlook the simple option of setting your pc's bios to start up at a certain time every day. Set it to 6am every day, if it's already on, nothing happens. If it's off, it'll start up on it's on. There are sometimes other options like waking it by dialing to an external modem, or via mouse/keyboard inputs. Those might be easy to simulate with an Arduino.,1126-8.html

Also, when the computer boots up, is there a login text input window you'll have to type in to get to the point in your OS where you could VNC into the machine? If so, having a "finger" pressing the button still won't let you all the way in. You might have to splice into the keyboard line and program the Arduino to input some simulated keyboard keystrokes to type your username and password.

Here's what I would do: First sense if the computer is on or off though a USB connection. If USB is low, then perform restart operation. All you need is a removable USB connection from the computer to the Arduino and no modification to the computer. If you are concerned, isolate with optical isolation.

For restart operation, perform through optical isolation, which in this case, I would defiantly. For this you will need to tap into the on/off switch of your computer. Pull this switch momentarily low to restart. I imagine you can't do this due to IT rules.

If this is the case, then the only method I can think of is through a mechanical method. Hook up a servo, secure it to the side of the computer and make the servo arm push the on/off button when in reset operation.

If you need a schematic or info on the optical isolator let me know and I can make a sketch, otherwise let us know how it turns out,


Ok, I tried setting up the BIOs to turn on the PC but all settings are locked with an admin password

The computer does not need to be logged in in order to gain access. I am logging into my companies VPN and then accessing my PC through Windows 'Remote Desktop Connection'.

Again, this is not something I am going to attach to the PC permanently...just having fun and saw a problem that could be solved with an Arduino.

Does anyone know how much force one of the cheap standard servos can apply? It takes a few pounds of pressure to push the button in.



servos can be small or big and their power can vary
this will be fine for what you want to do

every desktop has a power light indicator, find that led and tape a photoresistor in front of it and attach a servo by the power button
you want that servo to press the button and then release it, so you have to experiment on how much the servo needs to move
you don’t want to over push the servo in the button because that will strip the gears and make it useless

here is some code that should get you started
keep in mind i am a complete noob and wrote this really quick

#include <Servo.h> // include servo library
Servo myservo;
int lightPin = 1; // photoresistor is connected to pin 1
int val = 0; // store photoresistor value here

void setup()                    // run once
  myservo.attach(6); //attach servo to pin 6

void loop()                     // run over and over again

  val = analogRead(lightPin); // set val by reading the photoresistor

  if(val == LOW) { // if then photoresistor is showing low light), then..

    myservo.write(90); //move servo 90° 
    delay(500); //wait half a second for the servo to get there
    myservo.write(0); //move servo back to 0°

you can unscrew the arm on the servo, so that you can test out the code without worrying about the gears
play with the 90 and 0 until you get it right


Thanks Moe!

Your suggestions and code are very helpful. I went ahead and went with this servo:

I wanted one that was a little stronger (more torque- 41 vs 10 oz/inch) as it takes what I think is more that 10oz if I am correct in my estimation.

Like that free shipping!


Good thing you got a big servo, it will be useful in many other projects BTW if you want to glue the servo to a surface just make sure you wrap it with tape so you can reuse it

The servo I purchased is 6V. If I just want to try it out what is the best way to power it? I bought the starter kit from Adafruit. It comes with usb, 9v plug in and battery connector.

Most servos work on 5v or 6v, you get more torque and speed if use
6v but will be fine if you connect it to the 5v on the arduino

Rather than trying to push a big button with a servo, a simple tranny wired to a digital pin would suffice. Its only a matter of connecting a pin on the motherboard to ground to turn on a desktop PC.

pluggy: Rather than trying to push a big button with a servo, a simple tranny wired to a digital pin would suffice. Its only a matter of connecting a pin on the motherboard to ground to turn on a desktop PC.

A tranny? You mean a transformer? How would that work exactly with a digital pin? Sometimes your advice boggles the mind. :D


I suspect he means tran SISTOR rather than tran SFORMER