I want to use a TRIAC as a switch to open a gate to transfer a 9600 baud rate square wave (for a uart communication between two avrs). Currently I'm using dc relay, but I'd like to use the Triac to reduce the power consumption and increase the components durability. But I'm not sure if the Triac will have any side effects.Please advice.Thx
Yes, I can think of a good alternative that is better than both a relay and a triac.
You seem to want to be able to select a unidirectional (slave to master) logic level bitstream.from 2 different sources. If you were to connect them together, you will get undefined results because of the output type (not open-drain).
You can use a number of different devices like transmission gates, discrete bipolars, and many other solutions but I suggest a digital switch (multiplexer/demultiplexer). Since you do not need linearity, these should exist in a standard logic catalog. Here are a few examples of analog multiplexers:
- TS5A9411 - 10 ohm SPDT up to 5 volts
- SN74LV4051A-Q1 - 1:8 MUX if you have 8 desired input sources
- Let's Go Shopping on Maxim-IC's site!
- Obligatory 74-series logic example
All of these options have multi-megahertz bandwidths so you should be good to at least 100kbaud
I assume (hope?) that your communication protocol ensures that the two clients don't transmit at the same time. If that were there case, there would be no way for the master to receive the sum of what the slaves are transmitting.
When one slave UART is transmitting and the other is not you want your master to receive the transmitted signal. Idem when the other slave is transmitting.
A UART output in the idle situation is high. Hence you can combine the two UART signals using an AND port. The very common 74HC00 chip contains 4 NANDs. You could use one to combine the signals, one to invert the output back, and leave two unused (but tie their inputs to gound or power).
PS a TRIAC is NOT a good component in this situation. A bit like a power grinder is not the right tool for cutting a birthday cake.