How to digitally change a voltage source?

Thread Starter

tglaria

Joined Aug 11, 2014
13
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!
 

MikeML

Joined Oct 2, 2009
5,444
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...
 

Thread Starter

tglaria

Joined Aug 11, 2014
13
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...
Basically, a switch, yup, that should work (and additionally some circuit to turn the other booster off).
I'll give it a shot.

Thanks!
 

crutschow

Joined Mar 14, 2008
34,470
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.
 

Thread Starter

tglaria

Joined Aug 11, 2014
13
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.
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)
 

crutschow

Joined Mar 14, 2008
34,470
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?
 

Thread Starter

tglaria

Joined Aug 11, 2014
13
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?
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?
 

crutschow

Joined Mar 14, 2008
34,470
.................
Use a transistor to short the resistor nice idea, but doesn't the transistor have a voltage drop?
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.
 

Thread Starter

tglaria

Joined Aug 11, 2014
13
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.

I'll give it a try, thanks!
 

MikeML

Joined Oct 2, 2009
5,444
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...
 

Attachments

Top