PC->serial->relay->flashlight?

N

Thread Starter

Nathan

Using Visual Basic-MScomm or another software package how would you connect a relay to the Com port and a flashlight to the Relay

The problem i've been having is that I can only get 1 - 1.8 volts out of the Com port off a standard PC-compatiable. The smallest relay i
can find has trip voltage at 3 volts. I can send pulses from the com port but they wont trip the 3 volt relay.

I've been told to try to chain more pins off the com port to creat more voltage.. trying but i failed and i think i might be breaking my PC.

Any information this community can provide will be greatly appreciated!!! thank in advance

Nathan
 
J

James Ingraham

There are numerous I/O devices that have outputs on one side and a serial port on the other. The Opto-22 Pamux stuff comes to mind
immediately, plus the all the Modbus stuff. But DIRECTLY firing a relay off of the voltage on a comm port sounds like a kludge. The
parallel port, however, is perfect for this; it uses TTL signals.

-James
Sage Automation, Inc.
 
T
Your com port was never meant to be used that way, but try using an opto-isolator instead of a relay. You probably don't need to worry too
much about damaging the port unless you feed an extreme voltage back into it. It was designed in such a way to limit its output current and
withstand shorts.
 
Take any inexpensive transistor and apply the signal to its base. Use the relay coil at the collector, and feed an external supply to the collector (ofcourse thru your relay). Be sure to use a didode across relay coil.

ground the emitter.

+ext. voltage
|
relay coil
|
/C
-->---B--|
\E
|
---ground

BUT...its better to use this with the parallel port, instead of serial cause parallel port is TTL compat. Give it a try ..else use an opto coupler.
 
Very useful are Photo-Mos solid state relay switches. They can be fed by the small 1mA current even from the laptop serial port, but can switch exernal currents up to several A and withstand 100V voltages. Only need to connect an appropriate resistor in series to PhotoMos input (say, several kilohm - not to kill the LED) and capacitor in parallel (about 100microF).
 
M

Michael R. Batchelor

> Using Visual Basic-MScomm or another software package how would you
> connect a relay to the Com port and a flashlight to the Relay

This really isn't the best way to go about this. Is this a demonstration for something and you have absolutely no budget. Just buying a few X10 modules will probably solve all your problems cheap.

> The problem i've been having is that I can only get 1 - 1.8 volts out of
> the Com port off a standard PC-compatiable. The smallest relay i can
> find has trip voltage at 3 volts. I can send pulses from the com port
> but they wont trip the 3 volt relay.

Which line are you using? TX? You may be able to get a reasonably stable DC signal voltage if you modulate either the RTS or DSR lines, but it's been a while since I've looked at a "modern" PC
serial port. I have no idea whether they can supply enough juice to trip a small relay.

> I've been told to try to chain more pins off the com port to creat more
> voltage.. trying but i failed and i think i might be breaking my PC.

No, they don't "add together" like that. And you might be breaking your PC depending on how you're "chaining" them together.
 
Hi Nathan,
I've just done something v. similar using a PC Serial Port & Relay to Power on/off a Laser. Drop me an email if you want a details of the components etc.

BTW: you should be getting approx. +/- 10.5V between DTR & GND. The 1-1.8 V you're describing sounds like a ground variance.

Seeya,
Ciaran
[email protected]
 
I have been trying to do something similar to test and I have no budget... Anybody have the code to make the calls for the serial. I want it to work in Linux, but if I can't find the code Windows is fine too..

Dave
 
Have a look through the Coffee HOWTO - it talks about the parallel port rather than the serial, but many of the concepts will be similar.

The simplest method will probably be:

- Get the kernel not to handle the port. They're auto-detected, so
you'll have to specifically tell it that you don't have a serial
port there.

- Use the ioperm(2) or iopl(2) system call to grant your program
access to the relevant port number.

- Use the inb() and outb() functions to read and write the port, or
in-line assembly, or any other method.

You could also write a kernel driver, but it's probably overkill.

Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
could u help me out.. im trying for a similar project, wherein i connect a microprocessor to the PC serial port , then relay and direct the output to various speakers, which is controlled by VB as front end.

using MScomm control, how can the multimedia output be sent to a microprocessor, and then speaker??
 
Top