Electronic – How does a bidirectional level shifter work

bidirectionallevel-shifting

I have the following circuit with an NPN HEXFET Q1 (BS170) Circuit

Correct me if I'm wrong:

When the TX-3V3 microcontroller is 3.3V i.e. logical 1, the TX-5V is a logical 1. This is because the gate of Q1 is CLOSED when \$V_{GS}\$ is greater than 0, and OPEN when it's not. So right now it is OPEN since \$V_{GS} = 0\$.

Question:

I get confused when the TX-3V3 microcontroller is 0V i.e. logical 0. I know from my measurements that the result is that the TX-5V is 0 in this instance. I don't understand why.

I would say the gate of Q1 is closed, since \$V_{GS} \approx 3.3V \$. Possible scenario's I can think of, please correct me where my thought process is wrong, I want to know my mistakes:

  • The TX-5V has impedance, and since current takes the path of least resistance my guess is that the current coming from the 5V supply will flow towards the TX-3V3. However, then what happens? I always think of current as marbles moving through a tube. Since the TX-3V3 is a 0, then where will the marbles flow to? There's no ground connected…
  • Another one of my guesses is that the voltage across the R2 resistor will be 5V, so the potential left over at the TX-5V is 0V. In this scenario there's still no ground though. So where can the current go? Please answer this question: Since the current has nowhere to go, does this mean theres no voltage across R2?

According to the assignment, the TX-5V can also control the logical '1' or '0' for the TX-3V3. Can one of you explain the scenario where the TX-3V3 is 0V and the TX-5V is 5V? How will the TX-5 be able to control the TX-3V3, like the TX-3V3 controls the TX-5?

Best Answer

When the 3.3V input is pulled down to 0V, the source is at 0V, the gate is at 3.3V and the MOSFET is (more or less for this particular part) 'on'.

Therefore the driver for the TX-3.3V sinks current from R1 and R2 and the output goes to slightly above the input voltage (because Rds(on) > 0 and some current goes through R2).

If you pull the TX-5V output low, then the body diode of the MOSFET conducts and brings the TX-3.3V input (and MOSFET source) down to the TX-5V low level plus 0.6V or so. If the MOSFET has low enough threshold voltage the channel conducts further reducing the source voltage and the situation is the same as with it driven from the other side (the MOSFET channel will conduct in either direction).

Without doing a detailed evaluation, I think this particular n-channel MOSFET is pretty marginal- I suggest picking something with a guaranteed lower Vgs(th) at 1mA, something more like the BSS138.