Idea how to control PC power using state switch
Melvin.FoX last edited by Melvin.FoX
I am trying to solve a puzzle :) I would like to upgrade Arcade 1Up cab - initially idea was to use RPi but it lacks a bit of power and my MUST HAVE is Die Hard Arcade. I have tiny Lenovo PC laying around and checked that it's capable of handling Die Hard Arcade and Killer Instinct (which would be a nice addition) which are not playable on Pi. Everything seems to be great but I've found one small problem that I have problem to solve :/
Plan was to make A1Up cab non-invasive and do not mod it case that much (only coin buttons drilled as they are essential). So there is built in power switch and volume switch:
With Pi is no brainer - you simply use GPIO pins and few lines of code. Done. With PC it's a lot trickier. Of course I can use volume switch and connect it to one of players button and then assign it using Linux script. But here comes the power problem:
pc is using stateless switch so it works more less like a press button that turns computer on or off. Power switch in A1Up has either state 0 or 1. Turning PC off using this switch should be doable but then I won't be able to power it back on unless I cut power off completely and power it back on again. I thought about some smart power strip but I wouldn't like to cut power off without proper shutdown.
Do you have any ideas how I could solve this? :/
--- EDIT ---
Found out that one of recent Arduinos (with ATMega chip with "u" letter in symbol) is able to emulate HID device like keyboard. So theoretically I should be able to put switch to on or off and depending on what state Arduino will read then I should be able to send ALT + P command through USB port to wake pc up and some other shortcut to say to linux to shut system down.
This YT vid should explain it better :)