Bidirectional digital switch (with voltage translation as a bonus) - Page 1
Forum section: electronics / beginners

author: fabiodl
author_rank: Frequent Contributor
timestamp: February 11, 2023, 09:25:52 am
content: Is any circuit that uses discrete parts to make a digital switch (other than a relay)?In my specific case, I already have voltage translator made using discrete parts (BSS138), so it would be even cool if it were possible have a circuit that performs both functions using the same parts.I would like to have a 3V3 bus to which one out of N 5V devices is connected. The 5V devices are connected through cables which are a few feet long.In the past I tried using TXS0108E ICs, but they did not work unless the cables were within few inches.

author: radiolistener
author_rank: Super Contributor
timestamp: February 11, 2023, 11:39:13 am
content: you can use digital microcontroller with mosfet and protection diode to control relay. If you're worry about power consumption due to current through relay coil, you can use bistable relay, it allows to switch by apply just a current pulse and it stays in that state even if you remove power supply.

author: jmelson
author_rank: Super Contributor
timestamp: February 11, 2023, 03:33:28 pm
content: There are a bunch of chips made for this purpose. I use lots of ALVC164245 devices to convert between 5V and 3.3 V chips, but these have 16 channels.There is also the LVC8T245 which is an 8-channel part.Jon

author: Zero999
author_rank: Super Contributor
timestamp: February 11, 2023, 07:03:50 pm
content: I'm not sure what you're asking. A BJT is faster and cheaper than the BSS138.

author: fabiodl
author_rank: Frequent Contributor
timestamp: February 12, 2023, 09:12:57 am
content: Thank you all. My first idea was indeed using relays. I did not know about bistable ones. The only downside would be the board space (10 lines x N devices).I indeed stumbled upon ALVC164245. They would be a nice match. Do they work with long cables? I am worried it'll be the same as for the TXS0108E@Zero999: are you using the switches to disable the signal or to simulate an input?In the first case, I need to be able to isolate input from output depending on a logic signal.In the latter case, I cannot use that configuration, they devices on the bus may be push-pull and that would short them.

author: Zero999
author_rank: Super Contributor
timestamp: February 12, 2023, 09:51:10 am
content: Quote from: fabiodl on February 12, 2023, 09:12:57 amThe switches simulate open drain outputs. It will work with push-pull outputs.Obviously, if two push-pull outputs are connected together, large currents will flow if one is high and the other low.

author: fabiodl
author_rank: Frequent Contributor
timestamp: February 12, 2023, 10:19:46 am
content: Quote from: Zero999 on February 12, 2023, 09:51:10 amGot it, thanks. In my setup, I need to connect one of multiple of the 5V-side devices to the 3V3 bus. If I am not mistaken, this schematic only deals with the voltage translation (as the classic BSS138 one does), am I correct? Is there any way to modify it to include a high-impedance mode?

author: Zero999
author_rank: Super Contributor
timestamp: February 12, 2023, 05:58:45 pm
content: Quote from: fabiodl on February 12, 2023, 10:19:46 amThe circuit I posted level shifts, like your BSS138 circuit. If an input goes high-impedance, it will be pulled up to either 3.3V, or 5V, depending on which side of the circuit it's on.I'm still not sure what you're asking for. An analogue switch, such as the 74HC5053 (use the HCT if you want it to be controlled with 3.3V signals) can be used to switch between two difference signals.https://www.ti.com/lit/ds/symlink/cd74hc4053.pdf