Bi-directional "analog" level shifter (scaler) - Page 1
Forum section: electronics / projects

author: suku
author_rank: Contributor
timestamp: March 30, 2018, 01:15:04 pm
content: Hi,I need to interface 5V signals with a 3.3V micro both analog and digital, and possibly in both directions? Is this possible? I am familiar with simple FET based bi-directional logic level shifters, but is it possible to do something similar with analog signals? (with preferably linear characteristics)Thanks!

author: ebastler
author_rank: Super Contributor
timestamp: March 30, 2018, 01:25:54 pm
content: To translate (scale) an analog signal from 5V amplitude down to 3.3V, a voltage divider from two resistors is the simplest option. This will be nice and linear as long as the output driving it has an impedance which is much lower than the resistor values, and the input behind the voltage divider has a high input impedance compared to the resistors.To scale up from 3.3V to 5V, you will need an amplifier. If you want decent linearity, an amplifier with closed-loop feedback is the typical solution. Operational amplifiers make the circuit design easy. Google for "inverting op-amp" or "non-inverting op-amp".But it may be worthwhile if you could explainwhyyou need the analog level converters. Having to translate between 3.3V and 5V in analog mode seems like an unusual requirement; maybe there is a simpler solution?

author: suku
author_rank: Contributor
timestamp: March 30, 2018, 01:47:17 pm
content: The gadget I'm designing will have a screen and you can select from the menu different pin functions. (ADC DAC GPIO Serial etc.)If I have a voltage divider (or a non inverting amp with a gain of 0.4x) for inputs and an amp for the outputs then I will need more pins and switching IC's for multiplexing the functions which would really complicate the PCB design...

author: ebastler
author_rank: Super Contributor
timestamp: March 30, 2018, 01:51:36 pm
content: So with "bi-directional" you mean that one specific line should be able to work as either an inputor an output? If that's the intent, how is the "bi-directional level converter" supposed to know which side of it is the input and which is the output?

author: madires
author_rank: Super Contributor
timestamp: March 30, 2018, 02:14:21 pm
content: Quote from: suku on March 30, 2018, 01:47:17 pmHow could a level shifter know if it's meant to shift a digital signal or to compress/expand an analog signal? And in which direction? Sorry, but this involves switchable input/output drivers and a few MCU pins for controlling the whole setup.

author: suku
author_rank: Contributor
timestamp: March 30, 2018, 02:27:52 pm
content: OK, so multiplexer it is! thanks.

author: ebastler
author_rank: Super Contributor
timestamp: March 30, 2018, 02:38:41 pm
content: Quote from: suku on March 30, 2018, 02:27:52 pmOr, even better, separate connectors to the outside world!Having one connector which gets switched to be either an input or an output sounds like a recipe for connection and configuration errors, and for potentially damaging your gadget or the device under test. Why not provide separate connectors, which serve their respective functions permanently?

author: BrianHG
author_rank: Super Contributor
timestamp: March 30, 2018, 03:09:47 pm
content: Use a 5v microcontroller for you IO ports. No translation needed anymore.

author: MasterT
author_rank: Frequent Contributor
timestamp: March 30, 2018, 04:49:56 pm
content: There is bi-directional analog IC, used in telephony and hands-free application. Assuming your micro-controller has only one pin, than connect it instead of the phone line, IC take care of dividing Tx and Rx part. Here is an example,https://media.digikey.com/pdf/Data%20Sheets/Atmel%20PDFs/U4082B.pdf

author: ebastler
author_rank: Super Contributor
timestamp: March 30, 2018, 05:21:15 pm
content: Quote from: MasterT on March 30, 2018, 04:49:56 pmI don't see how this would work for OP's application as I understand it. That IC has a lot of functionality that is not needed; and on the other hand its direction switching relies on very specific assumptions: It switches the direction depending on the AC signal amplitude on input or output respectively, if I get that right. I don't think that this is what the OP wants his gadget to do.

author: Bassman59
author_rank: Super Contributor
timestamp: March 30, 2018, 06:56:44 pm
content: Quote from: suku on March 30, 2018, 01:15:04 pmThe usual sort of analog mux chips (like, for one example,ADG408can switch both analog and digital signals and they are inherently bidirectional.

author: ebastler
author_rank: Super Contributor
timestamp: March 30, 2018, 07:02:34 pm
content: Quote from: Bassman59 on March 30, 2018, 06:56:44 pmYes, but the way I understood the OP, he does not have any (digital) pins to spare to tell the multiplexer which direction should be active at any given time. He was looking for something that automatically, always scales signals both ways (I believe):Quote from: suku on March 30, 2018, 01:47:17 pm

author: mikerj
author_rank: Super Contributor
timestamp: April 01, 2018, 11:37:48 am
content: Quote from: madires on March 30, 2018, 02:14:21 pmThe bi-directional level shifters manage this (often badly) since both sides of the shifter have open collector/drain interfaces, and the driver at either end is either switched on or off. This is not something you can do for analog signals without some additional switching signal.