Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Time Delay Power Button  (Read 6660 times)

0 Members and 1 Guest are viewing this topic.

wxforecaster

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 105
  • Last login:February 28, 2019, 01:19:24 pm
Time Delay Power Button
« 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
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!

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Time Delay Power Button
« Reply #1 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.

wxforecaster

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 105
  • Last login:February 28, 2019, 01:19:24 pm
Re: Time Delay Power Button
« Reply #2 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" :)

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Time Delay Power Button
« Reply #3 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.

wxforecaster

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 105
  • Last login:February 28, 2019, 01:19:24 pm
Re: Time Delay Power Button
« Reply #4 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.

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Time Delay Power Button
« Reply #5 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?
« Last Edit: September 11, 2013, 09:16:44 pm by DaOld Man »

DaOld Man

  • Moderator
  • Trade Count: (+4)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 5139
  • Last login:December 13, 2023, 12:03:14 am
  • Wheres my coffee?
    • Skenny's Outpost
Re: Time Delay Power Button
« Reply #6 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

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

wxforecaster

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 105
  • Last login:February 28, 2019, 01:19:24 pm
Re: Time Delay Power Button
« Reply #7 on: September 14, 2013, 10:17:49 pm »
Outstanding w/ soldering and your diagram is excellent and makes 100% perfect sense.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Time Delay Power Button
« Reply #8 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.