Automatic Voltage selector with FDN340P for small arduino project

Hi,
I have been working for a small arduino based project which involves a single cell 18650 LiPo battery charger plus an LDO for 3.3V regulation.

First of all let me clear it that, I have come up with this idea based on the automatic voltage selection on Arduino Uno board and my knowledge on MosFETs are somewhat at a beginner level. So I need advice/recommendation/criticism/guidance on what I am trying to achieve.
I have attached the schematic.

My project will run on a single cell 18650 LiPo battery and also can be powered through a micro USB charger.
For charging the battery I have used MCP73831, as 3.3V LDO I have used MCP1825 IC and I need to achieve the following features:

While the USB is plugged in, the battery should be charging through the MCP73831 and 3.3V should be coming through the MCP1825.
Here VIN represents the 5V coming from VBUS line of the USB connector. This 5V should be supplied to the input of MCP73831 and also to IN-pin of MCP1825.

While USB is unplugged, there will be no input to the charger. So, the MCP1825 should be powered from the battery, which will eventually supply regulated 3.3V to other circuitry. There should also be a protection from the back powering of the battery voltage to the input of charger IC

So, I have used FDN340P as its a P-Channel MosFET. Connections are: Drain to Vbat, Source to IN-pin of MCP1825, Gate to VIN-pin of MCP73831. The diode D1 is between VIN and IN pin to prohibit the back powering.
So far i have learned, my understanding on this is, as Q1 is a P channel mosfet, when USB is plugged in, the gate will have a large positive voltage. So the Fet will switch off and the Vbat is isolated from the LDO.
When its unplugged from USB, the Gate will be pulled low through the 10k R3 resistor causing the mosfet to switch on. Therefore, IN-pin of MCP1825 will be powered from Vbat.
Diode D1 will protect the battery from back powering the charger IC.

Please, let me know if this configuration is right or if i need any modification, how should i do it.
Thanks.

N.B: FDN340P, MCP73831, MCP1825 all are SMD parts and can’t test them on breadboard. So, I have to go for a SMD PCB to test this circuit, therefore, before I am going to try that, I want to make sure as much as i can that I m doing it right. I hope I have explained my situation.
Thanks again.

Why do you have a 1 k resistor in series with the gate ?

Not sure what you are saying here:

When its unplugged from USB, the Gate will be pulled low through the 10k R3 resistor causing the mosfet to switch on. therefore, Vbat will be connected to IN of LDO and diode D1 will protect is from back powering the charger IC.

I’m not saying it is incorrect. That depends on what you think you are saying. I agree on the connections. What do expect the result to be ? (VBAT powers mcp1825 IN ? or IN charges battery ?)

A P-channel conducts Source to Drain, so it will conduct from the IN pin to the battery,
not from the battery to the IN. As long as that’s what you mean then that’s correct.
The correct way to say what you are trying to say is not to discuss the connections but to discuss the direction of current:
ie:
“When the USB is disconnected, the gate will be pulled low and the fet will turn ON and the current will flow from the cathode of D1 (which is fed from Vin) through the fet to BAT+ (source to drain)” . However I don’t see a Vin connector so I am not sure how that would work. Turning on the fet with no power on “VIN” is not going to do anything.

The only connector I see is the USB . On the UNO, “Vin” is the input for the external dc input barreljack. I don’t see any such connector in your schematic so I don’t know what good it is going to do you to turn on the fet with nothing on the input (source).

One of us is missing something.

So, I have used FDN340P as its a P-Channel MosFET. Drain to Vbat, Source to IN, Gate to VIN and the diode D1 is between VIN and IN of LDO to prohibit the back powering.

I would have stated this:
" The input for the fet source is IN, the output for the drain is Vbat…" (since it conducts source to drain)

Also don’t know what you mean by “IN” . Are you referring to a pin on the MCP1825 ?

Is it possible you are confused about the direction of current flow in the fet ? Did you think it was drain to source like an N-channel fet ?

Look at the datasheet of a P-channel mosfet

See how all the voltages are negative ?
That means that if you are using negative voltages the input (for the negative voltage) would be the drain and the output (for the negative voltage) would be the source. Since you are NOT using negative voltages, the input is source and the output is the drain.
This is consistent with the attached photo:

pchannelpower-fig01-0509.jpg

The current direction arrow tells you that for the P-channel, the Source is biased positive with respect to the drain. (ie: source = +12V, drain = LOAD , as in an H-bridge)

So, I have used FDN340P as its a P-Channel MosFET. Drain to Vbat, Source to IN, Gate to VIN and the diode D1 is between VIN and IN of LDO to prohibit the back powering.

"Vbat " of what , the MCP73831 ? (if so , say so)
“IN” of what , the MCP1825 ? (if so , say so)

If the MCP1825 is supposed to be powered by the battery when USB is disconnected then the mosfet FDN340P is backwards. (Source should go to VBAT, Drain should go to “IN”)

Which direction is it going here ?
mosfet_H-BRIDGE.png

Hi, thanks for the response.

Why do you have a 1 k resistor in series with the gate ?

I have a little idea about the gate capacitance of a mosfet and read somewhere that it can create a parasitic inductance which can form an LC effect at the gate line. I also read Here that an resistor at the gate would help that. Therefore I have added the resistor at the gate. Though I think for steady DC operation it is not necessary.

Not sure what you are saying here:
Quote

When its unplugged from USB, the Gate will be pulled low through the 10k R3 resistor causing the mosfet to switch on. therefore, Vbat will be connected to IN of LDO and diode D1 will protect is from back powering the charger IC.

I’m not saying it is incorrect. That depends on what you think you are saying. I agree on the connections. What do expect the result to be ? (VBAT powers mcp1825 IN ? or IN charges battery ?)

yes, VBAT powers mcp1825 IN. I have rephrased my question. Please check it.
Btw, English is not my first language, apology for the lack of clarity. :slight_smile:

A P-channel conducts Source to Drain, so it will conduct from the IN pin to the battery,
not from the battery to the IN.

here I am confused.
I theoretically understand that it should be Source to Drain, but as i mentioned earlier that I got this idea from arduino uno’s automatic power switching, after reading this thread, i also checked the arduino uno’s schematic.
If I understand it correctly, here its also in the backward direction.
I hope, someone will explain that. This is really confusing to me. I don’t know if a mosfet can be bidirectional in terms of current flowing.

Okey, I try to state this in simple terms:

Case A: Circuit is powered from USB. VIN represents the 5V coming from VBUS line.
Goal: Supply VIN to MCP73 IC to charge the battery. Supply VIN to MCP1825 to get 3.3V on VOUT.

Case B: Circuit is disconnected from USB.
Goal: battery should power the MCP1825 which will be regulated at 3.3V volt on the VOUT pin. The battery voltage should be protected from back powering the Charger IC.

As you pointed out, the mosfet idea seems that i m on the right direction except the Drain-Source direction thing.

I also read Here that an resistor at the gate would help that

I am fairly certain they were talking about the switching speed of a mosfet used in dc motor controller where the charge time and discharge time of the gate capacitance affects the switching speed. Are you building a high speed switching dc motor controller ?

I don't have time to search for it. Quote it.

Does it make any difference whatsoever how long it takes for the fet to turn on and off when you are using it as a simple battery power switch where it only turns or off once in a great while ?

As you pointed out, the mosfet idea seems that i m on the right direction except the Drain-Source direction thing.

here I am confused. I theoretically understand that it should be Source to Drain, but as i mentioned earlier that

If that's true, then why did you write this ?

So, I have used FDN340P as its a P-Channel MosFET. Drain to Vbat, Source to IN, Gate to VIN and the diode D1 is between VIN and IN of LDO to prohibit the back powering.

If the Source is on VIN and the Drain is on VBAT, and the direction of current flow is from Source (VIN) to Drain (VBAT), how is the VIN supposed to get the battery voltage with the input on the drain and the output on the source ?

Explain to me how that is supposed to work .

The FDN340P in the arduino schematic appears to be backwards (compared to the fets in the basic mosfet bridge schematic)

I don't know why. Maybe someone else can explain that. Why don't you test it on the bench by soldering wirewrap wire to the top of the pins of the mosfet ? If it works backwards on the arduino it should work on your board. I really don't have an explanation for that. As far as I can tell , the drain is more positively biased than the source which does not match the direction of flow in the basic mosfet schematic. The datasheet shows max voltage Drain to Source = -20 V. That means that normally , the source would be more positive than the drain because "from Drain to source" means POS meter lead on Drain, NEG meter lead on source. Reading a negative voltage means the drain is negative with respect to the source. In the arduino schematic I would expect the fet to be the other way around. I don't why it is not. You'll need to consult a second source.

"Theoretically" (as you put it" a P-channel fet is used for negative voltages. Are you using negative voltages ? Did you read what I said about that ?

If you're confused, reread my post. I was very clear. You should not be confused. [u]Keep rereading[/u] it until you get it. There's nothing more to clarify.

If you have some small clips or a soldering iron, you can simply test the fet as shown in the arduino schematic, then again as I said it should be (source = input, drain = output ) . You can use 24 to 30 guage wire wrap wire soldered to the top of the pins. When you are finished testing it , you can simply wick off the solder with solder wick.