P Channel MOSTFET Question

Hey guys,

I've got a question regarding P channel MOSFETs

The one I've bought is the following

For my project I want to turn on and off a TP4056 18650 charger module. Unfortunately I can't use a N channel MOSFET as I believe the grounds are tied together.

Can I use this MOSFET without needing another transistor? Bearing in mind the Source voltage is also 5v.

Or is there a simpler way I could do this?

Any help would be greatly appreciated.

Hi,

If as you say the supply you are switching is 5V, then it is possible, the P-CH MOSFET you have is logic level so it should switch fully ON.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Here's a circuit diagram as requested.

Pin 1 and 2 are digital IO pins and A0 and A1 are analog.

The project is to make a tester which will charge the battery up. Once charged it will then discharge the battery until its flat, display the capacity in mAh then charge it back up again.

If an Arduino pin is controlling the MOS FET, add a 220Ω resistor in series with the gate.
See Q8.
See examples in the attached image.

Also, there is nothing wrong in using a relay in an application like this.

Cool that makes sense.

Will have a bit more of a play around tonight. The code works, it currently was only getting about 4.5 to 4.8v through which isn't enough to properly power the TP4056 module to charge correctly.

Hi Basstrom,

You also need to rearrange the Rshunt so its in the source of the FET. As currently drawn the A0 input (and likely A1) will be above the 5+ of the arduino. Will not work and likely toast the arduino.

In a Mosfet the gate current is essentially zero. So Rshunt in the source will keep it below the 5+ supply without introducing circuit current errors.

A suggestion when drawing schematics. Never make a +(cross) connection. If you moved the A0 line so it did not line up with the B+ line there would be no question if it was connected or just crossed lines.

Good luck

John

Thanks for the reply John.

The batteries I'm using at 18650 cells that are 4.2v max which is below the tolerances of the Analog Input.

The cross connection is meant to be there, as it needs to charge the battery but also read the voltage of the battery when the charger is off. Charger puts out a maximum of 4.2v as well.

The Rshunt is a very low resistance resistor, 0.5ohm and the Rload is a 3ohm resistor. Which would make the current draw 1.2 amps at most.

I hope this clears up why I've done it this way. If it's still incorrect I'm open to suggestions haha

Basstrom:
For my project I want to turn on and off a TP4056 18650 charger module.

The TP4056 has a CE (chip enable) pin.
Can't you use that to switch the chip on/off.
Leo..

Hmmmm didn't think of it that. It is the cheap eBay boards that I'm using, not the individual chip itself. So it's theoretically possible.

Hi,
This may be of help.
www.electroschematics.com/10551/tp4056-lipo-battery-charger-rc-toys/

Tom... :slight_smile:

TomGeorge:
Hi,
This may be of help.
www.electroschematics.com/10551/tp4056-lipo-battery-charger-rc-toys/

Tom... :slight_smile:

Not sure, I want it to be all automated without having to plug and unplug the module. Those are the same ones that I've got from eBay though.

About to have a play around with it now and will report back :slight_smile:

So had a play around last night with it.

I've decided to go down the route of detecting when the charge pin on the chip is pulled low to detect when the cell is charged. This would then turn the module off and start the discharge cycle.

The logic goes something like this.

Wait until a cell is inserted into the holder. If the cell voltage is above a minimum then turn on the module (P Channel MOSFET) and start charging.

Once the chips charged pin is pulled low turn off the charger and turn on the discharge circuit with the N Channel MOSFET. Display the mAh reading from calculations done with the shunt and load resistors.

Once the cell has hit its minimum voltage then turn off to the discharge part and turn the charger back on. Wait until charged and display on screen charged and the mAh for that cell.

Rinse and repeat for all cells to be tested.

Thanks larryd for that schematic. It worked perfectly.

Thanks to everyone for your input.

I'm planning on using an ATmega1248 on a protoboard for the final part and will post up my schematics and sketch for anyone interested in doing the same thing.

Amazing helpful community here, thank you so much.

One thing that may not be obvious but worth being aware of is that that MOSFET has an absolute
max gate-source voltage of +/-8V, which means it is not intended for > 5V operation (its really
designed for modern logic, ie less than 5V), and you'd better ensure your 5V rail is clean without
voltage spikes to avoid the possibility of blowing the gate-oxide on the MOSFET. So I'd suggest
having a reasonable amount of decoupling capacitance on your 5V rail close to the MOSFET.