Sunday, May 6, 2007

Switching the power

WARNING: working with 125 volts can be dangerous.
Please do not attempt to do this if you do not fully understand what you are doing.
I cannot be held responsible for any mishaps, fires, damage, or personal injury.
Working with electricity can either be safe, or extremely dangerous, depending on what you do with it and how you do it.


I have been asked, how do I turn everything on and off on the arcade?
I have used a fairly simple approach since my first machine, Benny B's Arcade.
Well, it's simple if you know a little bit about electricity. If you dont know anything about electricity, dont let it scare you. Its really not that complicated.
The idea is to have everything else come on when the computer is turned on, then everything turn off with the computer turns off.
Everything else means the monitor, the marquee lights, the coin door lights, the speakers, and the cabinet fan.
At this stage of the project, you have to look at the arcade machine as a computer, because really thats all it is. When you turn on your computer, the monitor has to be turned on, then the speakers.
You probably do this on your home computer by stepping through the power buttons.
But on an arcade machine, we want to be able to do all this with the press of one button. But not only do we want the monitor and speakers to come on, but also the marquee light, the fan, and the coin door lights.
In earlier times, people used a computer running only DOS operating system.
The computer used what was called an AT power supply. If you have had a computer 10 years or so ago, you might remember that you had to turn the computer off after shutting down Windows. (The message "It is safe to power off your computer" would pop up after quitting Windows). This was a computer with an AT type power supply.

On these earlier home arcade machines, you simply turned on and off a switch (usually in the back of the cabinet, out of sight). The computer, the monitor, and everything else was wired through this switch. Turn the switch on, the computer booted up and everything came on. Turn the switch off, everything turned off.
This worked great for those setups.
And this may be the way you want to go.
Here is a diagram I drew to help explain how you would do this, if you chose this route:

You can click on the picture to enlarge it, press your browsers back button to get back here.
With this setup, you use an ordinary surge protected power strip (SPS), which the computer and everything else plugs into.
You cut the cord of the power strip, tie the white wires back together, and the green wires back together. You then tie the black wires to a toggle switch, which is mounted somewhere on the cabinet.
Turning the switch on turns on the power strip, turning it off turns off the power strip. Anything plugged into the power strip will then be controlled by the toggle switch.
In this setup, the toggle switch MUST be rated for at least 125 volts AC, and it also must be rated for at least 10 amps. The power strip needs to be a surge protector type (to protect the computer against incoming power surges).
When the white and green wires are connected (spliced), they need a good tight connection. Best is twisted, soldered, and heat shrink tubing (or electrical tape) applied for insulation. Next best method is to use insulated butt splice crimps. You could also use "wire nuts", but if these are not installed correctly, they could create a problem later.
The black wires need to be attached to the switch by soldering (best) or crimp terminals.
All connections need to be tight and well insulated. A loose connection will create heat, which is a definite no-no. A poorly insulated connection may short out, causing sparks, or be a shock hazard. If you dont feel good about doing this, get someone who is experienced to give you a hand.
An alternate method would be to buy a power strip that has a switch already on it, then mount it where you can get to the switch to turn it off and on. (No splicing the wires necessary.)

The above method works great, if you are using an older type computer for your arcade.
But most computers nowadays use what is called an "ATX" power supply.
These computers shut down automatically when you quit Windows.
This is the type computer I will be using for my arcade.
Even though you could still use the above procedure to turn off your arcade, you will need to press the button on the computer to turn it on. Plus, Windows doesn't like you to shut down the computer by turning off the power.
What I wanted was two buttons on my control panel, one to turn everything on, and another to shut everything down.

So I came up with two power strips, one is a surge protected strip. The computer plugs into this one. Another power strip (a cheap one that is not surge protected) also plugs into the surge protected strip. The cheaper strip is wired with a 12 volt relay to turn it off and on.
Look at this diagram:As you can see, I am switching the black wire of the power strip (PS) with a relay.
This relay has a 12 volt dc coil, and 10 amp normally open contacts. The monitor, fan, and everything else plugs into the power strip (PS).
The surge protected power strip (SPS) only has the computer and PS plugged into it. It is powered on all the time.
The coil of the relay is powered by 12 volts from the computer. It is attached to the black and yellow wires inside the computer that plug into the hard drive, the floppy drive, or the cd rom drive. (More on how I made these connections later.)

To be able to turn on the computer, I wired a normally open pushbutton (PB1) that is mounted on the arcade's control panel, to the "power on" switch inside the computer. This is the button on the front of the computer you would normally press to turn on the machine. On most computers, this button only has two wires. You simply splice into these two wires. (More details later).

The way this works is extremely simple.
When you turn on the computer by pressing its power on button, the power from the computer's power supply turns on the relay, which turns on PS, which powers up everything plugged into it. Shutting down the computer turns off the relay, which turns off everything plugged into the PS power strip.

The relay must have a 12 vdc coil, and its contacts must be rated at least 125 volts ac, with at least 10 amps of current. Also, all the connections must be tight and insulated. Radio Shack sells a relay which works good. If you dont like to solder, pick up some crimp connectors for it too. (The people at Radio Shack should be able to tell you what you need.) The relay must have at least one Normally Open contact. This is the only contact on the relay you will need.
Relays are also available from many sources on the web.

I used a small relay that I attached right to the power strip (PS). I may talk more about that later, but this should give you an idea of one way to do the power switching.
An alternate method would be to use a relay with a 5 volt coil, then plug the relay into a USB port. I haven't tried this, but it should work just as well, and you wouldn't need to splice into the computer's power supply wires.

WARNING: working with 125 volts can be dangerous. Also letting the 125 volts come into contact with the 12 volts can fry your computer's power supply.
I cannot be held responsible for any mishaps, fires, damage, or personal injury.
Working with electricity can either be safe, or extremely dangerous, depending on what you do with it and how you do it.

Now, how do I shutdown the machine with a button on the control panel?
Well, if the computer you are using lets you shut down your computer by pressing the power button, you can simply press PB1.
But Windows may not like this, and not all computers are capable of doing this.
So I wired another button, (mounted on the control panel) into the keyboard encoder that sends a button press to the computer.
My computers "front end" is set up to exit if it sees a "C" pressed.
There is also a button to quit a game, this sends an "ESC" to the computer. But this only exits the game and returns to the front end.
When the front end exits (by pressing "C"), I have a program that automatically shuts down the machine.

This program, called "The Launcher" was written by me and is available as a free download.
The Launcher is set up by you to start your favorite front end when the computer boots up. It waits in the background until it senses that you have exited the front end.
It then pops up a "shutdown screen" (which can be designed by you), that tells you the arcade will shut down in so many seconds. During this time, a special key on the keyboard can be pressed to cancel the shutdown, in case you want to return to Windows and do maintenance on the computer, install new games, whatever.
If the button is not pressed before the countdown reaches zero, The Launcher will shutdown Windows, power off the computer, and the relay will turn everything else off.

Here is the link to The Launcher, feel free to use it if you want:
http://skennys_outpost.tripod.com/thelauncher/index.html

The Launcher requires Windows 98 or better, and an ATX type computer.
There are other methods to shut down your machine, but the method I have just discussed works great for me. Just google search and see what you can come up with.

Note: The above wiring diagrams are for 125 volt AC, which is common in the US.
European systems which use 220 volts, may wire differently. But the concept is the same.
Just make sure the relay contacts or the switch contacts are rated for your voltage and current.
Above all else, be safe!
---------------------------------------

No comments: