|
|
| Author |
Message |
scott
|
|
Serial port to relay outputs?
|
Nov 8 00:12 UTC 1998 |
I'm looking for a way to switch various things on and off by sending
commands from an RS-232 serial port. I'd like to get about 8 outputs,
such as relays (or signals that could be used to drive relays), and a
fairly simple command language.
(X-10 would work here, but the command language in rather difficult to
use since it needs a string of 16 zeroes (character null) for each
command, and those are hard to send in most programming languages. Plus,
it would be expensive).
|
| 18 responses total. |
n8nxf
|
|
response 1 of 18:
|
Nov 9 10:54 UTC 1998 |
That's easy to do with a parallel port but a lot more difficult with a
serial port. Check in the Jameco catalog. There is also a design in the
latest Electronics design but that circuit uses a PIC device.
|
scott
|
|
response 2 of 18:
|
Nov 9 12:05 UTC 1998 |
Well, learing to use PICs or perhaps the BASIC Stamp isn't that far down on
my list of eventual "want-to" projects (the long term list, of course).
|
rcurl
|
|
response 3 of 18:
|
Nov 9 17:09 UTC 1998 |
Serial-Parallel converters are available, for what that's worth.
|
scott
|
|
response 4 of 18:
|
Nov 10 00:46 UTC 1998 |
I'm not sure that would work. The parallel port method involves
toggling the lines somehow, not sending streams of data. I don't think
the converter would be able to replicate that.
Although... one of my units does have a parallel port. Wonder if I can
poke memory to toggle lines on it. Tandy BASIC on a Model 100, anyone?
|
n8nxf
|
|
response 5 of 18:
|
Nov 10 12:23 UTC 1998 |
I did a contract job that used a parallel port on a PC to control 8
devices. I don't know how it would work with your Tandy but it is suppose
to conform to the Centronics standard, right?
|
scott
|
|
response 6 of 18:
|
Nov 10 21:28 UTC 1998 |
Well, sort of... it was 1983, you know, and it was a Tandy (Radio Shack)
product. I did try to print on my HP DeskJet, and the line feeds were
wrong.
I'm more concerned about the programming hooks than the hardware,
though.
|
n8nxf
|
|
response 7 of 18:
|
Nov 11 11:58 UTC 1998 |
You won't be sending line feeds to your controller, will you? I think
the manual gives the port addresses and all you need to do is OUT the
desired binary word to the desired port. It would be pretty simple to
write a little program and probe the port for a corresponding voltage.
I may even have a controller you could borrow if you want to flash
115 vac bulbs. (It also switched a second parallel port between two
outputs and disabled mouse and keyboard inputs.)
|
rtg
|
|
response 8 of 18:
|
Nov 12 01:57 UTC 1998 |
I know someone who's quite the expert on the mod 100 from Tandy. He
runs a web site called www.m100.com. You might check there for
pointers...
As for relay control from a serial port, check the ads in either Circuit
Cellar Ink, or Midnight Engineering. There's lots of vendors who sell
DA and control gear that would do the trick...
|
scott
|
|
response 9 of 18:
|
Nov 12 15:18 UTC 1998 |
Yup, I've been to m100.com, Club 100, and "Tri-Mike Network East". :)
|
rtg
|
|
response 10 of 18:
|
Nov 13 04:39 UTC 1998 |
m100.com, and TMNE are one and the same guy. The business is in New
Hampshire, but the servers are here in Ann Arbor.
|
arthurp
|
|
response 11 of 18:
|
Jan 17 07:30 UTC 1999 |
This is similar to a project I'm working on. Does anyone know without
looking it up how much current is needed to drive a tiny 5v relay, and
how that compares to what 1 bit of a parallel port can deliver. Am I
going to hav to do something yucky, or can I drive such a relay from the
port directly.
|
scott
|
|
response 12 of 18:
|
Jan 17 13:39 UTC 1999 |
You can drive an optoisolator directly, since it really only is an LED on the
input side. I've driven full-size 120VAC solid state relays from the status
lines on serial ports before. From a quict glance into my RS catalog, the
lowest power 5V relays need 20ma, which might be just beyond what a parallel
port can push. However, if you had a power source (a PC is loaded with power)
it would be fairly easy to munge up a single transistor circuit (with maybe
2 resistors) to drive a relay.
|
gull
|
|
response 13 of 18:
|
Jan 17 22:47 UTC 1999 |
Be sure to put a diode across the relay coil to supress the 'inductive
kick', or your port may not last long.
(To clarify: The diode can be just about any rectifier diode, and goes in
so that normal current flow reverse-biases it. When the relay releases, the
sudden collapse of the magnetic field in the coil produces a high-voltage
spike with the opposite polarity. The diode shorts out this spike.)
|
scott
|
|
response 14 of 18:
|
Jan 18 00:35 UTC 1999 |
Ohh, good idea. but maybe with a driver output that isn't as big a problem
as with a mechanical switch? Depends on how abrupt the power is cut off...
|
n8nxf
|
|
response 15 of 18:
|
Jan 18 11:26 UTC 1999 |
Any time you remove the power to a coil the magnetic field around it
collapses. In so doing, it generates a voltage across the coil with
opposite polarity of that originally applied. Just the other day we
had a scope connected across the coil of a little 5 v IC sized relay
without a diode and were seeing spikes of 100 v and more when power
was removed. Spikes of that magnitude would easily blow the logic
in most any IC. I'd also recommend against driving the relay from the
IC. Use a little darlington transistor to do the work. Even if you're
just driving the LED in an opto-isolator.
|
gull
|
|
response 16 of 18:
|
Jan 23 23:29 UTC 1999 |
It's really *only* important with a driver output, since a 100V spike can
blow a transistor, but is unlikely to faze a mechanical switch. A diode is
cheap insurance.
|
arthurp
|
|
response 17 of 18:
|
Apr 5 05:39 UTC 1999 |
I was hoping to make a circuit that would have just data wires runing to it
without having to use a power source. Maybe I have to use a power source
after all and control switching with opto-couplers from the computer?
|
n8nxf
|
|
response 18 of 18:
|
Apr 5 10:13 UTC 1999 |
Don't bother with the opto-isolators. You only need those if you're
going between the PC and line voltage or if you want to connect your
PC to a patient. Take power from the buss or the PC's power supply.
I'm sure you can find logic-level relays if you look around.
|