I have a microcontroller(arduino) connected via its serial output(RX/TX) to a bluetooth module. i want to be able to program the microcontroller when the two are still connected but unless i disconnect controller RX the program will not upload. Question: is it possible to use a transistor to act as a switch between controller RX and bluetooth TX? my attempts have been unsuccessful so far...thanks.
This would work well, MAX4544. Have the default position be COM to NC with a pulldown on IN, when the Arduino sketch wakes up it can drive IN to High to connect COM to NO and enable the BT connection.
Or one of this if you want to switch both in the same package
The easiest solution IME to this problem is to avoid it entirely: most arduino boards have a header on them that can be used to connect an AVRisp programmer device, which results in not needing to use the serial interface for programming. The devices are cheap (there are very low cost clones on eBay) and the arduino IDE supports using them. Doing so also allows you to overwrite the arduino boot loader, which can give you a small amount of extra storage for your program, which I often find handy.
The device which channels two or more signals into the same line is called a multiplexer. You can either get one in IC form, implement it with logic gates, or implement it with transistors.
If you can make sure that both sources don't ever transmit data at the same time, you can use the fact that UART has idle level of logical '1' to simplify the circuit to a single AND gate, which can be reasonably implemented with transistors: