Shop OBEX P1 Docs P2 Docs Learn Events
3.3 vDC to 5v DC — Parallax Forums

3.3 vDC to 5v DC

Earl FosterEarl Foster Posts: 185
edited 2008-09-06 17:38 in Propeller 1
I am trying to interface the Prop with a device that requires a 5V signal and was looking for suggestion.· The 3.3V signal is not enough to trigger the other device.· I searched through the posts but could not find anything.· I am pretty sure I can use a transistor but I am not sure which one or·the·supporting circuitry needed to boost the signal.· Suggestion would be great.

Thanks··

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET

"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-05 19:39
    There is a long permanent ("sticky") thread here on interfacing the Propeller to 5V devices. There are many potential solutions discussed. Look under "Propeller Hardware Stickies" at the top of the thread list.
  • Earl FosterEarl Foster Posts: 185
    edited 2008-09-05 19:52
    I looked at that thread. Isn't it going from 5Vdc to 3.3Vdc. Perhaps I missed the part in the thread that is boosting the signal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-05 20:22
    The cheapest (and simplest way) is to use pull-up resistors to 5V and drive Propeller pins in open collector mode. OC mode is where you set the output value to 0 and switch between input and output. When the pin is set to input the line is at 5V, when the pin is set to output the line is at 0V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-05 20:22
    Some suggestions are for input circuits from a 5V sensor to the 3.3V Propeller and some go the other way. Some are bidirectional. Usually, the 5V side uses some circuit powered by 5V so the Propeller just has to control the 5V. A simple switching transistor with a collector resistor connected to 5V will usually do. A 2N2222 or PN2222 or equivalent will usually work very nicely. A 470 Ohm or 1K resistor from the collector to +5V, ground the emitter, and use a 1K resistor from the base to the Propeller I/O pin will work.
  • Earl FosterEarl Foster Posts: 185
    edited 2008-09-05 20:25
    Thank you

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-09-06 01:54
    Take a look at this device - it might help you:

    http://www.sparkfun.com/commerce/product_info.php?products_id=8745

    Thanks for posting the balloon flight stuff. Very interesting and helpful.
  • Mike HuseltonMike Huselton Posts: 746
    edited 2008-09-06 03:24
    I have used them (Logic Level Converter, sku: BOB-08745), and they work flawlessly. The price is right, and they occupy minimal space.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH - Electronics: Engineer - Programming: Professional
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-06 04:49
    Paul Baker said...
    The cheapest (and simplest way) is to use pull-up resistors to 5V and drive Propeller pins in open collector mode. ... When the pin is set to input the line is at 5V, when the pin is set to output the line is at 0V.
    I hate to contradict Paul, but it's not quite that simple. What happens when you pull a free-floating pin up to +5V through a resistor is that it rises to about 3.93V, which is Vdd + 0.6V (one forward drop of the input protection diode). However, this is high enough to drive some (but not all) 5V logic parts.*

    I'd like to see the behavior that Paul claims for the Prop I in the Prop II, though. As I've noted elsewhere, the inputs on 74LVC logic chips are fully 5V-tolerant when powered from 3.3V and any open-drain ouputs can be pulled all the way to +5V. I'm not sure how this works for pins that can also be driven in totem-pole fashion (as in a microcontroller), though, i.e. whether the PMOS output transistors have to have body diodes or not and, if they do, whether they can be disconnected from the pin completely when the pin floats.

    -Phil

    * You can tell which parts this will work with by looking at their data sheets. If the minimum guaranteed "on" voltage is 0.7 * Vdd (3.5V), it will work. Some parts spec 0.8 * Vdd (4.0V), though, which might work, even though it's beyond the 3.93V being input.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-06 05:33
    Ah yes, I stand corrected. Thank you Phil. I have used a series and pull-up which has worked if you choose the values correctly. For some reason my brain short circuited when I provided the respose, forgot that since it's ot a true OC it wont work the same.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2008-09-06 06:31
    I've been thinking about this awhile, and this solution should solve several issues.

    The "LOW" voltage rides at the 0.6V band-gap, but the "HIGH" side pulls to the rail, depending on what side you are on. (3.3V or 5V)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    1197 x 763 - 203K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-06 07:00
    Paul Baker said...
    Ah yes, I stand corrected. ...
    Paul, if it's any consolation, because it was you making that claim, I went out to the shop and double checked it on the bench before I posted my response. smile.gif

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-09-06 13:09
    3V_5V_mosfet.jpg
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2008-09-06 14:38
    Ok, so Phil gets the credit for the Bi-Polar transistor version that I recently posted, but I swear that I didn't see his original post.

    http://forums.parallax.com/showthread.php?p=711750

    PJ's version is the complementary CMOS equivalent.... The main difference is that a LOW will go closer to the negative rail.


    Both circuits (Bi-Polar or MOSFET) are true level shifters in the sense that you can drive (source) the pins HIGH on either side as opposed to just sinking them LOW.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-09-06 15:02
    I claim no credit.· I saw this Subject yesterday and started looking into it, found an AN from Philips and started experimenting with this circuit.· Finishing that, I came back to see that Foster was probably off on his way and thought I'd leave the matter go.·

    Seeing this recent activity I figured·I'd pulse in, too (yatta-hay).
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-06 15:45
    Nor do I. The bipolar circuit is just a derivative of the Philips circuit, which I had seen before and which, by the way, is patented. (Just three components, and they get a patent. Don't get me started!)

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Earl FosterEarl Foster Posts: 185
    edited 2008-09-06 17:38
    Thanks again everybody

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
Sign In or Register to comment.