How to interface 3 serial devices to AT89S52 microcontroller?
I'm not sure that it's a good idea to use a mechanical relay to switch UART signals... at the very least it's unnecessarily bulky. Consider using a UART multiplexer such as this one: http://www.intersil.com/en/products/switches-muxs-crosspoints/usb-switches/usb-high-full-speed-switches-muxs/ISL54216.html

It's a 3:1 multiplexer, meaning it will allow you to interface with 3 UART/USB devices through a single serial port on your microcontroller.

It will be simple to control - only two GPIO pins needed to perform the switching:



If you don't want to solder any small chips, you could get two of these boards (one for Rx, one for Tx): https://www.sparkfun.com/products/9056. It would be overkill  (it's a 16:1 multiplexer) but that's the price of convenience.