4
\$\begingroup\$

Logic level converters like this one from Sparkfun have high side and low side labels on them. Now i have an application where I think I need to shift logic levels but the high side and the low side are likely to swap at some point due to changes in battery voltage over time.

Bidirectional Converter Circuit

This is intended for a battery powered project with an expected runtime of a year where an ATTiny85 that can natively work between 2.6V and 6V and is directly connected to the battery will be talking to an ESP that is behind a 3.3V regulator because it can not handle more than +-0.5V deviation from 3.3v on any of the pins. The ESP (regulator) will brownout much earlier but that is OK.

I started reading the BSS138's Datasheet and could not find any mention for or against swapping sides.

So I built a very minimalistic simulation of the circuit. According to the simulation the source-drain is passed in either direction in "normal" operation while sticking to the high and low side labels.

Falstad Simulation

Further simulations swapping the high/low sides and even having them the same voltage did seem to work.

Is there any downside to swapping the high/low sides with a logic level converter based on a BSS138?

Thank you Dave for your answer.

Now I see that the sides do matter and swapping them would lead to failure. Here is the sideswapped state with both sides pulled high which would lead to failure:

Failure

The left side is pulled down to 4.1V (should be 5V) and the right side is pulled up to 3.8V (should be 3V) potentially destroying the ESP, definitely destroying the ESP if the battery was at 6V and connected to the converter's low side!

\$\endgroup\$
  • \$\begingroup\$ For Nch low side is below gate voltage.!! \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Jul 8 at 14:44
  • \$\begingroup\$ Unless you have some other power source it seems hard to see how the side of the shifter powered by the regulator output could be at a higher voltage than the side powered by the regulator input. So how would the situation of concern occur? \$\endgroup\$ – Chris Stratton Aug 4 at 7:26
5
\$\begingroup\$

Yes, they matter. See that body diode on the MOSFET? It must be reverse-biased when both signal lines are being pulled high.

Otherwise, the HV side is trying to pull the LV side higher than the LV supply voltage. If that wasn't a problem, you wouldn't need the level shifter in the first place.


If you can find a MOSFET that doesn't have its substrate internally shorted to the source pin (i.e., it is brought out to a fourth pin), then you can do what you want. Connect the substrate to ground (the most negative point in your circuit), and then you can use the source and drain terminals interchangeably.

\$\endgroup\$
  • \$\begingroup\$ So using my simulation with the sides swapped i.e. having 5V on the left side and 3V on the right side some current is flowing through the diode. Although most of it flows through the MOSFET. Is this a reverse-bias? Could this be tolerable? It certainly seems to waste power but will it eventually lead to failure? \$\endgroup\$ – atcw Jul 7 at 23:57
  • \$\begingroup\$ Sure. The HV side is trying to pull the LV side higher than the LV supply voltage. If that wasn't a problem, you wouldn't need the level shifter in the first place. \$\endgroup\$ – Dave Tweed Jul 8 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.