I'm planning to create a simple remote power button for my PC using an ESP8266 (specifically the ESP01-S), and I need some guidance on the physical connections. The power button is activated by connecting its power pin to ground. I'm curious if I can directly connect this power pin to the ESP and pull it low to simulate a button press. If this is possible, what resistor value should I use between the ESP and the power pin to ensure it is protected? If it's more complicated than that, I'm open to using an optocoupler or a transistor, but I'd prefer to keep it simple if I can avoid additional circuitry.
3 Answers
Have you considered using Wake on LAN (WOL)? It’s a convenient option.
Yes, you can connect the power pin to the ESP and pull it low, as long as the ESP and the PC's motherboard share the same ground. However, if the ESP isn’t powered by the PC’s supply, you might run into issues with different ground planes causing current to flow unexpectedly.
Got it! The ESP will actually be powered by the PC's PSU's 5V standby line, using a USB 2.0 header that stays on while the PC is off. Do you have any recommendations for the resistor value to place between the ESP and the power pin?
A simpler solution could be to get a smart plug to control your PC. You can set it to turn on automatically after a power loss, just switch it off and on manually. But don't forget to shut down your PC properly first!
That's an interesting idea. But I don't want my PC to automatically power on after a power loss.

I have some reasons against WOL: mainly, I can't use it to force my PC to shut down during issues, and I’ve had bad luck with it on past PCs. Plus, if my PC loses power completely, WOL won’t wake it up again, even though the BIOS settings remain unchanged.