Connect with us

Level Converter

Discussion in 'Electronic Basics' started by Jon Slaughter, Oct 5, 2007.

Scroll to continue with content
  1. How can one convert one level to another in the simplest manner?

    I have one device that works on 2.5V and another that works on ~5V. The bus
    is bi-directional so I need to convert both ways.

    Actually the 5V device has open collector outputs but the problem is that
    its not truely open collector since it has a pullup itself. So if I put a
    2.5V pullup it's actually larger than 2.5V. Of course I could reduce the
    resistor pulling up to 2.5V but then it causes the current to go out of

    The basic idea is

    Vdd Vcc
    --- ---
    | |
    .-. .-.
    Vdd | | | |
    --- | |Rd | |Rc
    ---------o '-' '-'
    | |
    -o | ___ | _/
    __--o---|---|___|---|---o/ o- GND
    GND------o Rw

    Where everythign after Rw(Vcc, Rc, Sw1) are internal(the parallel port) to
    the 5v device and everything before Sw2 is internel to the 2.5V(a micro

    Sw1 controls the parallel port output state and Sw2 controls the output of
    the pic. (it's also used as an input in which case Sw2 is set to
    Hi-Z(middle) and there is a line connected just before it)

    Rw is the wire resistance which is significant in this case I believe since
    I'm actually getting only about 4V instead of 5V(although I haven't checked
    the parallel port's voltage itself so it might be low already).

    In any case, Vdd is the pull I add which is suppose to be about 2.5 volts.
    In reality what the pic see's is over 3 volts dependon on how I choose Rd.
    (It has to be alteast 625ohms because Sw1 can only sink 4mA and 2.5V/4mA =
    625Ohms.) Rc is suppose to be 4.7kohms or so but no telling what it actually

    Actually there needs to be a current limiting resistor right after Sw2 in
    teh case Sw2 is at Vdd and Sw1 is at GND. It too needs to be atleast

    In any case I don't see an easy to to convert the levels in any decent way
    because of the internal pullup ;/ What I was thinking is to use a bjt that
    is driven by the parallel port... something like

    <| ___
    |-o-|___|-o--- Parallel Port
    PIC ----o-----+
    | |
    | |

    I'm not sure if this is the best solution though. (Its not the complete
    circuit and there are a few other issues but I think they are minor)

    Just seems like a mess and I'm trying to find the best solution I can that
    uses the least amount of components.

    There are 4 lines and all our input(w.r.t to the pic) except one which is
    input and output.

    So what I really need is 3 5V to 2.5V level translators and 1 5V to 2.5V and
    2.5V to 5V.

    I suppose what would be nice is there was a device that translated between
    two voltage levels with bidirectional capabilities? I was hoping I could get
    away with just using resistors but this doesn't seem to be the case ;/

    Maybe theres something easier that I'm overlooking or maybe my idea with the
    BJT's won't work well?

    Hash: SHA1

    I remember there being an article on the web that did level translation
    with a single FET that was bi-directional. I have scoured my bookmarks
    but I can't find it - sorry. Perhaps another member of this newsgroup
    recalls it?

    - --
    Brendan Gillatt
    brendan {at} brendangillatt {dot} co {dot} uk
    PGP Key:
    Version: GnuPG v1.4.3 (MingW32)

    -----END PGP SIGNATURE-----
  3. A problem I have with the bjt's(or even mosfets) is that the level is
    significantly below what I really need. I'm wondering if there is a way to
    reduce the voltage drop across the transistor to get closer to rail voltage?


    \ R
  4. Maybe theres hope after all. I'm pretty sure it can be done but the problem
    I'm having with a single mosfet is that the voltage is significantly lower
    than what I need given that the gate is only about 1.5V above the drain.
    This means I have to pull up the gate past 5V or so to get practically rail
    to rail but that means I need another power source(2.5V and 5+V). This is
    not necessarily the worse thing but I'd like to avoid it if possible.
  5. John Larkin

    John Larkin Guest

    TI has some chips that do exactly this.

  6. I send a schematic showing my idea to binaries.schematics but there are some
    issues(the short that exists). Basically there are 4 parts. The parallel
    port, which is up to the 10ohm resistor(wire resistance). The pullup's for
    level translation which is the 8V and 2.5V parts. The Pic part which is J1
    and everything after it(not sure the actual hardware involved but I modelled
    it similar to the parallel port(forgot the pullup resistor but in this case
    it doesn't matter to much). Then theres the read part which starts with Q2.
    This is only when the PIC part is set for output mode. This occurs only for
    one of the pins. The other 4 would not have this.

    Even if this circuit worked as is(the resistor values were somewhat
    arbitrary though) it would require 3 power sources. (I might get away with
    just 2, a 2.5V and a 5V(or 6V even) but this might be risky).
  7. Thanks, I'll look into it and see.

  8. The


    Looks pretty cool. Going to get some now. Probably all I need.

  9. Andrew Holme

    Andrew Holme Guest

    Look at the level-shifter circuit on page 43 of the I2C specification:

    This is for bidirectional open-drain / open-collector signals.
    Hash: SHA1

    Yeah I think it was something like that - the source and drain were
    connected between the two logic lines and the gate was attached to
    (insert memory here).

    - --
    Brendan Gillatt
    brendan {at} brendangillatt {dot} co {dot} uk
    PGP Key:
    Version: GnuPG v1.4.3 (MingW32)

    -----END PGP SIGNATURE-----
  11. Hehe, I was just reading over that spec last week and glanced over that but
    forgot ;/ It might work well.

    I think though the biggest problem I'm going to have is that under certain
    circumstances I can end up with a short and I'm not sure how I am suppose to
    go about preventing any damange(I can, for the most part avoid the short but
    in some cases I might not). I was thinking about a foldback limiter but
    still working on the details.

  12. This looks like it might solve my problem too ;) The short won't exist
    because it reverse biases the mosfet ;) Seems like it might be the best
    discrete solution. The biggest problem is that it requires 2 voltage
    sources but I can live with that and theres probably no way around it

    Thanks again,
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day