Introduction: PC Smart Power Controller

About: I'm a computer enthusiastic who likes to share my knowledge and work to the world, and help in whatever I can to make the internet a better place. I mostly build electric-working engine models, and things wit…

I created a device that allows turning any desktop computer ON and OFF using any smart plug through an Arduino nano and some electronics. PCB sponsored by PCBWay - Full feature custom PCB prototype service: https://www.pcbway.com/

Think of it as the PC being controlled like a standard smart plug but doing it in the correct way, pressing the power button to bootup and shutdown as computers normally do.

It has an optional IR receiver so it can power the computer ON/OFF using any standard IR remote control. Hold the LEARN button while pressing the remote control button and it will store it to power toggle the computer.

Description of behavior:

  • When the PC is OFF and the Plug is OFF:
  • If the PC is turned ON, the Plug is going to turn ON.
  • If the Plug is turned ON, the PC is going to turn ON.
  • When the PC is the booting process (the first few seconds), the Plug is also ON:
  • If the Plug is turned OFF, the device is going to turn the Plug ON again.
  • After the booting process period is finished, now the Plug is allowed to turn the PC OFF normally.
  • When the PC is ON and Plug is ON:
  • If the PC is turned OFF, the Plug is going to turn OFF.
  • If the Plug is turned OFF, the PC is going to turn OFF.
  • When the PC is in the shutting down process because the Plug turned OFF:
  • If the Plug is turned ON while the shutting down process, it will stay ON but it’s not going to have any effect on the PC. When the PC finishes shutting down, the plug is going to turn OFF.
  • If too much time passes and the PC does not finish shutting down, the device is going to turn the Plug ON, or is going to remain ON if it was ON.
  • When the device gets power
  • If the PC was already ON
  • If the Plug was ON, the device is not going to do anything, but it will enter into a period where the plug can’t turn the PC until that period finishes. It is only a few seconds, the same as the booting process.
  • If the Plug was OFF, the device is going to turn the Plug ON and it’s going to wait for the booting process to finish until the Plug can turn the PC OFF.
  • If the PC was already OFF
  • If the Plug was ON, the device is going to turn the Plug OFF.
  • If the Plug was OFF, the device is not going to do anything.

Supplies

Materials:


Recommended Tools:


Note: As an Amazon Associate I earn from qualifying purchases.


Files:

Step 1: Prepare Smart Plug

  1. Setup the smart plug with your home and make sure it works correctly. The process depends on the brand and protocol, but usually it connects to your WiFi through an app. Then the account is linked with Google Home, Alexa, or whatever voice assistant you want.
  2. Open the case of the smart plug. You might need to break the plastic to be able to open it. You later are going to need to glue it back together so try to not destroy the case.
  3. Solder two wires to the push button pins. I recommend using wires of different colors taking note of where they are connected.
  4. Solder two wires to the LED pins. Make sure you are soldering into the actual power indicator LED, because there might be a bi-color or even RGB LED that has more than two pins so you need to check with a multimeter which one indicates the power state of the plug. I recommend using wires of different colors and take note of the polarity.
  5. Check the wires connected to the power LED send voltage (should be around 3 V) when the plug is ON and 0V when the plug is OFF, and when you short the button wires it should toggle the plug ON/OFF.
  6. Make a hole on the case to pass the wires and glue everything back. I used Loctite Liquid Professional Super Glue https://amzn.to/2N7d1He

Step 2: Prepare PC

  1. Open your computer case and identify the two wires that go to the power button and the two wires that go to the power LED. They all go from the case to the motherboard.
  2. We need to get those 4 wires out of the PC case so you can either solder wires directly or create an adapter that splits the wires in a way that goes in between the original connectors and the motherboard. I recommend using wires of different colors taking note of where they are connected.
  3. Test shorting the wires for the power button to make sure it actually turns the PC ON/OFF, and check that we get voltage in the power LED wires when the PC is ON, that should be around 3 V.

Step 3: PCB

  1. Upload my arduino sketch to the arduino nano you are going to use. It’s a little hard to test that it’s working since we don’t have anything connected yet, but you should see in the serial monitor a constant information about the state of the board so that’s one way we can see if it’s working correctly.
  2. Either solder the components to the PCB, or connect everything in a breadboard as shown in the diagram. Before soldering the LEDs, make sure to add the LED spacer 3D print so it has the correct separation to the PCB.
  3. Connect the wires coming from the computer to our device. Make sure the LED in the PCB indicates the state of the computer.
  4. Connect the wires coming from the smart plug to our device. Make sure the LED indicates the state of the smart plug, and see if everything is working. The button LEDs should indicate when the device is pressing those buttons.
  5. If you want to add the IR receiver, test that. Remember to press the LEARN button while pressing the remote control of your choice.

Step 4: Final Details

  1. Install the PCB in the 3D printed case.
  2. Add the stickers to the case.