I'm currently working on a project that requires me to check if a device is still connected on an RS232 port. Since I do not have access to the code on the connected device(it is a fire alarm panel), I cannot have it transmit a keep alive signal. So I'm just wondering if I could check the voltage of the DCD pins and use that the check if the connection is broken. Thanks.
Electrical – Checking the voltage of serial port
rs232serial
Best Answer
It depends:
Assuming that you only need to monitor the RX line you can put an opto-isolator LED (and resistor) across the line to monitor the status.
Figure 1. An RS232 mini-tester.
RS232 signal levels can be monitored visually by means of LEDs (and suitable series resistors) connected between each line and GND. This principle is used in the mini-testers shown in Figure 1.
In your application you would use an opto-isolator instead of the visible LED.
simulate this circuit – Schematic created using CircuitLab
Figure 2. Opto-isolator monitor for RS232 line.
How it works:
simulate this circuit
*Figure 3. Revised schematic showing bipolar LED and Vince Patton's filter capacitor. (See comments.)
Note that the opto-isolated monitor allows complete electrical isolation between the RS232 and monitor electronics. This will avoid any ground-loop problems, etc.
Watchdog option
An idea worth considering is to examine the possibility of converting one of the alarm panel inputs into a watchdog input. This will work if you can configure an input to transmit an RS232 event without setting off the alarm. Now you have your "keep-alive" signal.