How to digitally change a voltage source?

Discussion in 'General Electronics Chat' started by tglaria, Aug 11, 2014.

  1. tglaria

    Thread Starter New Member

    Aug 11, 2014
    13
    0
    Hi, I have a little question which I don't know how to solve right now.

    I'm designing a circuit which uses a microcontroller and relays to have a square output. The thing is this output must be able to be either 15V o 24V which would come from somewhere...

    I was thinking in using two boltage booster to have both voltages available, but now the question is ¿How do I select which voltage to use (without having short circuits)?

    Alternatively, maybe there's a way to just use one booster circuit, and digitally chose between two series of voltage resistors to change the booster output voltage, but the ¿how could I do this?


    Any ideas?

    (Was I able to explain the problem enough?)

    Thanks!
     
  2. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Why not just use one relay (with FormC NO and NC contacts) to switch between two voltage sources?
    Or use two relays (with FormA NO contacts), and just energize either relay, or no relays. You can write your code to open one relay before closing the other... A diode would prevent backfeeding the higher voltage supply into the lower one, even if you didn't write the code correctly...
     
  3. tglaria

    Thread Starter New Member

    Aug 11, 2014
    13
    0
    Basically, a switch, yup, that should work (and additionally some circuit to turn the other booster off).
    I'll give it a shot.

    Thanks!
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    Where is this "somewhere" the 15V and 24V (DC?) is coming from?
    How much current for each?

    What type of voltage booster are you referring to -- a switching boost regulator?

    Depending upon the source of the voltage you may be able to just control its voltage digitally by switching the sense resistors as you mentioned.
     
  5. tglaria

    Thread Starter New Member

    Aug 11, 2014
    13
    0
    The source is still undecided, but should be a battery (pack), maybe 3.7/7.2 o 9V.
    And yes, I was thinking about a switching boost regulator (I have some difficulties with the vocabulary).

    I've been reading about digital potentiometers, but those I've found need an SPI/I2C interface.
    Isn't there a simple 'two-way switch' for resistors? (I'm guessing a digital switch does interfere with resistance, but I'm not sure, I'll start reading)
     
  6. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    Typically a resistor divider network is used to generate the reference feedback signal from the output voltage to determine the regulated output voltage. For your purpose you could use three resistors in series instead of the typical two resistors. The bottom resistor can then be shorted to ground or not by an N-MOSFET transistor controlled by a digital signal which then determines whether the output voltage is 15V or 24V.

    You can readily buy MOSFETs that have negligible ON resistance (milliohms) as compared to the typical resistor values used for the divider network.

    Note that there will be some delay for the power supply to change between voltages, time required to charge or discharge the output filter capacitors when the MOSFET is switched ON or OFF. Would that be a problem?
     
    tglaria likes this.
  7. tglaria

    Thread Starter New Member

    Aug 11, 2014
    13
    0
    That sounds like a great solution.
    I don't have a problem with a delay between changes.
    Use a transistor to short the resistor nice idea, but doesn't the transistor have a voltage drop?
     
  8. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    A BJT does have a small offset voltage drop, but a MOSFET just looks like a small value resistor when ON and the value of the resistance can be milliohms, so would cause a negligible voltage drop for typical values of a resistive divider network, as I noted in my previous post.
     
  9. tglaria

    Thread Starter New Member

    Aug 11, 2014
    13
    0

    I'll give it a try, thanks!
     
  10. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Here is the essence of the idea. The opamp is a proxy for the voltage regulator in your power supply. The pulse gen on the NFet gate is a proxy for your port pin...
     
    • D180.jpg
      D180.jpg
      File size:
      333.6 KB
      Views:
      25
  11. tglaria

    Thread Starter New Member

    Aug 11, 2014
    13
    0
    Preciesely what I was looking for, excelent.

    Thank you all !
    =D
     
Loading...