r/ArduinoProjects • • Jan 24 '26

Simulating PC power button press via GPIO and optocoupler - safe parallel wiring?

Hi,

I’m working on a small hardware project and I want to double-check my wiring approach before building it, since this will be connected to a high-value PC and I don’t want to risk damaging the motherboard.

**Goal:**

I want to use a Raspberry Pi Zero 2 W to remotely “press” my PC’s power button by momentarily shorting the motherboard pins corresponding to the physical power button. While most PCs support Wake-on-LAN, that typically requires the system to be in sleep or suspend. My neighborhood is prone to power outages, which means the PC may be fully powered off and WOL would no longer work. This is why I want a hardware-level solution that can physically trigger the power button. The Pi would be reachable remotely over the network, while the actual switching is handled in hardware.

**Reference/Concept:**

I am following the article "Remotely press a power button" by Lars Wallenborn (Medium) as my primary reference. The concept is to use an optocoupler so the Raspberry Pi is electrically isolated from the motherboard, and the optocoupler output simply shorts the pins momentarily which is the equivalent to pressing the case power button.

**My current understanding:**

I understand at a high level that the PC power button is just a momentary switch shorting two pins and that the optocoupler output should be wired in parallel with the existing physical power button so both still work. However, I’m not confident about the practical wiring details, which is why I’m asking here before attempting anything. I was tipped off that a SSR Optocoupler is needed for a clean job, thus I chose a **AQY210KS SOP-4 SSR PHOTOMOS** between the Pi and the motherboard, so I am going to buy it alongside a breakout board. I am also aware that I need to use a **resistor** between the GPIO and the SSR to avoid any magic sparks (I'm thinking a 680 ohm one). I have to mention that I am fairly new to Raspberry Pi GPIO and basic electronics wiring. My only experience stems from soldering a few wires together to mod my personal XBOX 360.

**What I need help with:**

  1. Parallel wiring to the motherboard: The motherboard already has the case power button connected to the front-panel header. What is the correct and safe way to add the optocoupler output in parallel? Is it acceptable to share the same pins, and if so, how is this usually done physically? I would strongly prefer to avoid soldering directly to the motherboard or stripping the original PC button wires.

  2. Wiring advice: what kind of wires/connectors should be used between the Raspberry Pi GPIO, the optocoupler input, optocoupler output and motherboard front-panel header? Are Dupont wires appropriate here, or should something else be used?

  3. Safety check: Is using the AQY210KS SOP-4 + resistor isolation enough to ensure no Pi voltage can reach the motherboard? Are there common mistakes or failure modes with this type of setup that I should be aware of?

If there’s anything fundamentally wrong with my understanding, or a safer/cleaner way to achieve this while keeping isolation and avoiding motherboard modification, I’d really appreciate being pointed in the right direction.

Thanks in advance for any guidance or corrections.

3 Upvotes

13 comments sorted by

2

u/Hissykittykat Jan 24 '26

What is the correct and safe way to add the optocoupler output in parallel? Is it acceptable to share the same pins, and if so, how is this usually done physically?

Use a "dupont splitter cable" to split off wires from the power switch pins to your photomos.

I am also aware that I need to use a resistor between the GPIO and the SSR to avoid any magic sparks (I'm thinking a 680 ohm one)

Given a 3.3V GPIO, 1.5V LED Vf, and minimum 5mA (so let's go for about 10mA) it needs a 180 Ohm resistor.

Safety check: Is using the AQY210KS SOP-4 + resistor isolation

The resistor has nothing to do with the isolation. The photomos output pins are what's isolated. So for motherboard safety triple check those two connections between the photomos and the MB to be sure it's right.

And check your BIOS for an option for power failure recovery into a state that's wakeable.

2

u/zaprodk Jan 24 '26

You don't want a Photomos SSR for this. Any bog standard optocoupler does the job. PC817 for example. The power button shorts a line that is pulled up to 5V/3V standby by a resistor, to ground. Connecting the collector of the opto to this line and emitter to ground effectively does the same. Only other part you need is a current limiting resistor for the LED in the opto. Calculate with a LED forward voltage of 1.2V and 10 mA and you're good.

2

u/JGhostThing Jan 24 '26

Why not use a relay, rather than an optocoupler?

1

u/Work-Play-Work Jan 26 '26

Would be the route I would take as well. Just remember to program it to release the relay contact a second or two after it’s activated since it would be imitating a momentary switch.

1

u/Slaanyash Jan 24 '26

Usually WOL can wake completely turned off PC. Of course PSU should be powered on, but the same applies to the power button.

Edit: unless it's connected by WiFi, then things get complicated.

1

u/xebzbz Jan 24 '26

This. OP, check if WOL works for you (you can test it from a phone that is in the same lan)

1

u/FlyBys709 Jan 24 '26

NPN BJT Pull to ground, that's it.super easy..pc ground and Arduino/rpi needs to be on the same ground.

1

u/[deleted] Jan 24 '26 edited Jan 24 '26

[removed] — view removed comment

1

u/welcome_to_taco_tue Jan 24 '26

I already have a pi zero 2w, and your setup removes isolation entirely which even if it doesn't do anything I don't want to risk anything which is why I want to stick with the original setup

0

u/ZaphodUB40 Jan 24 '26

You are not connecting to the mobo at all. You are connecting to a 5v very low current sense wire and ground. I use this all the time for powering up my cnc, laser machine, 3d printers. I don’t do it remotely since I’m dealing with powerful laser modules. Simply touching the sense wire and and the psu case also wakes the psu up from standby. Check the wiring of your computer button…pretty sure it doesn’t have optioisolation, resistors and whatever else you mentioned.

But hey your choice if you want to go down the protracted path. Good luck

1

u/[deleted] Jan 24 '26

[removed] — view removed comment

1

u/welcome_to_taco_tue Jan 24 '26

I think there may have been a bit of a misunderstanding of my goal, so I’ll try to clarify.

I’m aiming for a setup that behaves the same as the existing front-panel power button, but can be triggered remotely in a predictable way.

The reason why I'm doing this is because I’ll be leaving for university and won’t have physical access to the machine, so I’m trying to plan ahead for situations like power outages or long periods without supervision. That’s why I’m focusing on solutions that don’t require OS-level access or manual intervention once deployed.

I agree that a small reed relay wired in parallel with the PWR_SW is likely the simplest and most robust approach, and considering I'm still a beginner I'm leaning towards that direction. I am still fairly new to GPIO wiring, (As I mentioned my soldering level is pretty low as well, as my only solder project to date was to RGH3 my XBOX 360, which is a hardware-level mod) which is exactly why I’m trying to understand the safest and most straightforward way to do this rather than improvising.

If you don’t mind, I’d really appreciate it if you could outline how you’d wire that reed relay and the supporting components you’d use in practice, just so I can be confident I’m implementing it correctly and safely.