What's the easiest, most practical way to toggle several lightbulbs with a PC? [closed]

我只是一个虾纸丫 提交于 2019-11-29 19:44:33

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

Jason Punyon

Look into X10

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

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.

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.

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.

A google search for relay controlled power strip, lists tons of projects to build your own.

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.

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.

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.

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.

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.

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.

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.

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

USB Power relays:

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!