|
|
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.
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.
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).
Serial-Parallel converters are available, for what that's worth.
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?
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?
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.
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.)
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...
Yup, I've been to m100.com, Club 100, and "Tri-Mike Network East". :)
m100.com, and TMNE are one and the same guy. The business is in New Hampshire, but the servers are here in Ann Arbor.
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.
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.
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.)
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...
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.
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.
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?
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.
Response not possible - You must register and login before posting.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss