Ports
May 25, 2013, 03:16:50 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: Key switch position sensing with RS232  (Read 1860 times)
Prasad
Member
*
Posts: 9


« on: December 12, 2011, 03:10:28 am »

Hello Everyone,

I am having an idea to sense the position of a Key switch and communicate via RS232 to a master controller. In this key switch we have just mechanical and no electronics.
I mean that based on open/close positions in this key switch we should be able to sense on RS232  that one among the  2 devices is actually ON .
Can we  utilise RS232 link for this purpose ?

Thanks in advance,
Prasad
Logged
dhouston
Member
*
Posts: 9


« Reply #1 on: December 12, 2011, 06:44:13 am »

If they are not in use for other purposes, you can use the DTR and RTS lines, one for each switch. See http://www.aggsoft.com/rs232-pinout-cable/pinout-and-signal.htm
Logged
Prasad
Member
*
Posts: 9


« Reply #2 on: December 13, 2011, 12:26:20 am »

Hi, Thanks a lot for the information. I need some suggestons on how to use the DTR and RTS lines. I hae only 1 key switch and if it is in Position 1 , then Device A is selected and if in Pos2 , Device B is selected. This signals will have to be sent to a master controler which will make a Voting decision to make which one to make  redundant .
Please clarify.

Thanks ,
Prasad
Logged
dhouston
Member
*
Posts: 9


« Reply #3 on: December 13, 2011, 07:33:50 am »

Assuming your controller operates at 5V, when Device A is selected, apply 5V to DTR, and when Device B is selected, apply 5V to RTS - read each with input pins on your controller. If one or the other is always selected, you can save a pin - making DTR high for Device A and low for Device B.
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1631


WWW
« Reply #4 on: December 13, 2011, 12:26:17 pm »

If you have a true RS-232 port (as on a PC), the output voltage swings can range from +/-5V to +/-15V so you may need to convert to compatible voltages for your circuits.

Jan
Logged
Prasad
Member
*
Posts: 9


« Reply #5 on: January 27, 2012, 01:56:13 am »

Hi,

How to extend this concept to a 3 position switch with 3 states ON, OFF and AUTO

When the switch is in AUTO position, it means there is no manual selection required
In ON /OFF positions only the status needs to be read and sent via 232.

We plan to have a key switch that might come with an  RS232 based sensing with 3 above positions ON/OFF/AUTO .

Regards,
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1631


WWW
« Reply #6 on: January 27, 2012, 10:23:47 am »

If you use both DSR and CTS, you can read two bits. Depending on how the switch indicates the three states, you may need some external logic to encode the states as binary values.

Jan
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!