PCB Dual Power

Im designing a pcb that has a solar cell input that goes to a voltage regulator currently 5v will soon implement a 3v system. The reason for the voltage regulator is because It is currently going to a barrel jack which can also accept DC wall wart.(I.E. seamlesly switch between wall wart and solar cell.) I think the output of the solar cell is somewhere around 4.5v My question is I want to hook up a battery input as well that will always be connected onboard that way should the solar cell lose output the battery is still supplying the board.

Any Ideas on how I go about setting something like this up so I dont fry the battery yet still have two inputs?

Two words, Diode Logic.

What you want is a Diode ‘OR’ setup.

If only one source is available, it uses it, or if both are available, it will use the higher voltage source.

It’s very simple, just 2 diodes with the correct power ratings. I would use schottky diodes to minimise the voltage drop.

You can read more about it here (or google it a bit)

http://en.wikipedia.org/wiki/Diode-or_circuit

Thanks I think it’s exactly what I need. I will look into it.