Build Your Own Arcade Controls Forum

Software Support => Automated Projects => Topic started by: wxforecaster on September 03, 2013, 11:41:53 am

Title: Time Delay Power Button
Post by: wxforecaster on September 03, 2013, 11:41:53 am
Using a SMART power strip, my plan is to power off all peripheral devices (monitor, speakers, etc...) when the PC is powered down.

I want to use something like this:
http://www.ebay.com/itm/16mm-12V-Angel-Eye-BLUE-Led-Metal-Switch-Latching-Push-Power-Button-US-/141013411290?pt=LH_DefaultDomain_0&hash=item20d50de5da (http://www.ebay.com/itm/16mm-12V-Angel-Eye-BLUE-Led-Metal-Switch-Latching-Push-Power-Button-US-/141013411290?pt=LH_DefaultDomain_0&hash=item20d50de5da)
which is a 12V LED momentary contact switch.

I want a button press to turn on the computer (and all accessory devices plugged into the strip).
I want the button press again to turn off the computer (and all accessory devices into the strip).

Here's the catch:
- To avoid an accidental press, I want the power button to act like the one on my PC. An instant press turn it on, but to turn it off, I have to hold it for 2-3 seconds first.
- I want the computer to go through a normal clean shutdown process (hard powering off is not good). If it matters, I am using HyperSpin and an iPac for inputs.

Thanks!
Title: Re: Time Delay Power Button
Post by: DaOld Man on September 03, 2013, 12:43:24 pm
Look in your BIOS settings. Most motherboards have the option to hold power button for 2-4 seconds to power down.
But you don't want the hard power off.
I think Windows XP has a power down option too. Check control panel to see if you can find it, I cant remember where it is. (I have Win7 on this PC and cant find it, but that doesn't mean it doesn't exist on Win7.)

Of course if none of the above works for you, you could possible use a relay to switch the power button wires to a keyboard input on boot up so that the next power button press will trigger a shutdown in your frontend.
Of course the frontend would have to be setup for this too.
If you have a printer port, you could switch the button to an input on it, using a simple program that monitors that input, press and hold the button for 4 seconds and the programs initiates a windows shutdown.
(I can probably produce a program for you if you want to go this route.)

Lets think on it, im sure there is a simple way to do this.
Title: Re: Time Delay Power Button
Post by: wxforecaster on September 03, 2013, 04:53:59 pm
I think the "shutdown" aspect might be the easier of the two problems, as I think you could implement a keywait (or whatever the syntax is) into an autohotkey script used by HyperSpin. If the button isn't held down for X seconds, nothing happens. If it is, send a peaceful shutdown command to Windows.

However, in the PC's off position, obviously nothing is there software wise to turn the computer on.

I haven't even built the gaming PC yet, so this would all be tested via a dummy load on an old desktop, etc.. I'm planning on using a SSD and whatever OS makes the task easier (I've successfully run MAME and HyperSpin on XP and Win7 64 bit systems).

Thanks for your offer of help "Old Man" :)
Title: Re: Time Delay Power Button
Post by: DaOld Man on September 03, 2013, 05:08:01 pm
Well, that's where the relay would come in. Connect the power button to the MB PWRON terms, then when it comes on, relay comes on and switches the power button to an input.
Arcade shuts down, relay turns off, and power button is back to motherboard, ready for next on command.
Relay could be a small 5 or 12 vdc DPDT.

BTW: I run Mala and Mame on this 64 bit Win 7 PC quite a bit.
Title: Re: Time Delay Power Button
Post by: wxforecaster on September 10, 2013, 09:29:13 pm
So I get the concept of a relay, but figuring out which type I need is where I am lost. Obviously there is a voltage/amperage requirement on both halves of the relay. Not sure what the ATX power on requires, and the other half to the iPac would be 5V I assume.
Title: Re: Time Delay Power Button
Post by: DaOld Man on September 11, 2013, 09:14:57 pm
The relay can be just about any type. Voltage and current are low.
Im sure there are other ways to do this, but with my suggestion you need a DPDT relay with either a 12 VDC or 5 VDC coil. (Got to be DC not AC).
The contacts need to be rated for at least an amp, which should be pretty common and cheap.
here is a quick diagram showing what Im talking about.
With PC off, relay is off. The button is connected to the PC power on connector.
Press the button and the PC turns on, which turns on the relay.
The button is now disconnected from the PC and connected to your input to the PC.
Next button press (and hold), will trigger the program to shut down PC.
PC power downs, relay turns off, button is now connected back to the PC power on terminals.
Press button and PC turns on.
Is this what you have in mind?
Title: Re: Time Delay Power Button
Post by: DaOld Man on September 11, 2013, 09:24:48 pm
If you are handy with soldering, here is a relay that would work:

http://www.radioshack.com/product/index.jsp?productId=2062483 (http://www.radioshack.com/product/index.jsp?productId=2062483)

Or this one would be easier to wire, still requires soldering. You can also get a socket for this one.

http://www.radioshack.com/product/index.jsp?productId=2049722 (http://www.radioshack.com/product/index.jsp?productId=2049722)
Title: Re: Time Delay Power Button
Post by: wxforecaster on September 14, 2013, 10:17:49 pm
Outstanding w/ soldering and your diagram is excellent and makes 100% perfect sense.
Title: Re: Time Delay Power Button
Post by: Howard_Casto on November 02, 2013, 08:19:47 am
I have my cabs setup in a similar manner.  The 5v from the power supply of the computer trips the relay, so when the computer is on, the monitor and ect comes on.  When you hold the computer's stock power button to shutdown, the computer eventually powers down and off go the accessories. 

My only word of warning is that some versions of mame (heck maybe even the latest version of mame) ignore the "shutdown" messages sent to all running apps when the power button is pressed.  So don't try to power down while in-game.