You'll need a simple ESP32 or ESP8266, at least 2 jumper wires and a USB cable for the ESP.
1. Find the
power switch connectors on your motherboard. If you need to find the manual of your motherboard, you need to know the model! On Windows, Win+R,
msinfo32, and look at the value of
BaseBord Product.


Find the Power Switch.jpg (822.37 kB. 2115x1741 - viewed 40 times.)" alt="" class="bbc_img" />
2. Use jumper wires to make your cables. If you want to continue to be able to use the Power switch on your PC, you have to do a split cable (Y) to receive the signal from the button and from your ESP. You should be able to use both...
3. You can use my very simple code
#include <WiFi.h>
#define pinBtn 13
const char* ssid = "WIFI_NETWORK";
const char* password = "WIFI_PASSWORD";
WiFiServer server(80);
void setup()
{
Serial.begin(115200);
pinMode(pinBtn, INPUT_PULLUP);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
Serial.println(WiFi.localIP());
server.begin();
}
void loop() {
WiFiClient client = server.available();
if (client) {
String currentLine = "";
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (c == '\n') {
if (currentLine.length() == 0) {
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println();
client.print("<html><body>Ukrainians are the best</body></html>");
client.println();
break;
} else {
currentLine = "";
}
} else if (c != '\r') {
currentLine += c;
}
if (currentLine.endsWith("GET /PowerOn")) {
powerOn();
}
}
}
client.stop();
}
}
void powerOn() {
pinMode(pinBtn, OUTPUT);
digitalWrite(pinBtn, LOW);
delay (100);
pinMode(pinBtn, INPUT_PULLUP);
}
4. Get the IP of your ESP in the
Serial Monitor or with your router. You can make it static if you want to be sure it will always be the same.
5. Create your Android app, you can use this free website:
http://ai2.appinventor.mit.edu. Then import the file in the Zip, click on
Blocks in the top right corner, change
http://10.0.0.61/H for
http://IP_OF_ESP/PowerOn. And then click on
Build,
Android App (.apk), download, install and test it!
6. Install the ESP in your case, pass a USB cable where you can and connect it to an always on port and you're done.
Super simple and fast.