rs232 relay control

CDRIVE

Joined Jul 1, 2008
2,219
I wasn't quite sure with that, but I thought that the TIP120 wouldn't get saturated at 5V and 1.2A load without a driver. Anyway, now its ok at 1.2W.
Hi JJ. My only concern is seesoe's base resistor and his orientation of his base diode. I think he would be better off changing the resistor to 1K and using the diode in shunt mode. Many current PC's (especially laptops) don't have serial ports so USB/Serial converters have to be used. These converters only produce a swing of -5 to +5V. ;)
 

Thread Starter

seesoe

Joined Dec 7, 2008
99
im hooking this up to an old dell laptop that has built in serial. i was going to change the diode configuration like you were saying, but i didn't really understand how, can you modify my last picture show how?
 

jj_alukkas

Joined Jan 8, 2009
753
Seesoe,

Could you state which function in autoit you will be using to control its state? I'm a great fan of Autoit and Autohotkey.
 

Thread Starter

seesoe

Joined Dec 7, 2008
99
hi there,

i will be using the Commgv2 com port udf by martin, i have used it in the past to write a google maps gps program by getting the nmea feeds of a gps unit from the serial port, the usf is great.

i will be using either the _CommSendString or the _CommSendByte functions.

which brings an important question to mind, what type of data do i need to send to the serial port exactly to raise the pin to high?
 
Last edited:

CDRIVE

Joined Jul 1, 2008
2,219
....which brings an important question to mind, what type of data do i need to send to the serial port exactly to raise the pin to high?
Well, I know nothing of AutoIt (I'm a VB6.0 guy) but I do know that if you want to bring the TX Data Line high (Mark State) it's done by sending a Break command to the port. According to your link, that AutoIt command is CommSendBreak. He's commented that this command wasn't tested.

BTW, throughout this thread your schematics and text have indicated that you're going to use the DTR line, not the TXData line? I didn't see any commands in your link that made reference to the DTR line.
 

CDRIVE

Joined Jul 1, 2008
2,219
I forgot to mention that in VB the DTR line defaults to High when the port is opened unless the programmer codes it otherwise. Check your DTR line, when using AutoIt, to see if it swings High when the port is opened. If it does, then all you need to do is toggle the port open and closed.
 

jj_alukkas

Joined Jan 8, 2009
753
The DTR pin has only 2 states, 1 or 0. 1 indicates Data Terminal Ready, which might be what you need. Autoit doesn't have it built in. It uses Dllcall() of that commg.dll. Refer to that dll's instruction for the corresponding command or try to send _CommSendString a 1 or enabled state to activate the relays.
 

Thread Starter

seesoe

Joined Dec 7, 2008
99
yes I am using dtr pin. The parts come on Wednesday, while I wait I guess I'll write the program.

Can I just hook up a normal 5mm 3/4 led to gnd and dtr and tx and gnd so that i can run some tests
 

CDRIVE

Joined Jul 1, 2008
2,219
yes I am using dtr pin. The parts come on Wednesday, while I wait I guess I'll write the program.

Can I just hook up a normal 5mm 3/4 led to gnd and dtr and tx and gnd so that i can run some tests
You can NEVER use a LED without some sort of current limiting such as a resistor in series with the LED. As far as your desire to use the DTR line is concerned, if you recall I asked you when I first responded to this thread, how you intended to access the port and all of its properties. You said you had that covered... I'm paraphrasing.
 

Thread Starter

seesoe

Joined Dec 7, 2008
99
i said im going to write my own program, i never said i knew how:rolleyes:

any who, i got it to work. i have the led on pin 4 and 5, and when i open the com port the led turns on, and when i close the com port led goes off, simple:)
 

CDRIVE

Joined Jul 1, 2008
2,219
i said im going to write my own program, i never said i knew how:rolleyes:

any who, i got it to work. i have the led on pin 4 and 5, and when i open the com port the led turns on, and when i close the com port led goes off, simple:)
If you recall I did mention that it is possible the DTR line would swing high by simply opening the port. In case you missed it it's Here :cool:
 

Thread Starter

seesoe

Joined Dec 7, 2008
99
thanks:), that's autoit, its pretty amazing, im a big fan, its possibilities are endless. best of all its easy to learn, but when mastered, one can write nice complex things with the many many functions and UDFs, i highly suggest everyone check it out.

thanks
cheers
seesoe
 

jj_alukkas

Joined Jan 8, 2009
753
Seesoe,

what were the functions you called??? Can you give the controlling code?

CDrive, I think it would be ok to use an led only on the DTR line, or would it make problems?
 
Top