A: 

Use a serial port, which drives a H-bridge (you can get a chip off digikey) which drives a relay (digikey again). The H bridge electrically isolates the serial port and limits the current draw. It's not possible to switch wall current with a transistor, so that's why you use a relay.

Nick
+14  A: 

Look into X10

(Edit: replaced original posters NSFW link with wikipedia page on X10)

Jason Punyon
You beat me to it. And I'd give you a +1 if I had any more votes today...
lc
NSFW link. All I saw were chicks in lingerie and had to close it immediately. Bad form.
jcollum
By bad form I mean: what were you thinking?!
jcollum
You're kidding me. It at least used to be a great and rather inexpensive home automation solution!
lc
X10 is pretty well supported by OS software. I ran it on a Linux box in my college days and it worked great. You can get 3 lamp modules off of ebay for under 20 bucks, though finding the PC controller is a little harder.
Mark G
I have edited the link, X10 is a good suggestion.
Paul Dixon
Well, they have done some, umm, remodeling on their site, but I bet their products are still as good. What you're looking for is ActiveHome (for the software and PC interface), the kit comes with one lamp module. Then you'd buy two more modules for the other lights.
lc
I searched and found a sub page of the site...I linked to the root of the site without looking at the page...my fault...its fixed now...we can all move on.
Jason Punyon
Your link is still broken, I think the parens messed it up.
jcollum
http://en.wikipedia.org/wiki/X10_(industry_standard)
jcollum
That one's broken too... bug in SO link parsing?
jcollum
I'm kind of disappointed, has this been voted down because it's honestly a bad suggestion (which I don't think it is) or because the people who sell most of the X10 stuff happen to have a website that doesn't meet a certain standard??
Mark G
Voted down because the original link was NSFW; it's fine now.
jcollum
A: 

Most PC components will not handle 115 VAC. You could take a look at some the stuff from x10 which is an old home automation standard. Other wise you will need to use relays controlled by a PC to switch the 115 VAC.

Jim C
+1  A: 

You'll need:

You may use you PC's 12V to power the relay coil.

Boards usually come with drivers and libraries to control them.

Quassnoi
A: 

If you enjoy doing it yourself, a serial port interface wouldn't be too difficult. A serial port has at least two lines that can be switched on/off: RTS/CTS and DSR/DTR. When you turn either line on, you're getting +5VDC on that particular line. You can use those lines to control relays that in turn switch the lights on/off.

Kluge
Serial ports that actually conform to the RS232 standard will output 12V, not 5V. They'll also go to -12V when they're in the low state. That said, many manufacturers take shortcuts and use 5V as you state. If it does follow the standard, there are converter chips such as the MAX232.
rmeador
+6  A: 

An arduino board seems like overkill for something this specific, espeacially if you aren't going to be using it with conjunction with anything else. Plus you are going to have to buy a variety of components or an arduino shield (specifically the relay shield) so it'll quickly add up, especially if you don't want to solder (you will be looking at about $120+tax for the arduino and the shield.)

Since you are switching AC (the lightbulb) and the computer gives out DC, you will need relays. Also you will need to switch the relays with transistors as I don't think the output from serial or usb will output the mA you want.

The easiest way to go about this is to use a USB relay board. Something like this would work great http://www.robotshop.us/phidgets-1014-relay-interface.html. Plus its 1/3 of the price of the earlier combination. Even better they give you libraries to control it so programming is a breeze.

Also if you go on eBay you can get them even cheaper, especially if you don't mind using the now "antique" parallel port instead. I don't think you'll get libraries though.

Good luck

darudude
The "Phidgets Relay Interface Kit 0/0/4" looks very promising!
Ates Goral
+7  A: 

Get a USB traffic light and a USB extension cord. I gravitate toward the simplest solution possible. Should be pretty easy to write some software to drive it.

jcollum
+1 for being the simplest solution, but this is just too tiny for our office. We have a full-sized traffic light hanging up high on a wall and it can be seen almost from everywhere.
Ates Goral
This guy: http://people.usm.maine.edu/houser/bblight/index.html did something similar.
jcollum
@jcollum: your previous comment deserves to be a stand-alone answer
Ates Goral
+1  A: 

The X-10 modules are likely the easiest path to take. If you try to do 110 V switching on your own, your project will quickly become a hardware project rather than a software one. X-10 (used to?) have a dongle that plugs onto a serial port (called a "firecracker"). The protocol for that can be found online.

Final caveat: X-10 is kind of low-tech and subject to interference from modern switching power supplies. So try it in your office before committing to the software effort.

gbarry
+5  A: 

This device "IP Power 9258" should work for you, it is an ethernet comtrolled power bar. It is similar to the device used in this project "Red Bear Alert!" - The Hudson Bear Lamps.

Here is a link if you want to try it on your own uSocket.

Philip T.
+1 for this - we use the exact same power supply here for the same purpose as the OP (CI build health lights), and it works well. Hadn't seen the link to the bears before, though!
Andrzej Doyle
Came across the bears while researching Hudson, thought it was kinda clever.
Philip T.
+ 1 - This seems to be the least amount of effort!
Ates Goral
+2  A: 

I found a guy who built a full fledged traffic light here: http://people.usm.maine.edu/houser/bblight/index.html. Looks like more work than you want to do though.

jcollum
+1  A: 

Here's one big issue: If I'm TC'ing that day, I can't see your light. Considering that, I'd build this as a little light that sits in the tray and shows the current build status. People that want to know the build status can install it, people that don't care won't be bothered by your intrusive traffic light. I heard a presentation from a consultant once and he said he'd done this at one company and the VP types just loved it. Here's one link; the sample is in Python.

Edit: Seems CruiseControl.NET has this sort of thing already.

jcollum
There's something cool about having a physical traffic light. Of course someone can just check the build status, but if they have the light enabled, it's a great way to see at a glance the status.
Andrei Krotkov
Or people in the office (who don't know what the heck a build is really) will be annoyed and worried when the thing switches from green to red 5 times in the same day :) Depends on your office I suppose.
jcollum
+5  A: 

Just to give some more options:

Relays can be replaced by thyristors. These don't suffer from mechanical wear..

Another cheap and easy solution: Buy a cheap three channel light organ and connect it to the sound output of a pc. Find the resonant frequencies of the three outputs by playing back some test sine-tones or a sine-sweep.

That way you can not only toggle the three lights, you can dim and pulsate the lights as well. No need to mess around with USB and relays.

Nils Pipenbrinck
+1 for the light organ solution. I would have given another +1 if I could for the novelty factor. I found this: http://www.apogeekits.com/color_organ_3.htm
Ates Goral
A: 

Ever think of trying phidgets? (www.phidgets.com)

USB Power relays:

http://www.phidgets.com/products.php?product_id=1014

Already mentioned in http://stackoverflow.com/questions/451066/whats-the-easiest-most-practical-way-to-toggle-several-lightbulbs-with-a-pc#451114 above.
Ates Goral