8

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?

user1534664
  • 345
  • 2
  • 5
  • 11
  • 1
    This circuit is described in some detail [here](https://web.archive.org/web/20130203080757/http://www.nxp.com/documents/application_note/AN10441.pdf) [Edited by a moderator to point to Internet Archive copy of the NXP appnote due to link rot.] – vicatcu May 31 '15 at 23:45

3 Answers3

4

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.

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • what is a body diode? – user1534664 May 31 '15 at 22:21
  • 1
    Body diode (shown as a zener in the schematic symbol) is part of the MOSFET structure and acts like a diode that conducts if the drain gets much more negative than the source. Imagine an internal 1N4148 connected from drain to source. – Spehro Pefhany May 31 '15 at 22:25
  • 1
    @user1534664 More on MOSFET body diode [here](http://en.wikipedia.org/wiki/Power_MOSFET#Body_diode). – Nick Alexeev May 31 '15 at 22:30
  • @SpehroPefhany So if the drain is much more negative than the source, the diode conducts. But if the drain is 0V, then how is it any more negative than the source which is 0V by default? – user1534664 May 31 '15 at 23:09
  • Is the text I wrote in my question above "Question:" correct? I'm getting confused now, since I thought the gate was dependent on V_GS and now ur telling me its dependent on the body diode. – user1534664 May 31 '15 at 23:13
  • The body diode comes into play when the TX-5V line is brought low from 5V. The other side was at 3.3V (so +3.3 on source, +5 on drain, body diode reverse biased). Now pull the TX-5V line low. 0V on drain, source pulled up to 3.3 through R1. the body diode conducts and it's 0.6V on the TX-3.3, the MOSFET turns on, and drags it down the rest of the way. – Spehro Pefhany May 31 '15 at 23:16
  • 1
    @user1534664 The body diode comes into play only in the second part of your question. "How will the TX-5 be able to control the TX-3V3". – Spehro Pefhany May 31 '15 at 23:19
  • @SpehroPefhany Dumb question... What do u mean by 'brought low'? You mean the microcontroller is programmed to put the TX-5V line on low right? And isn't the other side always 0 by default? – user1534664 May 31 '15 at 23:29
  • Only one side can be driven at a time (driven high, driven low, or high-Z input).. Both might be inputs. So 5 allowable combinations. The MOSFET is only on if one input is driven low. Otherwise it is off and both sides are high. – Spehro Pefhany May 31 '15 at 23:53
  • Actually it is quite possible that both sides may be driven low at the same time. Such would be the case on an I2C bus where a level shifter like this is commonly used between 3.3V device and a 5V bus. If the master side is holding SCL low the slave may also drive SCL low in what is known as "clock stretching". – Michael Karas May 17 '17 at 14:42
1

This is as simple as I can imagine it.

Whatever happens the gate is always at 3.3+ volts. When TX-3V3 goes to zero, VGS is +3.3 - 0 making the switch close and dragging the voltage at TX-5V to zero also.

When input at any side is high, nothing happens and both sides are high.

Greenonline
  • 2,064
  • 7
  • 23
  • 38
0

MOSFET Q1 conducts (from drain to source) only when the gate's voltage is 3.3 volts higher than the source's voltage. In this particular case, this only happens when the source terminal is at a LOGIC ZERO. Once the MOSFET is triggered, the voltage at the drain will also become a LOGIC ZERO level because the MOSFET is conducting from drain to source. On the other hand, If the source becomes LOGIC ONE, the MOSFET enters the NON-CONDUCTING-ZONE and the drain will also become LOGIC ONE because of the pull-up resistor.

For this circuit to work, the circuit controlling the SOURCE'S signal must be capable of sinking the current derived from both resistors so, their values need to be high enough as not to overload the gate controlling the source's signal and, sufficiently low, to keep the MOSFET working and to avoid electrical noise conflicts associated with high-resistance-value resistors.

toolic
  • 5,637
  • 5
  • 20
  • 33