Software Support > Automated Projects
PC Smart Switch
DaOld Man:
I was thinking it would be neat to have one switch to fire up the arcade and to shut it down, especially if you have mamed an old original cabinet.
Some folks say just turn the power off, but windows OS dont like that. So I came up with this circuit using two 12VDc relays.
With this circuit, a "always on" 12 vdc power supply is used. Also the power from the PC power supply. (12 volt and 5 volt, for my purposes).
On start, the power switch is off, the PC is off.
Flip the power switch to ON and CR2 comes on.
This closes the contact in to complete the circuit through normally closed CR1 to turn on the PC by the motherboard connection.
This also turns on teh AUX relay, which switches high voltage to monitor, marquee lamp, etc.
When PC power supply comes on (should be pretty quick), CR1 comes on, which breaks the circuit to motherboard power on.
In my circuit, this also turns on the 12vdc cabinet cooling fan.
PC is up and running.
Now turn power switch to off.
This turns off CR2 and AUX relays.
The normally closed CR2 contact completes the path to the keyboard encoder.
I use two diodes to make the P1 joystick left and right to energize.
I have an AHK script running on the PC that when it sees both left and right, it shutdowns the PC.
Windows is happy and so am I.
Now the drawback to this (which really irritated my OCD), is if the power fails (Unplug cabinet from wall, fuse blows, etc), when the power comes back on, and if the power switch is left in ON position, the PC will fire up. This is the case also if you are working on the PC and decide to shut it down from Windows.
So I came up with this circuit:
Here I use an optoisolator, which is turned on when the power switch is off.
When turning the power switch ON, a capacitor keeps the opto on long enough for CR1 to come on and "seal" around it to keep CR2 on.
Now if power fails for whatever reason, or you shutdown windows from the windows shutdown, the pwer switch must be returned to OFF then back to ON to turn on the cabinet.
It worked great for over a month until I replaced relays and optoisolator with some Logical AND gate chips.
I will post the AHK script im using later.
You can use 5vdc relays but you will have to use the 5vdc from computer power supply, and the "always on" power supply will have to be 5vdc.
I had 12 vdc relays in my junk box so thats what I used.
baritonomarchetto:
There are various solutions to the "problem".
One is adding a small capacitor between the power on line and ground.
The other, even simpler, is using the "power on after power loss" (or whatever itnis called) at BIOS level.
Nice to see circuits, anyway :)
Zebidee:
I do this for my cabs using a ~$2 5v relay and a ~$3 momentary power button with built-in LED which lights up a standard power logo/symbol (so you always know if it it powered on).
The power button controls the PC on/off, and the 5v relay is controlled by the PC's power supply via molex. Once the PC comes on, relay trips and power will flow to the rest of the cab (monitor, amp, marquee). You could cut-up an old power board/power strip to plug stuff into, or go all-in and use some terminal blocks for power distribution.
Power comes to the cab via a ~$3-4 PC-style female socket, which means you can use a normal PC power cable (we all have plenty of those) and even remove it as needed (e.g. moving, storing). Socket includes a rocker SPST switch, LED (so you know when it is on) and a fuse.
My family and guests like this setup because it is dead simple and obvious. Press the obvious power button and cab starts up, press it again and cab turns off. As an added bonus, I waste less time explaining how to use the cab.
The cap trick is also handy for getting certain stubborn TVs, and very old PCs (without the BIOS power-on feature), to always come on when power is applied.
DaOld Man:
A little update.
I swapped out the relays with a circuit using 1 triple 3 input AND gate chip and a quad inverter chip.
Only using two of inverters.
This is basically doing the same as the relays, just less power draw and a much smaller foot print.
Whats so special abut this idea?
You can use a switch like an original arcade cab. Flip switch on, PC powers up.
Flip switch off and a AHK script is triggered to exit Mala and do a clean shutdown on the PC.
The purpose of the jumper is to power off auxiliaries (monitor, lights, audio amp, etc), either immediately when switch is flipped to OFF. Cab goes dark and pc shutdowns in the background.
Or you can select to control auxiliaries with PC shutdown. (good for troubleshooting any problems you may have and need to watch it shutdown.)
After I built it, I saw where I didnt really need the third 3 input AND gate.
Hope everyone had a good Christmas and a good start to the new year.
One of my resolutions is to start contributing more to this group.
DaOld Man:
Update. This circuit worked exactly like designed, BUT the AHK script it triggers could never issue an ESCAPE command to exit Mame.
I almost gave up several times.
I had an extra RPi Pico and I have a great idea.
Why not have the smart switch instead of triggering P1 left + P1 right to activate the AHK script, why not just have it trigger the Pico to issue the key press commands?
So I did that, it took the AHK script completely out of the picture.
So I programmed the Pico to send an ESCAPE key pressed to the pc, then a few seconds later send a V key pressed. (Im using V to exit mala) Then issue a shutdown command.
That didnt work either.
Mame just refused to exit and the PC would shutdown before Mala came back on screen.
Why am I so intent on doing this, you might ask? Well, I wanted to preserve the old cabinet feel of a toggle switch that you flip up to start the PC, then flip down to shut everything down.
Why worry about shutting down correctly, you might also ask?
Well Windows doesnt like to be shutdown improperly. And if you shutdown before Mala properly exits, the last emulator and game played will not pop up on the next Mala start up.
Looks like Mala saves all that info on a proper exit.
Again, I was about ready to shelve the whole idea. But my OCD would not allow that.
So I came up with another idea, program the Pico to do what my first circuit did, except send signals directly to the push buttons. first ESC then V.
This works like a charm!
Enough of these rambling on.
Here is a diagram of how I interfaced everything to the Pico.
I used opto-isolators to make sure nothing harms the PC of the key board emulator (Keywiz Max.)
I suppose you could use transistors, but I just feel safer with opto-isolators.
I used what i had in my junk box. I like the TIl119, but I thin kit is obsolete now, im sure just about any opto will work, but you may hae to adjust the input resistor values, and dont use the ones that have a base connection on pin6.
I tied the optos to the pins on the motherboard. (Power button and front panel ON Led).
I used a 150 ohm resistor on the PC is ON opto, that output on my PC is current regulated, so a resistor may not be necessary.
Some PC's go into sleep mode and the ON LED blinks, this cannot be used on this circuit. The signal must remain on solid when PC is on.
It can be tied to the 5 VDC power of the PC power supply if desired, but the resistor will need to be 300 or so ohms. I figured I could add a 150 ohm resistor to get 300, if I need to do that, but so far the ON led pins are working great for me.
Anyway, enough of this book.
Here is the schematic of how I wired everything to the Pico.
The Pico is powered by a 5 vdc regulated wall wart, (made for the RPi), that stays on all the time. (Cabinet off, Pico still on.)
I will post the code I wrote for the Pico soon, and maybe some pics of the setup.
Thanks for your attention to this matter.
Navigation
[0] Message Index
[#] Next page
Go to full version