Electronic – How is this circuit for level converting (5V<>3.3V) working

3.3vlevel-shiftingmosfetttl

Does anybody know, how is this circuit exactly working? It is level converter between 5V and 3.3V logic and it is bi-directional.

I have some theory, but I am not sure with it (I never worked with MOSFET before). And what is that diode for?

enter image description here

I take this image from SparkFun's datasheet (level converter).

Best Answer

When no device is pulling down the line, the "left side" (with lower voltage) is in high state by pull-up resistor. The voltage between the gate and the source is below the threshold voltage and MOSFET isn't conducting. So the "right side" (with higher voltage) is pulled up by pull-up resistor too.

When the "left side" pulls down the line to a low state, the voltage between the source and the gate rises above the threshold and MOSFET starts to conduct. So the "right side" is then pulled down to a low state via the conducting MOSFET.

When the "right side" pulls down the line, the diode between the drain and the gate connects the "left site" to low state, causing the MOSFET to conduct, so both sides are pulled low to the same voltage level.

More detailed description is in Level shifting techniques in I2C-bus design (PDF) in section 2.1.1, page 4.

If I made some mistakes, feel free to correct me.