connect 2 hard ware with 1 dpdt relay and common point of relay to mcu. you just want 1 more pin from mcu to operate relay and you done it.simple and tested with 3 serial hard ware with 89s52.
fingerprint based unique security system with gsm and pc backup for project and worked fine.