go_away

Author Topic: Newbie question: Computer controlled power switch?  (Read 3122 times)

0 Members and 1 Guest are viewing this topic.

Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Newbie question: Computer controlled power switch?
« on: September 13, 2010, 09:47:54 AM »
I posted some noob questions in another section of the forum, and hoped maybe I could get some help here too with an idea I've got.

I'm setting up a halloween display and i'm making some animatronics for it. I planned on using some X-10 devices to control them... (If anyone's not familiar, X-10 is home automation systems that send signals through your home's wiring) They are cheap and available, and using some programming trickery I can script events to happen being trigged by an X-10 motion sensor and a USB transceiver attached to my PC.

The problem is twofold: X-10 is a little laggy (not a huge deal, I'm not running a movie set), and X-10 is prone to missed signals... you can sometimes, depending on your home's wiring, send an "On" signal 3x and not get your lamp to turn on.

I know there are commercially available... well... I dont know WHAT they are called... its why I'm posting here. Power relays? Basically devices that turn an electrical outlet on or off based on an electronic command.

What I'm looking to do is buy (if its cheap and does what I want) or build (if its within my skillset) a power relay device that can control either/or AC/DC power to devices, and ideally be connected to my PC via USB or a serial connection.

That way instead of sending wireless RF X-10 signals to a transceiver to be sent to the devices through my household wiring, everything would just plug into my control box, and be controlled without lag via my PC running the script.

Its got to be cheap enough to make me throw out the X-10 stuff, but do what I need it to.

Can anyone recommend a commercial device thats PC-controllable (linux preferred), or point me in the right direction on how to build one? I've some small electronics experience. I know some basic theory. I'm confident and capable.

I jsut dont even know what terms to google for to get pointed in the right direction.

Any help would be awesome.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Newbie question: Computer controlled power switch?
« Reply #1 on: September 13, 2010, 10:47:40 AM »
Have any experience with micro-controllers?

I'm not aware of anything comparable to the cheapness/ease of use on X10 modules. When I built haunted houses I just ran my own cable everywhere. 

You can also look at the 'openDMX' community for a cheap USB to DMX box and hunt around ebay for cheap DMX controlled boxes for lights/effects.

Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Re: Newbie question: Computer controlled power switch?
« Reply #2 on: September 13, 2010, 10:52:24 AM »
I did some googling and I found a box that, assembled, is about $116 and has 8 relays on it. Its not cheaper than x-10 but so much easier to work with, I may order that. And since it runs both AC and DC devices I may go with it.

Not sure what DMX is I'll look it up...

Offline blackbeard

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: Newbie question: Computer controlled power switch?
« Reply #3 on: September 13, 2010, 11:17:57 AM »
why not just use a parallel port and transistor. you can do all of that at the cost of about $1 per thing you want to control. or you can use a microcontroler which would be allot cheaper then controlling it through computer.
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Re: Newbie question: Computer controlled power switch?
« Reply #4 on: September 13, 2010, 11:37:14 AM »
Because my linux box doesnt have a paralell port. ;)

And I want to control it through my computer so I can script it, test it, and control it all in real time through motion sensors, a web page, or my cell phone ;)

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Newbie question: Computer controlled power switch?
« Reply #5 on: September 13, 2010, 11:37:34 AM »
Hi,

If your PC is old enough to have a parallel port it's really easy (A relay, a small transistor and a little "glue" components), but if you want to use a modern PC (i.e. without pedals), just get a USB relay card.

There are plenty to choose from here is a 4 channel card going at US$59 and I didn't hunt for lower prices, but I'm sure it can be had cheaper - gearmotion who hangs around here from time to time sell some too (probably cheaper than the one I linked to).

The X10 could probably be made more reliable, if the lamp was returning an "ON-flag", so the controlling part would just be sending on-commands until acknowledged from the lamp. Not really something to get into for a lamp perhaps, but if you make some units yourself, you could make the ack. function and if you are then able to make the controlling unit behave like this, lag should be the only remaining issue.
If you have noisy loads (like eg. a faulty fridge thermostat or motors with worn down brushes), X10 will be more error prone, so perhaps review your loads to up the quality.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Newbie question: Computer controlled power switch?
« Reply #6 on: September 13, 2010, 11:40:46 AM »
why not just use a parallel port and transistor. you can do all of that at the cost of about $1 per thing you want to control. or you can use a microcontroler which would be allot cheaper then controlling it through computer.

You would need more then a transistor. He wants to control AC equipment. I'm leery of suggesting anything to newbies that means bringing High voltage AC near computer ports. Not saying it can't be done, but it a new level of danger.

EDIT

I like the relay card idea better. I was asking if you knew microcontrollers such that you could build your own.

They do make pre-built '2way' modules that do ack status, but there price is 3 times higher.

Soeren, i'm curious, have you built your own modules before, or know how to? I have built my own computer-X10 interface before but never looked into making my own modules for less $.
« Last Edit: September 13, 2010, 11:45:40 AM by madsci1016 »

Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Re: Newbie question: Computer controlled power switch?
« Reply #7 on: September 13, 2010, 11:43:00 AM »
Awesome device - tho it ships from australlia - I'll have to look for something US based. I saw a serial port controlled 8 relay unit for about $116... I dont care if its USB or serial (I'd be using a usb-to-serial cord anyway) as long as I can control it from linux.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Newbie question: Computer controlled power switch?
« Reply #8 on: September 13, 2010, 11:49:18 AM »
Awesome device - tho it ships from australlia - I'll have to look for something US based. I saw a serial port controlled 8 relay unit for about $116... I dont care if its USB or serial (I'd be using a usb-to-serial cord anyway) as long as I can control it from linux.



http://www.robotshop.com/Devantech-Serial-Relay-Module.html

Though I can't remember if it's canada or US, but it is this continent.

Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Re: Newbie question: Computer controlled power switch?
« Reply #9 on: September 13, 2010, 11:53:24 AM »


http://www.robotshop.com/Devantech-Serial-Relay-Module.html

Though I can't remember if it's canada or US, but it is this continent.


Best one I've seen yet, but the amps on that one isnt much... for a 110VAC item, only 500mA max. Heck its 1amp max on the DC side, and my wiper motor at zero load pulls 1.02 amps.

Good price tho, still looking...

Edit: Seems they have an 8 port relay that handles 16 amps each for just a few extra bucks.
« Last Edit: September 13, 2010, 11:55:35 AM by lorddamax »

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Newbie question: Computer controlled power switch?
« Reply #10 on: September 13, 2010, 12:06:56 PM »
They had a bunch of options, i just linked the cheapest. Didn't know what your need was.

Offline blackbeard

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: Newbie question: Computer controlled power switch?
« Reply #11 on: September 13, 2010, 12:12:15 PM »
you can probably pick up an old pc with a parallel port for $10 if you even need to pay for it. might that work?
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Re: Newbie question: Computer controlled power switch?
« Reply #12 on: September 13, 2010, 12:18:39 PM »
you can probably pick up an old pc with a parallel port for $10 if you even need to pay for it. might that work?

Why would I buy a PC, install an operating system on it, put it next to my other 2 PCs, and run ONE script on it, just for a paralell port?

Or I can just get a device that works off a serial port or usb...

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Newbie question: Computer controlled power switch?
« Reply #13 on: September 13, 2010, 12:34:51 PM »
Hi,

Best one I've seen yet, but the amps on that one isnt much... for a 110VAC item, only 500mA max. Heck its 1amp max on the DC side, and my wiper motor at zero load pulls 1.02 amps.

Good price tho, still looking...

The one from gearmotion is $38 with 2 relays and the extra outputs can be utilized as well
http://www.circuitgizmos.com/products/cgu451/cgu451.shtml
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Newbie question: Computer controlled power switch?
« Reply #14 on: September 13, 2010, 12:41:24 PM »
Hi,

Soeren, i'm curious, have you built your own modules before, or know how to? I have built my own computer-X10 interface before but never looked into making my own modules for less $.
No, I haven't, since X10 isn't really used over here, but back in the eighties I considered making something similar (using the mains wiring for commands).
I have read a good number of articles on the subject and it shouldn't be that hard to put something together, at least if you still can get the encoding/decoding chips that were "everywhere" back then - Philips, among others, made some that was quite easy to use, as they took care of all the comms over the mains.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Newbie question: Computer controlled power switch?
« Reply #15 on: September 13, 2010, 01:39:54 PM »
Hi,

Best one I've seen yet, but the amps on that one isnt much... for a 110VAC item, only 500mA max. Heck its 1amp max on the DC side, and my wiper motor at zero load pulls 1.02 amps.

Good price tho, still looking...

The one from gearmotion is $38 with 2 relays and the extra outputs can be utilized as well
http://www.circuitgizmos.com/products/cgu451/cgu451.shtml


Hey thanks for that! I just signed on to help out by posting that link and there it is...

This should also help:

http://www.instructables.com/id/Computer-control-of-AC-devices/


Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Re: Newbie question: Computer controlled power switch?
« Reply #16 on: September 13, 2010, 01:57:33 PM »
Hi,

Best one I've seen yet, but the amps on that one isnt much... for a 110VAC item, only 500mA max. Heck its 1amp max on the DC side, and my wiper motor at zero load pulls 1.02 amps.

Good price tho, still looking...

The one from gearmotion is $38 with 2 relays and the extra outputs can be utilized as well
http://www.circuitgizmos.com/products/cgu451/cgu451.shtml

Looks like a nice item.

So my questions...

I know what the relays are for.

What exactly could I use the "6 transistor outputs" and "8 i/o lines" for?


Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Newbie question: Computer controlled power switch?
« Reply #17 on: September 13, 2010, 02:19:56 PM »
Hi,

Best one I've seen yet, but the amps on that one isnt much... for a 110VAC item, only 500mA max. Heck its 1amp max on the DC side, and my wiper motor at zero load pulls 1.02 amps.

Good price tho, still looking...

The one from gearmotion is $38 with 2 relays and the extra outputs can be utilized as well
http://www.circuitgizmos.com/products/cgu451/cgu451.shtml


Looks like a nice item.

So my questions...

I know what the relays are for.

What exactly could I use the "6 transistor outputs" and "8 i/o lines" for?



The relays can switch AC on and off.

The 6 transistors can switch (switch to ground) the coils of 6 more relays (you supply) and thus you could control 8 AC circuits. Or those 6 transistors can control DC devices (such as LEDs) that are less than 20V, 500mA.

The 8 i/o lines can do a lot of things: See the www.usbmicro.com site for specifics. They can be attached to 1-wire temperature devices, or I2C A/D converters. Used as switch inputs, or even attached to transistors to drive even more relays...

 

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Newbie question: Computer controlled power switch?
« Reply #18 on: September 13, 2010, 02:22:48 PM »
Oh, and these work well with Linux. Linux code is available.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Newbie question: Computer controlled power switch?
« Reply #19 on: September 13, 2010, 02:26:02 PM »
What exactly could I use the "6 transistor outputs" and "8 i/o lines" for?
Whatever you want!
Relays, TRIACs, power transistors etc. (might need a tiny bit of interfacing, I haven't studied it in detail.
The I/O lines can be used either for (up to) 8 further outputs or up to 8 inputs (could tell the PC that something happened, like when a PIR movement detector detected a "victim" or a mix of both.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Newbie question: Computer controlled power switch?
« Reply #20 on: September 13, 2010, 02:28:05 PM »
Oh well, sorry for the double info. Wasn't there when I started my reply.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline lorddamaxTopic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
Re: Newbie question: Computer controlled power switch?
« Reply #21 on: September 13, 2010, 02:33:48 PM »
What exactly could I use the "6 transistor outputs" and "8 i/o lines" for?

Whatever you want!
Relays, TRIACs, power transistors etc. (might need a tiny bit of interfacing, I haven't studied it in detail.
The I/O lines can be used either for (up to) 8 further outputs or up to 8 inputs (could tell the PC that something happened, like when a PIR movement detector detected a "victim" or a mix of both.



Awesome. Just wish it had 6 relays instead of 2. Sure I could add 2 - but thats work i'd rather not do ;)

I'm narrowing it down to a few products...

There's:
http://www.electronickits.com/kit/complete/elec/ck1610.htm
8 relays, 4 inputs (tho I'm not 100% sure what/how the inputs work, waiting on an email back)
$117 assembled.

http://www.sparkfun.com/commerce/product_info.php?products_id=9669
4 relays, and a "6 channel i/o interface" - again waiting on a reply as to what exactly that is and how it works/how I'd use it
$60

And:
http://www.robotshop.com/devantech-usb-rly16-16amp-8channel-relay-module.html
8 relays, no inputs, plenty of power
$94

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Newbie question: Computer controlled power switch?
« Reply #22 on: September 13, 2010, 02:46:20 PM »
There's:
http://www.electronickits.com/kit/complete/elec/ck1610.htm
8 relays, 4 inputs (tho I'm not 100% sure what/how the inputs work, waiting on an email back)


You send a command out the serial port and parse the reply to see if something connected to the input is on or off.

Quote
http://www.sparkfun.com/commerce/product_info.php?products_id=9669
4 relays, and a "6 channel i/o interface" - again waiting on a reply as to what exactly that is and how it works/how I'd use it


Not sure that this works with Linux, unless the board itself becomes a serial port.
Quote
And:
http://www.robotshop.com/devantech-usb-rly16-16amp-8channel-relay-module.html
8 relays, no inputs, plenty of power


My guess is that this also becomes a serial port. The web site has issues every time I try to click to get more information.

 


Get Your Ad Here

data_list