How to Control a Relay with a PC
How to Control a Relay with a PC
(OP)
I need help. I'm trying to do some development on a project, and I would like to be able to energize a circuit with a PC or other device that would give me an adjustable and repeatable on/off signal. For example, I may want to turn the circuit on for 1 minute, then off for 5 minutes, or I may want to have the circuit on for 45 minutes then off for 30 minutes, depending on the circumstances.
The on/off will be controlled with a relay. That part I'm comfortable with. What I'm not comfortable with is how to control a PC port from windows to send the on/off signal. I don't care if I use a serial, parallel, or USB port.
Are there any readily available programs to send a signal like this? Or am I gonna have to find someone who is comfortable with C or C++ to help me with this? Any help would be much appreciated.
I'm not dead-set on using a PC to control this, so if there is another method of making a timer that has the needed flexibility, I am all ears.
The on/off will be controlled with a relay. That part I'm comfortable with. What I'm not comfortable with is how to control a PC port from windows to send the on/off signal. I don't care if I use a serial, parallel, or USB port.
Are there any readily available programs to send a signal like this? Or am I gonna have to find someone who is comfortable with C or C++ to help me with this? Any help would be much appreciated.
I'm not dead-set on using a PC to control this, so if there is another method of making a timer that has the needed flexibility, I am all ears.
Bryan
www.logiccooling.com





RE: How to Control a Relay with a PC
Don't know how you are with programming or 'C' language but the most flexible way to do what you want to do is fit a PC relay card in your PC that controls the relays from software.
Arcom make such a beast - available through RS components part ref 295-3748. Find it on their website - http://rswww.com. This offers 8 changeover relays fully controlable through I/O port address. You could control it directly using machine code running is a DOS shell depending on DOS version rather than use 'C' but the software supplied is pretty comprehensive.
Are less costly ways of doing it - depending on how good you are with a soldering iron and how much you value your PC! Also, there are a huge variety of programmable DIN rail timers available that can be set up to do almost any repeatable cycle but I guess from you note that you want to be able to change this easily and not open up a control case every time the timing needs to be altered.
RE: How to Control a Relay with a PC
RE: How to Control a Relay with a PC
RE: How to Control a Relay with a PC
Melone, could you tell me more about programmable relays? I may be able to make them work. I'm thinking something like a 25%-50% duty cycle would work well.
Bryan
www.logiccooling.com
RE: How to Control a Relay with a PC
RE: How to Control a Relay with a PC
Also, if you decide the suggestions above are a little pricey, you could always use something as simple as a 555 timer or such. Using a simple timing IC, you can add various features, you can control the frequency and duty cycle, and you can make the whole design pretty small.
RE: How to Control a Relay with a PC
I might get a couple of those kits from kitsrus and play around witha 555 timer circuit and dabble a bit on the electronics side.
Bryan
RE: How to Control a Relay with a PC
RE: How to Control a Relay with a PC
I would use a PC in DOS, program in BASIC, use parallel
port: it is trivial.
What are the data of the relay? AC,DC, Current , VTG ?
<nbucska@pcperipherals.com>
RE: How to Control a Relay with a PC
1) a Win32 app (PowerBASIC) that talks to the serial port to a PIC 1684. Send O10 that is On 10 SECONDS, and send F1 that is oFf 1 minute. PowerBASIC was used, since I telnet into a port over the internet to flip the relay on and off.
2) Simple version, transistor to drive a relay on the parallel
port and a PowerBASIC (or BCET free) basic program. That controls it.
For that matter, you do not need a PC to do this. What are the specs? If you want to leave them on www.bastoc.com in the consulting area, I will take a look at it and tell you what I think would be best, I mean, if you only need quantity 1 and have a PC, options 2 is simple and fast.
RE: How to Control a Relay with a PC
He includes software snipits for how to trigger the relay from DOS, Window, and Linux.
He drives the relay using a transistor, which is what I have seen suggested in several locations on the net.
Now, if I could just scratch my mechanical head enough to build this. Any hints and handholding is appreciated.
Sam