Sign in to follow this  
Followers 0
littleclown

Computer Ports Voltage control (or Just 0/1 control)

9 posts in this topic

Hello guys.

I want to make a PC controled power switch (or hub - I don't know the word, but its the simple home power cable with more than one power socket). And I need to use some of the computer ports - rs232 or USB (i prefer USB but I am not sure is this possible). I don't want to use logical unit like PIC or someting like this, and I just need to control - POWER/NO POWER to some of the pins of the port. I will integrate relay in the power hub.

Can you tell me are they some codes and DLL-s maybe about port voltage control?

Thank you in advance.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You did not specify if you have the small Hardware needed for that task.

Assuming you don't,

First search the web for a USB Relay.

Then, after you get that relay, it will come with a DLL that contains functions that you will use to switch the relay On and Off.

Please note that prices vary greatly between manufacturers.

So compare prices and don't just buy the first result.

Edited by Zohar

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hello and thank you for the reply.

As hardware I will use regular USB or com cable, regular relay and regular 220 power socket. I will attach the relay (or transistor maybe) directly to the port pins - when there is some voltage, relay will allow the power to comes to the appliance.

I search for USB relay but the prices are very high for this project :D. If there is something like $10-15 will be great :o.

EDIT: I found this:

http://cgi.ebay.com/USB-One-Channel-Relay-...#ht_1949wt_1166

And the price is not too bad, but I want to do this to myself - i will have the opportunity to make a multi-relay with more than one channel.

Edited by littleclown

Share this post


Link to post
Share on other sites

10-15$ - no chance, I wish there were in that price too.

If you want to build a Relay unit yourself, using a Relay component, cable, and stuff,

then If I were you I would use a Parallel port - the one we all used to use for the printer, 10 years ago.

That way you would be able to connect the relay legs directly to the Parallel Port's Output, with no extra components needed.

But if you don't have a Parallel port in your PC, you will need to buy one..

Either an internal card, or a USB<->Parallel unit, and that will cost money(and add headache),

so you might wanna stick with my original offer, and just look more and more in google till you find 1 in a nice price.

I think $70 would be a nice price, also consider the faact that it usually comes with several relays built in, and sometimes even inputs and not just outputs.

Here is a nice example, tho not a cheap one. This company is not cheap at all, tho they wrap their products in cute plastic enclosures =], as you can see in the pic.

If you want cheap you'll have to look more yourself.

good luck

Share this post


Link to post
Share on other sites

Yes I found this too :D. No chance to use rs232?

And I can't use something like this:

http://www.autoitscript.com/forum/index.ph...42&hl=commg?

Its too bad for my project :o.

I will think again, and if somebody have other options for me - please reply :D.

Zohar, Thank you again.

Share this post


Link to post
Share on other sites

I am very sad... are there any other option?

Share this post


Link to post
Share on other sites

I am very sad... are there any other option?

I replied to a similar request here.

Remote controlled mains sockets are very cheap IMO, eg $15, and MUCH safer than trying to use your PC to switch a transistor which connects to a relay which switches the mains.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Martin, Ward Gerlach - Thank you very much for the good links.

Remote controlled mains sockets are great, but I need to control the power connected to computer, because I will add USB thermoterer in the station too :D. And will connect the thermoter results with ON/OFF status of the relay.

Thank you again.

EDIT:

x10 is great idea, but is not programmer-oriented way to control the environment - there is no command line or something line that.

Look here:

http://www.vbforums.com/showthread.php?t=394943

There is a VB script and guys there tells that its work - it can manage the voltage of the pins, and this is wanderful, but I can't understand the script.

Don't worry - I will be very careful

Edited by littleclown

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0