Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Two Input Voltages into one Regulator

Status
Not open for further replies.

stolzie

New Member
Hi guys,

I have a bit of an issue which I am not sure how to solve. What I need to do is run two DC power supplies one 12V and one 5V (coming from the USB of PC) into a single voltage regulator that will output 3.3V. As shown below

12V DC-------
|
---------LM317 -------3V3 out
|
Diode
|
5V USB ------

Both power supplies can be plugged in at the same time but my only criteria is that the 3V3 out needs to be powered when connected to usb and when the 12V is not present and vice versa.

Is the diode the simplest solution? Or is that pretty dodgey! I am a little concerned when both are plugged in about the current draws.

I was thinking about a FET solution with various turn on state (essentially an OR gate but with power supplies)

If you can help me out it would be greatly appreciated.

Thanks

Stolzie
 
You may want to add a diode on the 12V side also:

12V DC-------
|
7808
|
Diode
|
---------KA78R33C or LD1117AV33-------3V3 out
|
Schottky Diode
|
5V USB ------

When both USB and the 12V supply are on, it will only draw current from the 12V side. You'll want to replace the LM317 with a LDO, such as the KA78R33C or LD1117AV33, because otherwise there won't be enough headroom when powered from USB. You'll also want to use a schottky diode on the 5V line to minimize voltage drop. Even the LDO would be struggling to output 3.3V with a 4.3V input if you used a silicon diode.
 
Last edited:
Hi guys,

I have a bit of an issue which I am not sure how to solve. What I need to do is run two DC power supplies one 12V and one 5V (coming from the USB of PC) into a single voltage regulator that will output 3.3V. As shown below

12V DC-------
|
---------LM317 -------3V3 out
|
Diode
|
5V USB ------

Both power supplies can be plugged in at the same time but my only criteria is that the 3V3 out needs to be powered when connected to usb and when the 12V is not present and vice versa.

Is the diode the simplest solution? Or is that pretty dodgey! I am a little concerned when both are plugged in about the current draws.

I was thinking about a FET solution with various turn on state (essentially an OR gate but with power supplies)

If you can help me out it would be greatly appreciated.

Thanks

Stolzie
The diodes are already in the two supplies.
Min reg. input = 3.3 +2 = ~5.3v?
The 5v can't work, maybe even with a low dropout regulator.

What load current do you need?
 
Sorry, I thought you had one of the wall xformers. I imagine looking into a USB you see the output of a voltage regulator.

Use current steering diodes if in doubt.

I'm working on the general case of two supplies feeding two resistors into the input of a voltage regulator. If you can post the current capabilities of the two supplies and the desired load current your specific case might be solvable.
 
Last edited:
Thanks very much for your replies.

Here is a little further information on what I am trying to do. Essentially the circuit is for an MP3 player where the micro controller, NAND flash and mp3 decoder all run from the 3V3 rail. Have to run at 3V3 due to NAND flash and MP3 Decoder. I could do level conversion but it is easier and cheaper to run the micro at 3V3. I have two amplifier chips which are powered off the 12V rail.

What I want to be able to do is connect the circuit to the USB and be able to transfer the MP3 via USB (FTDI chip) to the NAND flash without having the 12V plugged in (amplifiers disabled) and when the 12V is plugged in operate the amplifiers to play the track.

Current draw for the 3v3 RAIL would be
200mA for Micro controller
30mA for NAND flash
50mA for MP3 Decoder

12V rail
1.5A Maximum for Amp chips

The 12V Rail will be coming from a wall pack, and the 5V USB will be coming from the USB rail on the PC.

Cheers

Stolzie
 
You might be alright with 5V into an LM317 via a schottky diode, depending on what current you want to draw.

Do you want it so as long as there's 5V the current will be taken from the 5V rail rather than the 12V rail?

The circuit you've drawn will give priority to the 12V rail.

If so you need some kind of switch that disconnects the 12V when 5V is connected, the simplest solution would be to use a relay but it's possible with transistors.
 
Here's as far as I got. I think it can be reduced to two equations, two unknowns, but it will run pages of derivation. I'd use a spreadsheet and cut-and-try until you find values that satisfy all conditions.

V1 = 12v, V2 = 5v, Vo = 3.3v. Each supply feeds a resistor, R1 for V1, R2 for V2. Both resistors go into the regulator input and supply currents of I1 and I2.

At one output current, probably the max value, you can choose the current sharing between V1 and V2.

R is the value of the internal regulator resistance which varies itself to meet demand. I don't care about its value, but it falls naturally out of the equations.

V1 = I1(R1 + R) + I2R + Vo
and
V2 = I2(R2 + R) + I1R + Vo

The regulator is modelled as a resistor, R, and a 3.30v perfect Zener, and R varies to always keep the current through the Zener above zero.
Power dissipation in the regulator and elsewhere is a separate calc.

There are limits to the values that the internal R can take on.
If the output current is 500 mA and the input voltage is 5v then R < (5-3.3)v/0.5A = <~3 ohms.
If the output I is 50 mA and the input voltage is 12v then R ~ (12-3.3)v/.05A = ~170 ohms.
 
Last edited:
Thanks for the replies!

Hero999, I would rather have all the current drawn from the 12V side of things if I can get away with that even if the USB is plugged in. If the 12V is disconnected, I still want to be able to connect and transfer the Mp3's to the NAND flash. I don't care if no sound is able to be produced when powered from this mode.

I have thought about using a relay to switch between the two power rails and run on one or the other. But I am not sure how I would give the 12V priority if I did it this way with both plugged in.

Willbe, Thanks for the response and the equations. I see where you are coming from. I will probably do some more calculations with power dissipation to see what is actually going on.

I may end up bread boarding a couple of circuits to see what will actually happen.

Thanks again for your replies.

Cheers

Stolzie
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top