I have SN74HC14 or BC548 / 2N2222 transistors. I need level shifter for I2C between arduino and RPi. Here's simple circuit from the internet enter image description here

Problem is I don't have any MOSFETs. Can I use NPN transistors instead? or do I better use 2 74HC14 NOT gates as single MOSFET?

  • 1
    \$\begingroup\$ Not easily, because unlike normal level shifter circuits, these signals must conduct in both directions. \$\endgroup\$ Jul 1 '14 at 10:55

You can try to use BJTs. Here is what I've built and it works (it has some disadvantages though and may not work in all cases):

enter image description here

Source: http://playground.arduino.cc/Main/I2CBi-directionalLevelShifter

  • \$\begingroup\$ Can you say what disadvantages? or in what cases it will not work? \$\endgroup\$
    – a_vasilkov
    Jul 1 '14 at 11:05
  • \$\begingroup\$ @a_vasilkov "If a line is pulled low, a current from the base to the emittor will turn that transistor on. But the other transistor will leak current from the base to the collector. That current will reduce the current in the first transistor. " from playground.arduino.cc/Main/I2CBi-directionalLevelShifter \$\endgroup\$
    – Cornelius
    Jul 1 '14 at 11:06

No, you can't. The "trick" of using MOSFETs in this type of level shifter relies on the fact that MOSFETs are very symmetrical devices — for all practical purposes, the source and drain terminals can be interchanged, and the device works identically (ignoring the effects of the body diode).

BJTs do not have this symmetry property. The base-emiiter and base-collector junctions are deliberately made with different properties, and while you'll get some gain using it in the reverse direction, it's much less than using it in the proper direction.

The 74HC14 has pins that are input only and output only, and can't be used for bidirectional signals at all.

  • \$\begingroup\$ What do you mean by by symmetrical? \$\endgroup\$
    – Roh
    Jul 2 '14 at 14:37
  • \$\begingroup\$ @Roh: Which part of "interchange source and drain" isn't clear? \$\endgroup\$
    – Dave Tweed
    Jul 2 '14 at 19:00
  • \$\begingroup\$ How a MOSFET can works two-sided (symmetrical)? \$\endgroup\$
    – Roh
    Jul 3 '14 at 4:41

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.