LM1117 Priority OR Circuit - Page 1
Forum section: electronics / projects

author: hal9001
author_rank: Regular Contributor
timestamp: December 10, 2022, 11:45:26 am
content: Hello,I have a circuit that I want to accept power from a 12v power supply or 3v battery. The power supply has priority. Assume 3v battery is always plugged in.1 ) If 12v supply plugged in then I dont want 3v battery power used. LM1117 regulates 3.3V output.2 ) If 12v is not plugged in then I want 3v battery to be used and no current wasted through LM1117 output pin.Does my circuit achieve this? Does the LM1117 have reverse current protection on the output pin to not get damaged or consume current from the 3v battery in case 12v supply is not present?Cheers!

author: mariush
author_rank: Super Contributor
timestamp: December 10, 2022, 12:44:02 pm
content: You would probably want a diode from regulator output to regulator input or a plain diode with very low forward voltage after output pin... if the input voltage goes below output voltage, the regulator may not be happy. But with diode between output and input, then voltage from battery would go back into the mosfets and mess things up.An ideal diode after the output capacitor of the regulator would probably be easier.But there's much better parts out there for what you want to accomplish.For example, look at ideal diodes or OR controllers at distributors like Digikey, Mouser, Farnell/Newark, RS-Components etcOR Controllers, Ideal Diodes :https://www.digikey.com/en/products/filter/power-management-pmic/or-controllers-ideal-diodes/758some examples of 2 input > 1 output :TPS2115PW AUTOSWITCHING POWER MULTIPLEXERTSSOP :https://www.digikey.com/en/products/detail/texas-instruments/TPS2115PW/5260428SON :https://www.digikey.com/en/products/detail/texas-instruments/TPS2115ADRBR/1843509datasheethttps://www.ti.com/lit/ds/symlink/tps2114.pdfThe TPS211x family of power multiplexers enables seamless transition between two power supplies, such as abattery and a wall adapter, each operating at 2.8-5.5 V and delivering up to 1 A. The TPS211x family includesextensive protection circuitry, including user-programmable current limiting, thermal protection, inrush currentcontrol, seamless supply transition, cross-conduction blocking, and reverse-conduction blocking. These featuresgreatly simplify designing power multiplexer applicationsICL7673CPAZ (this one's even available in DIP8 package) :SOIChttps://www.digikey.com/en/products/detail/renesas-electronics-america-inc/ICL7673CBAZA-T/1034565DIPhttps://www.digikey.com/en/products/detail/renesas-electronics-america-inc/ICL7673CPAZ/936255https://www.renesas.com/us/en/document/dst/icl7673-datasheetThe Intersil ICL7673 is a monolithic CMOS battery backup circuit that offers unique performance advantages over conventional means of switching to a backup supply. TheICL7673 is intended as a low-cost solution for the switching of systems between two power supplies; main and battery backup. The main application is keep-alive-battery powerswitching for use in volatile CMOS RAM memory systems and real time clocks. In many applications this circuit will represent a low insertion voltage loss between the suppliesand load. This circuit features low current consumption, wide operating voltage range, and exceptionally low leakage between inputs. Logic outputs are provided that can be usedto indicate which supply is connected and can also be used to increase the power switching capability of the circuit by driving external PNP transistors.Some examples of ideal diodesLMLM66100 5.5-V, 1.5-A 79-mΩ, Low IQ Ideal Diode With Input Polarity Protection :https://www.digikey.com/en/products/detail/texas-instruments/LM66100DCKT/10273182datasheet:https://www.ti.com/lit/ds/symlink/lm66100.pdfThe chip enable works by comparing the CE pin voltage to the input voltage. When the CE pin voltage is higher than VIN, the device is disabled and the MOSFET is off. When the CE pin voltage is lower,the MOSFET is on. The LM66100 also comes with reverse polarity protection (RPP) that can protect the device from a miswired input, such as a reversed battery.orMAX40200 Ultra-Tiny Micropower, 1A Ideal Diode with Ultra-Low Voltage Drop :https://www.digikey.com/en/products/detail/analog-devices-inc-maxim-integrated/MAX40200AUK-T/7392218The MAX40200 is an ideal diode current-switch that drops so little voltage that it approaches an order of magnitude better than Schottky diodes. When forward-biased and enabled, the MAX40200conducts with as little as 85mV of voltage drop while carrying currents as high as 1A. Typical voltage drop is 43mV at 500mA, with the voltage drop increasing linearly at higher currents. The MAX40200 thermally protects itself, and any downstream circuitry, from overtemperature conditions. When disabled (EN = low) the MAX40200 blocks voltages up to 6V in either direction, making it suitable for mostlow-voltage, portable electronic devices.Also.... if you can use something better than 1117, some 1117 regulators (depends on manufacturer) will be unstable if the output capacitor doesn't have ESR within a specific range, for example most often that range is 0.1 ohm and 1 ohm, so those particular models will be unstable with ceramic capacitors (unless you add a 0.1ohm or higher resistor in series with the output capacitor.

author: magic
author_rank: Super Contributor
timestamp: December 10, 2022, 01:22:05 pm
content: 1117 already has an internal Vout→Vin diode which will drain the battery together with R1. It may also cause the P-FETs to turn off until VDD decreases somewhat below VBat.Internal feedback resistors of the 1117 will drain the battery too.Not 100% sure, but it looks like an accurate ideal diode circuit (like those listed above) may be a necessity here.Alternatively, a completely different approach could be to put 1N4148 at the output of the regulator, replace the battery with something rechargeable and add a resistor in series with it to limit charging current. There is a few devils in the details, but perhaps it's workable and may (or may not) be cheaper.

author: Peabody
author_rank: Super Contributor
timestamp: December 10, 2022, 03:35:29 pm
content: I think you only need M2. If the regulator is on, M2's body diode will prevent current from flowing back into the battery. But current can't flow the other way because the body diode will never be forward biased. M1 doesn't add anything.However, your mosfet probably won't work. It has a maximum GS threshold voltage of 4V. So it may never turn on with a Vgs of 3V. You need to find one with a maximum threshold voltage of about 1.5V or less. The threshold is where the mosfet just begins to conduct, so you need some headroom above that.You could test the regulator to see if current flows back through it. Connect the 3V positive battery terminal to the output of the regulator through a 10K resistor, with everything connected up, including the 12V supply powered down. You should get no voltage at the regulator input, and ideally no voltage drop across the resistor, although there may be a little if there's a voltage divider feedback in the regulator.But the simplest solution might be to use the adjustable version of the regulator, set it to 3.9V, and put a diode in its output to bring the voltage back down to 3.3V. Then I think the circuit should switch automatically with no problem.Edit: I forgot about the 4.7K pulldown resistor. That should be disconnected when doing the reverse current test of the regulator.

author: magic
author_rank: Super Contributor
timestamp: December 10, 2022, 07:29:13 pm
content: 1117 and 317 regulators leak from OUT to IN, guaranteed, see National's datasheet. Maybe there are some that don't, but most fixed regulators still have a feedback network from OUT to GND, so output diode (or "ideal diode" circuit) is almost unavoidable.Problem with the M2 circuit as drawn is when input voltage is ~2V - enough to turn M2 off, but not enough to power the load. The load will experience brownout when the external supply ramps up. M2 needs to be controlled by some sort of comparator, detecting that output from the regulator goes higher than the battery. Inclusion of an output diode means that the comparator may have a fair bit of offset and still protect the battery from charging.Alternatively, use battery technology that can tolerate charging.

author: Peabody
author_rank: Super Contributor
timestamp: December 10, 2022, 09:54:22 pm
content: I would expect the 12V source to pass through 2V pretty rapidly. Perhaps a somewhat larger output capacitor would cover any glitch. Also, even if the mosfet turns off too soon, its body diode will supply the load at 2.4V at worst. I think it would be worth trying it as is just to see how well it works.

author: hal9001
author_rank: Regular Contributor
timestamp: December 11, 2022, 11:21:11 am
content: Quote from: mariush on December 10, 2022, 12:44:02 pmMany thanks for such a detailed post!!Quote from: magic on December 10, 2022, 01:22:05 pmThanks magic!Quote from: Peabody on December 10, 2022, 03:35:29 pmThanks Peabody!