Isolate serial during reset/programming

Hi!
Anybody have a ide of a smooth way to disconnect the serial connection during reset?
I use an UNO with a serial device connected to the rx/tx pins. But during reprograming of the UNO it fails as i have a device connected to the serial port. I was thinking of using a 2 pol relay that would disconnecte the device when the Arduino is reseted. But I would prefer a semiconductor if it's possible. Anybody that have done this before?

It would be more usual to use SoftwareSerial to create a second serial port on some other I/O pins so as to leave pins 0 and 1 free for programming and debugging.

If the problem is eliminated by disconnecting the device from the Rx pin you could, perhaps, isolate the device with a circuit like this

Rx Pin 0 --------------------->|--------device
                  |           diode
                  >
                  > 4k7 resistor
                  >
                  |
          Arduino 5v pin

It prevents the device from holding the line HIGH against the wishes of the programmer, but it allows the device to pull the line LOW when needed.

...R

Thanks Robin2!

Yeah, software serial would be the easiest solution.
But the performance of software serial vs hardware serial made me have to choose hardware serial.
When only running the serial part of my project it works fine with software serial. But when adding rest of the code/lib for my project it starts to fail on the serial communication. When using hardware serial it works fine beside i have to disconnect it to upload new code.

Between i use rs485 in my project so i have max485 on serial port.

I will test your suggestion!

Using a Mega with 4 hardware serial ports is another option.

...R