Author Topic: Key switch position sensing with RS232  (Read 25120 times)

Prasad

  • Member
  • ***
  • Posts: 16
Key switch position sensing with RS232
« 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

dhouston

  • Member
  • ***
  • Posts: 10
Re: Key switch position sensing with RS232
« 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

Prasad

  • Member
  • ***
  • Posts: 16
Re: Key switch position sensing with RS232
« 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

dhouston

  • Member
  • ***
  • Posts: 10
Re: Key switch position sensing with RS232
« 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.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Key switch position sensing with RS232
« 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

Prasad

  • Member
  • ***
  • Posts: 16
Re: Key switch position sensing with RS232
« 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,

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Key switch position sensing with RS232
« 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