Switching between 5V and 3.3V

Discussion in 'Embedded Systems and Microcontrollers' started by ankursingh, Feb 18, 2010.

  1. ankursingh

    Thread Starter New Member

    Feb 18, 2010
    5
    0
    Hi,

    For my hobby project, I am trying to design a connector interface where i should be able to plug-in 5V or a 3.3V device like MMC card, mobile LCD etc.

    Connector pin-out.
    ---- Vcc
    ---- Gnd
    ---- MOSI
    ---- MISO
    ---- CLK
    ....
    ....
    ---- CS

    I am confused on how can i switch my VCC from 3.3V to 5V at run-time (not through jumper) using a uC pin.
    uC will be running on 5V through a adaptor.

    I have done some uC programming but am newbie in electronics.
    I am planning to use the attached circuit.

    Would appreciate your comments on whether it would work or not and any suggestions for a better design.

    cheers !!!




     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    How is that circuit supposed to work? Wouldn't you do better by having a voltage regulator get selected before the device insertion to preselect the correct Vcc?
     
  3. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Use a 3.3V voltage regulator with a control pin.
     
  4. ankursingh

    Thread Starter New Member

    Feb 18, 2010
    5
    0
    @beenthere:
    a. I was thinking that when uC outputs digital low then transistor would go off and output voltage will be (5V - voltage drop across R).
    It should be roughly around 5V.

    b. When uC outputs a digital high then output voltage would be Vce + voltage acros 2R. This would come to somewhere around 3.3V.

    Looking at it again, i think it won't be able to drive enough current for 3.3V device in b.

    @mik3 :
    Any particular device ? A circuit would help.

    Thanks for taking time to respond.
     
  5. ankursingh

    Thread Starter New Member

    Feb 18, 2010
    5
    0
    @beenthere:
    >> Wouldn't you do better by having a voltage regulator get selected before the device insertion to preselect the correct Vcc?

    Any suggestions for a device which can output two voltages ?
     
  6. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    If you can get your hands on one a MAX756 / MAX757 might do the trick. It's a step up converter that has a logic selectable 3.3 / 5V output
     
  7. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Or this circuit from the National semiconductor LM117/317 datasheet.
     
    • V.JPG
      V.JPG
      File size:
      27.7 KB
      Views:
      19
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Good Idea but then the OP should use a higher supply voltage. Now he is using 5 volt as input. And if I remember correct the 317 need at least 2 volt in input output difference
     
  9. ankursingh

    Thread Starter New Member

    Feb 18, 2010
    5
    0
    Thanks for quick response everyone.

    @alberto:
    I was thinking of supplying the generated Vcc (3.3V or 5V) to
    BJT and then using it accordingly as a switch.

    That way output on pins connected to device should be in range
    of device supply.


    0 (5V/3.3V)
    |
    <
    >
    <
    |----------- MOSI/SCK (other pins)
    |
    /
    uC--vvv---|
    \
    |
    |
    ---
    -

    When uC will output zero then MISO pins will show 3.3V or 5V as per the Vcc.
    When uC will output one then MOSI pins will show 0.7v which is TTL zero. So it should be fine.


    cheers !!!

     
  10. ankursingh

    Thread Starter New Member

    Feb 18, 2010
    5
    0
    ascii dig. got garbled.

    Attaching the image.
     
  11. John Luciani

    Active Member

    Apr 3, 2007
    477
    0
    Not sure if I understand the question but there are a variety of logic families that
    have 5V tolerant inputs when powered at 3.3V.
    For TH parts the AHC family. Power an AHC buffer with 3.3V and
    the inputs can be either 5V or 3.3V.

    (* jcl *)
     
  12. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    What if you made a connector with a common ground, but separate pins for the 3.3 and 5 volt power? Each device would wire its connector to the correct power pin.

    That has the advantage of preventing mistakes like plugging a 3.3 volt device in while the supply is still set to 5 volts.
     
Loading...