3
\$\begingroup\$

What I basically want to do is to connect one of the digital pins of a network-attached Raspberry PI to (one of) the connectors of the PC Power On button, so that when I issue a command coming on the network, the Raspberry will receive it and send an power on signal to the PC.

Can someone tell me more about the power on/off signaling procedure on a PC (hardware enabled)?

I assume it is something like the button allows or disallows the connection to sink or source for some amount of time (at least for power-off the amount of time seems to be relevant). I need to know also the source voltage, of course.

I think the button in its regular position will allow the flow of 5V (high) and disrupt it when the button is pressed, 0V (low).

My multimeter is currently broken.

\$\endgroup\$
1
  • \$\begingroup\$ You may be chasing an XY problem here. Most modern Ethernet adapters for PCs support listening for a "magic packet" which is sent to the computer in order to wake it up. This feature can usually be enabled in the BIOS/UEFI. Having the Raspberry Pi send such a packet to the PC's NIC instead of electrically connecting to the power switch might be an easier, more flexible, more reliable and more standardized solution to your problem. \$\endgroup\$
    – Dampmaskin
    May 15, 2019 at 8:49

2 Answers 2

5
\$\begingroup\$

In a PC with ATX power supply, a 5V rail (low current) is always on even if the PC is shut down. This is called 5V Standby rail.

The power button (on the front panel connector) is a logic input going to the front panel driver IC (ACPI). This front panel IC is on the 5V standby rail so it is always sensing the power button.

Once the proper logic level is detected on the power button, ACPI latches the ATX power supply pin "PWR ON" to ground and all other power rails on the power supply turn on. Once all the power rails are stable, "PWR GOOD" is asserted and motherboard starts using the power from the rails.

pwr btn logic ATX connector

As it can be seen from the picture below, power button is a active low signal. When power button pin is brought to the ground potential, it is asserted.

enter image description here

Finally, you can connect your Raspberry Pi to the motherboard front panel connector like this: mb connection

Further Reading:
1. Power Management IC Simplifies ACPI Implementation
2. ACPI Spec

\$\endgroup\$
3
  • 1
    \$\begingroup\$ If you just mention an open collector or open drain circuit configuration in parallel to the switch then I think that will cover all that the OP needs to get running. \$\endgroup\$ Mar 3, 2013 at 18:16
  • \$\begingroup\$ @rawbrawb I'm not sure if the input is open drain or open collector. I'm sure it can be found in the super IO datasheet. \$\endgroup\$ Mar 3, 2013 at 18:18
  • \$\begingroup\$ I'm just saying that you have all the parts in place and nicely documented, you just now need to show them how to wire it up using a transistor (or something else) connected to an OP pin to trigger the operation, typically a OC or OD configuration. \$\endgroup\$ Mar 3, 2013 at 18:53
1
\$\begingroup\$

Connect the signal output from the R-pi to an NPN transistor connected like this:

enter image description here

In this circuit R1 limits the current from the R-pi output to a safe level. R2 is used to ensure that the NPN transistor stays fully off when the R-pi may be disconnected or turned off. The R-pi GND needs to interconnect with the circuit GND and the PC GND. Wire the PWRBTN output pin over to the same connection at the motherboard where the front panel power button connects. (You can also connect at the front panel if that is more convenient).

The front panel harness often has a pair of wires (one black and one red or another color) that afix to a 2-pin connector that then attaches to the motherboard. The black connection should be going to the GND and the colored wire to the PWRBTN signal of the motherboard. Use care to check carefully because someone may have installed the two pin connector from the front panel in a reversed manner which would still function for a mechanical switch but will not work correctly for this circuit which is polarity sensitive.

To operate this circuit the R-pi would normally keep its GPIO output in the LOW state. It would then set it HIGH for 0.5 to 1.2 seconds to operate the power ON request to the PC. If the PC was already ON then a short duration press of the same duration will initiate a PC shutdown if the operating system is configured to accept a shut down request. Available configurations are likely to include PowerOff, Hibernate and Sleep. It is also possible to force the power OFF state by having the R-pi assert the HIGH on the GPIO of a period of 5 to 6 seconds. This latter mode invokes a mode within the PC chipset called PWRBTN Override which forces the system into a power off state in an ungraceful way.

(Do note that forcing the system off using the Override mode may cause the loss of data if programs have files open with data buffered in memory without being closed. The graceful shut down with a short power button press generally will cause the operating system to post warning dialogs that there are programs with open files still active).

I have suggested a range of 0.5 to 1.2 seconds for the short power button press to ensure that the motherboard logic detects and registers the power button request. It is certainly possible that a shorter pulse will be effective but keep in mind that motherboard circuits often contain R/C circuits on the switch lines and the PC chipset also contains a switch debounce circuit. What this means is that a 1 msec pulse from the R-pi is unlikely to ever work. A 100 msec pulse may work most of the time but certainly dependent on the motherboard design. The longer range I suggest should always work unless the motherboard is broken or the circuit is connected wrong.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.