0
\$\begingroup\$

So I have the following circuit, which is a bi-directional level converter:

enter image description here

I am using it to convert a 5v logic signal (which at high is actually 4.2v and low is ~0.2v) to a 3v3 logic signal. I have already tried my own, one directional level converter, like this:

schematic

simulate this circuit – Schematic created using CircuitLab

The problem is, when I use the one directional converter, the 5v input is connected directly (except for 3K Ohms of resistors) to ground, which causes the signal [from the 5v] to drop to 0v. Also, an LED on the board that the signal is coming from turns on. The board that I am using is this board and the output/signal I am using is the LB (Low Battery) pin, which is pulled to BAT, which is anywhere from 4.7v-3.2v, unless the battery drops below 3.2v, then LB drops to about 0.2v.

So my question is: Will the bi-directional converter have this problem? Will the input ever be connected directly to ground?

If so, how can I do this so that the 5v signal can be used as 3v3, I was thinking of using a MOSFET, where the base is the 5v from here. How can I convert this ~4.7v signal (which is pretty much 5v logic even though it's really analog) to a 3v3 digital signal?

Finally, I am really REALLY dumb when it comes to circuitry, so try to dumb things down a lot please, thanks.

\$\endgroup\$
2
\$\begingroup\$

An open-drain/open-collector output is only pulled low and does not have a defined high level. Therefore, to get the desired high signal level, simply connect a pull-up resistor to that:
open-collector pull-up

\$\endgroup\$
  • \$\begingroup\$ Is the arrow referring to 3v3 power, e.i. constant input? \$\endgroup\$ – Patrick Cook Feb 21 '16 at 9:38
  • \$\begingroup\$ Yes, it's the power supply of the device that receives the signal. \$\endgroup\$ – CL. Feb 21 '16 at 9:39
  • \$\begingroup\$ Ok, I'm going to try this. Hopefully I don't fry everything. I'll comment when I'm done \$\endgroup\$ – Patrick Cook Feb 21 '16 at 9:40
  • \$\begingroup\$ Does it have to be 10k ohms? Or would 1k work? \$\endgroup\$ – Patrick Cook Feb 21 '16 at 9:41
  • \$\begingroup\$ With a 1k ohm resistor it output 3.66v when high, I'm going to drain the battery while I attach another resistor to see if that will drop the voltage to about 3v and test when the LBO is 0v. \$\endgroup\$ – Patrick Cook Feb 21 '16 at 9:52
1
\$\begingroup\$

The LBO pin on that chip is open-drain, meaning that it can only pull the output to close to ground. I didn't see a schematic for the board but presumably there is an LED and series resistor to 5V. 1.2V seems very high for the low voltage,

If you want 3.3V level, you can use a PNP transistor (eg, 2N4403), emitter to +3.3, base through 3K to the LBO pin, and collector to ground through 1K. Pick the signal off from the collector.

When the LBO pin is below about 2.5V, the transistor turns on and pulls the output high (not the inversion), and when it is high (LED off) the output is pulled low by the 1K resistor.

The bidirectional converter will not work well if the input is only pulled down to 1.2V, and is only necessary if you need to turn the LED on by pulling the 3.3V output low.

\$\endgroup\$
  • \$\begingroup\$ Just realized I put 1.2v instead of 0.2v, I'll edit my question. \$\endgroup\$ – Patrick Cook Feb 21 '16 at 7:59
  • \$\begingroup\$ Is there any chance I can do this with an NPN transistor? I just found one lying around in a drawer. \$\endgroup\$ – Patrick Cook Feb 21 '16 at 8:12
1
\$\begingroup\$

Your resistor divider requires that the 5V device drives its output high. However, your LB signal uses an open-drain output, which can only pull the output low.

The bidirectional MOSFET level shifter works because its I/Os are high by default (due to the pull-up resistors), and just require that either signal is pulled low.

You can construct a similar level shifter with an NPN transistor. An NPN does not have a body diode between emitter and collector, so this shifter is only unidirectional, but can shift either up or down:
single NPN level shifter

\$\endgroup\$
  • \$\begingroup\$ Like I said in the question, I'm pretty dumb when it comes to this, but I understand your schematic and most of what you said. I just don't understand how the output could be low if (I think) the schematic says to wire 3v3 to the ouput via a 10k resistor, or are those arrows ground? \$\endgroup\$ – Patrick Cook Feb 21 '16 at 9:29
  • 1
    \$\begingroup\$ When the input is 0V (connected to ground), the transistor switches on. This means that a current flows through R2 and the transistor's collector/emitter pins. R2 and CE form a voltage divider, but because the transistor is saturated (the base current is even higher than the collector current), CE is very low (probably less than 0.1V). \$\endgroup\$ – CL. Feb 21 '16 at 9:32

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.