[SOLVED] Power PC by mimicking the on/off btn (optocoupler? transistor? relay?)

SOLVED - see post #5 for the prompt and #6 for a description of my solution (hint: common ground!)

I want to switch on a PC with an Arduino by connecting to the atx front panel pins on the motherboard (see the image for pinout of that 2x5 connector). As I understand it, the power button is a normally open (NO) connection. When the power button is pressed it simply connects the two pins which triggers the motherboard to power up, shutdown, sleep etc, the action of course depending on the motherboard's current state and how it's configured.

I tried faking this power button using an optocoupler (4n35, as seen in image) and also using an NPN transistor (bc547) but with no luck and I don't get it. I can switch on an LED if I Do these components need a minimal load in order to fully switch? Is my only option to use a relay? I find that option rather clunky, although if it's the only way then that's that.

Thank you for your wisdom!

What I would like to happen - doesn't work

This scenario, however, does work

If you measure across those two pins labeled Power Switch you will likely find one is Ground and the other measures 5 volts (SB) through a pull up. I have done it using a common NPN like a 2N2222 or 2N3904. Connect Emitter to Ground pin and collector to the pin measuring 5 Volts through a pull up. Just make sure the NPN emitter is on the ground pin. All that is needed for start is a momentary pulse (100 mSec) on the base pin and since current is minimal maybe a 330 Ohm base resistor or higher.

Ron

Thanks for the reply. I don't have a 2n2222 transistor here at the moment, do you think the BC547 NPN that I do have should give similar results? I tried what you said but to no avail. I measured ~3.3V over the power button pins by the way, but that shouldn't change too much about the general approach, should it?

This unfortunately does not work (with BC547 NPN transistor)...

That should work, just about any small signal NPN switching transistor. I did notice the different pin out of CBE verse EBC. :slight_smile:

Ron

Well, it really is not working for me. Since my motherboard’s voltage is different (3.3v instead of the 5V you mentioned), could there be something different about this motherboard’s inner workings than you described?
Regardless, I had a notion that maybe (I really don’t understand the dynamics of transistors that well) the logic voltage on the base shouldn’t be higher than the voltage over the collector and emitter. Between my digital pin out and the base of the transistor I inserted a potentiometer, in essence a voltage divider, and tuned it to ~3.3V (a bit more, a bit less). Still no dice :frowning:

Are you sure that the motherboard connector pin 8 is ground?
How are you powering the Arduino?
Do you have a common ground between the Arduino and PC?
How long are you pulling the motherboard connector pin 7 to ground? Most motherboards are waiting for the Power_Good line from the PSU to go high before actually starting. The spec for ATX says 400ms, so you should hold the power switch (pin 7) low for that long.

Oh my goodness, common ground was the thing. Such an oversight looking back. Shame! :slight_smile:
I connected the ground of the motherboard's power led (pin 4) to the ground of my Arduino (being powered from my laptop) and now it works. Deep face-palm :slight_smile: Thanks for the help!

If it is OK to leave the PC in sleep mode instead of a full power down, the you may have the option of using the “wakeup on lan” feature instead of making a wiring change. That is you send a sleeping PC a special packet (magic packet) to wake it. I do this with one of my PCs from another PC, but I guess you could also do it from say an ESP8266 etc.

Ps common ground may not be relevant if you are using an opto-coupler.

Yay, a happy ending. :slight_smile:

Ron

6v6gt:
If it is OK to leave the PC in sleep mode instead of a full power down, the you may have the option of using the “wakeup on lan” feature instead of making a wiring change. That is you send a sleeping PC a special packet (magic packet) to wake it. I do this with one of my PCs from another PC, but I guess you could also do it from say an ESP8266 etc.

Wake-on-LAN - Wikipedia

Ps common ground may not be relevant if you are using an opto-coupler.

Thanks for the suggestion for WOL, but it's not an option for me since I'm only using an Arduino for the task of powering on/off the pc. The ESP8266 option could be viable for WOL, although my requirements also include being able to force-shutdown the PC (ATX 4 second power btn down).