Electronic – USB and Battery switching circuit not working [and buck boost converter not working either]

batteriespowerusbvoltage-regulator

I am an absolute beginner when it comes to electronics and this is my first circuit, so please excuse my ignorance and thank you for your patience and help.

I am trying to build a circuit which provides 3.3V power to a micro-controller (Nordic Semi nRF52840). Absolute maximum range of voltage should be 1.8V to 3.6V. Maximum power consumption would be 140mA. It should use battery power when USB is not connected and use USB power when connected (ideally without resetting). Efficiency is not super critical because I am planning to use a recharging circuit for LiPo battery if this works, but it would be ideal to get 2 weeks standby time.

I used the design in this earlier stackoverflow question by Russell McMahon and built the circuit. It worked fine when I tested with bigger components, but with a huge voltage drop. I thought using SMD components rated for lower voltages would reduce the voltage drop. But the input voltage is oscillating all over the place if I use Q2 P-mosfet (Q3 in the linked answer). If I bridge the battery Vcc directly to the buck-boost converter, I am getting a 0.95V output steady, where it is supposed to output 3.3V.

Here is the schematic of the circuit:

KiCAD schematic for USB Battery power switching and regulation with LTC3531ES6-3_3

And here are the components used (external sites linked):

  1. [R1,R2,R4] 1M 5% 0805 SMD Resistor
  2. [R3] 10K 5% 0805 SMD Resistor
  3. [R5] 100K 1% 0805 SMD Resistor
  4. [Q1] BC807-40LT1G – 45V 500mA PNP Bipolar Transistor SMD
  5. [Q2] SI2333CDS-T1-GE3 – 12V 2.5W P-Channel Power Mosfet SMD
  6. [Q3] BC817-40LT1G – 45V 500mA NPN Silicon Bipolar Transistor SMD
  7. [D33] SS34-E3/57T – 40V 3A Schottky Barrier Rectifier
  8. [C_PWR1] 2.2 uF 25V 0805 SMD Ceramic Capacitor
  9. [C_PWR2] 10 uF 25V 0805 SMD Ceramic Capacitor
  10. [L1] 10 uH 0603 Ferrite Chip Inductor
  11. [U_PWR1] LTC3531ES6-3_3 (also used the circuit mentioned in the datasheet)

And here is the PCB design

KiCAD PCB design for USB Battery power switching and regulation with LTC3531ES6-3_3

A picture of the PCB (sorry about the blurry shot):

Picture of the PCB's power conversion area

The breadboard components I used were, without the voltage regulator,

  1. [Q1] 2N2907A PNP Switching Transistor
  2. [Q2] IRF9530 MOSFET- 100V 14A P-Channel Power MOSFET
  3. [Q3] 2N2222A NPN Bipolar Transistor
  4. [D33] 1N4007 – The large voltage drop was probably because of this.

I am looking for help on the following points:

  1. Where am I going wrong in this circuit, why and how can I fix it? If possible, with the same PCB as I have already bought it (at 3x the cost, because of the import laws in my country).
  2. If the circuit cannot be salvaged and I have to make a new PCB, is there any way I can supply between 1.8V and 3.6V to the micro-controller with the current PCB so that I can continue developing and testing the other parts of the circuit while I wait for the new PCBs? I do have the AMS1117-3.3V but I doubt it can manage 3.3V from a 3.7V LiPo battery (drop voltage is 1V if I read the specs correctly). I guess I could use 3 alkaline batteries as a stop-gap.

Getting very specialized parts might also be a problem because again, importing and getting parts across customs is a painful and drawn out process. But I can still try if it helps me salvage the board.

Sorry about the long post, but I wanted to be absolutely sure I am conveying exactly what I am doing. Please help me finish this project, as I am completely out of my depth and have no idea what is wrong. It has been 3 months in the going and this is a very disappointing block. Thank you for any help you can provide!

Best Answer

am trying to build a circuit which provides 3.3V power to a micro-controller (Nordic Semi nRF52840). Absolute maximum range of voltage should be 1.8V to 3.6V. Maximum power consumption would be 140mA. It should use battery power when USB is not connected and use USB power when connected (ideally without resetting). Efficiency is not super critical because I am planning to use a recharging circuit for LiPo battery if this works, but it would be ideal to get 2 weeks standby time.

Pretty much any Low Drop-Out Regulator should work to regulate the 3.8V nominal voltage of a Lipo battery. The AMS1117 is not really a good match because it is not an LDO. Try the AP2112K. You don't need a buck boost converter, since your current consumption is also not that high, hence your power loss is negligible. Here is an example from a previous project I had, that I know works. enter image description here

When it comes to auto voltage selection it is less intuitive if you are new to electronics but this circuit should work for that purpose.

enter image description here

You don't need D2 and the 5V rail if you don't want an external 5V input pin other than the USB port. The Switch-In would be is your Regulator input.

Also you may want to use polarized tantalum capacitors instead of ceramic ones for C9 and C11.

If you want to trouble shoot the design you provided above:

  1. Try running a spice simulation, it helps a lot

  2. If you have an oscilloscope try monitoring what is going on individual nets. Compare what you see to how it should look like and try to identify the problem step by step.

Edit to explain how the auto select circuit works:

The way my Auto select circuit works is like this:

  1. Ubat: not connected ; VBus: 5V : the current flows through D1 to Vin, other components can be ignored.
  2. Ubat: 3,8V, VBus not connected: Q3 is on, because its gate is connected to ground through R14. So it can supply Vin of the regulator
  3. Ubat 3,8V; VBus: 5V; the gate of Q3 is pulled high so it doesn't conduct, Current flows through D1 again as in (1).

The circuit you provided works pretty much the same way. I am not sure as to why he also used the bipolar transistors. I am sure someone else can explain why he did that.

Edit that comes after edit:

It appears he made a mistake wiring the PMOS in his design, mixing the drain and the source pins. Otherwise the design that he provided should work fine according to the Spice simulation that I made.