Sorry about the side conversation. You didn't find it interesting ?
Anyway, is 5v the power rail ? The circuit is at least unconventionally drawn.
Are these devices switched on occasionally, or are you using PWM, say to vary the brightness of a back light or similar ?
I'll try to simulate it for you if I can find equivalent parts.
Edit
That didn't last long. Can you attach the PDF data sheets for the mosfets. But I am already guessing that these are not logic level.
OK. I appear to have wrongly assumed from the labelling on the schematic that the Mosfets were early series International Rectifier parts with names IRF11 and IRF12.
I think then at least the labelling 5V and LCD_5V has been interchanged.
Both of the IRF7319 and AO4616 are out of spec if you are using 3.3 volt logic to switch them.
What is the important criteria for you? You've already mentioned ease of availability and footprint and 800mA.
I didn't see any PDFs of your schematics on your site.
i tried to use it in my main power switch, used ao4616, and it can turn on and off 5v fine. not sure if something happening in the electron flow. ;D also not sure it will turn on and off a 3v load with 3v in gate. and cutoff the battery line that is 2.8~4.2v with 3.3v
there is no criteria, simple switch that's all. no pwm fast switching.
It should switch a 3 volt load, assuming you use a PMOS such as AO3401 which has a reasonable Rds(on) rating quoted at 2.5volts. http://www.aosmd.com/pdfs/datasheet/AO3401.pdf There may also be even better ones.
However, it is not clear to me how you are going to connect the battery. I guess then that the system uses the battery by default, but if an external 5 volt source is available, then (a) the battery is disconnected from "5 volt" power rail and (b) is somehow connected to a charging circuit.
OK. I looked at the video. I think I have an overview of what you are doing. You have a developed a hand held platform based on a Raspberry Pi with screen, keyboard, battery, charging module and miscellaneous modules all in a custom printed housing. You have internal and external expansion ports for adding functionality including "Arduino" based modules.
Well, it is a great project and you have obviously put a lot of work into it. That is a very rich featured device. The video does help understand what you are doing. However, I have the following comments and areas where more explanation is necessary.
What I missed was a real overview at the start about the project, its goals, anticipated use cases etc. Then some better structured description of the feature list including that huge variety of modules. Maybe also a road map for further development.That has to be done in the form a block diagram (Powerpoint like), not simply a narative and at a higher level than simply schematics and board designs. Then I also missed the concept of how the modules are all to be integrated. Not at the hardware level. That is clear because you have the expansion ports. More at the software level for example the ESP32 module that you are working on here. Do you intend to write an RPi application which can display data and send keyboard commands to the ESP32 ?
That is the general stuff. Very specifically to your last question about the battery connection via mosfet. I see now there is an existing battery and charging module. I seems you want to be able to switch power to the ESP32 module. I would have imagined that there would have been some feature on the RPi where you would have selected the devices to be powered on and the Rpi would have managed the mosfet controlling power (OK RPi is also a 3.3 volt device so it is the same problem of high side switching). However, you have also included a link to a latch type circuit where a button is used to power up a device then, at the end of the session, the device it self breaks the latch to power down. So, concretely, how are you intending to manage the power up and power down of the ESP32 add on and what does the used do to switch on that module?
Goals are set internally by me and i try to reach it. That is because some things i can't do because there is no hobbyist parts or i don't know how to do it. (that high side switching is one of them i am trying to solve). so i don't bother to put up a goal that can't be reachable by me.
It use case depends on the users, i am just making the platform like ardinuo but different category.
esp32 controllers the keyboard and the system like truing on/off the modules and power and other things.
that switch in the battery is for turning on/off the pin that measure the battery voltage using the voltage divider. because that voltage divider consume power. so turn on the voltage divider when voltage is being measured.
that latching circuit to turn on the power of the whole device, that 5v line goes to pi+esp(cover to 3v) and expansion.
there is buttons in the keyboard that power off the device/ expansion and 2 modules are in the main PCB. this is done by the esp32 not the pi.
The block diagram by Cyril Hrubis, which you've just linked to, makes the situation much clearer.
OK. So the mosfet P1 can be replaced with a simple high side switch circuit adding a resistor and NPN transitor. The program logic has to be changed because the switch is now ON when the ESP32 pin is HIGH. For P2 you have to show the voltage divider that is now necessary because the ESP32 pins are tolerant only up to 3.3volts. N1 would probably be better as an NPN transistor. It needs a base resistor, say 4.7k but does not need a base pull down resistor. P3 can probably stay the same.
I'm assuming that RTC Wakeup part currently works.
It looks like the mt3608 step up running all the time. Is that correct ?
With ESPs, unlike the Micro, you have to be much more careful in your choice of pins to avoid interfering with the boot process etc.
One thing it might benefit from is a printed keyboard to replace the individual buttons.
Okay, as you are clear with the circuit now come to the part selection.
How you suggested parts i need 3 different verity of parts plus 2 more switch(for v4) and have to solder them in the PCB. And that i can't do. too many parts make the project hard to build and parts are not flexible to replace with other model. I am saying this as the project is tend to made by hobbyist and we have to order those different kind of parts from different seller and that make the building cost higher. Also one r 2 parts won't be available in all the countries.
So if possible i want to use same mosfet, if possible duel P+N mosfet that i am already using (ao4616) in everywhere, so easy to replace with other model and less costly to order as they will be in bulk.
if i use 2 different kind of mosfet and transistor i will get a nice circuit but people tend to not build it. as those parts are needed 1or 2 each and the shipping cost is separate for each.
I tried not to go this way to explain all this things, so i was acting stubborn .
Just to start with, can you answer these questions based on Block schematic 1 above:
I'm assuming that RTC Wakeup part currently works with the ESP32. It appears to have no dependencies on the change from the "Micro" design Is that correct ?
It looks like the mt3608 step up running all the time. Is that correct ?
Show how you are configuring the voltage divider which P2 is going to switch.
Does that power on latch circuit consisting of N1 and P3 currently appear to work with an ESP32 (or haven't you tried it) ?
Anyway, if you are switching 3.3v with a 3.3 volt pin, you can use a single PMOS as you have been. It is best to use a mosfet which has a reasonably low RDS(on) at 3.3 volts. If you must use an existing mosfet which does not correspond with this, then test under maximum load conditions that everything works and the mosfet does not get too hot.
If you want to switch 5v with a 3.3v pin, the best solution is the simple switch (post #44). If a minimal increase in the parts count is very important, you can try a single PMOS and the series 2.4v zener diode solution from post #38. (A yellow LED could also function as a 2.4volt zener) However, again, this is a compromise and you have to test it, including under maximum load conditions.
i did not tested rtc in esp onee. but it worked on micro one.
that charging circuit is always running,,as the device need to charge when the device is off. i am using a new module called MHCD42 that handles charging and boosting so less parts are needed on v4
see the below pic
latch circuit is working fine with esp 3v pin, maybe because the mosfet is logic level. and to be clear that mosfet is dual one not separate , so that p and n mosfet in same package.
that's why i am saying to use that same latching circuit with logic level mosfet on other switch. i tested that latching circuit to turn on/off 5v and 3v load and it works.
so my question is if i use that latching circuit with logic level mosfet to turn on/off 3v, 5v and 2.7~4.2v for battery will there be any issue like leakage charge or issues that i don't know of?
and please see the below block that is for v4.
and that latching circuit using this logic level mosfet ao4616 that i tested the circuit with, i mean turn on/off 5v and 3v load and it works
In principle, if you have tested something and it works. although not fully in spec, then you may get away with it.
That applies also to the high side switch made out of both halves of the AO4616 and the latch circuit to control the power to the entire device.
That voltage divider to measure the battery voltage will always be a load on the battery. I thought you were intending to switch the voltage divider on with a PMOS at its positive battery connection. The middle of the voltage divider can go directly to the analog pin which does the voltage measurement. It is not clear from your diagram which is the measuring point.
You still have some labels interchanged in your diagrams, for example in the circuit with the two mosfets IRF21 and IRF22, the labels 5V and LCD_5V have been wrongly interchanged.
I can't see that the battery voltage 2.7~4.2v is relevant here because, according to the diagram Block schematic 1, there is a permanently connected Stepup (boost converter) with no enable pin connected (as far as I see). Or are you using some feature of the MHCD42 module you've mentioned.
so i am going with AO4616. do have any other mosfet to replace it incase it is no longer abvilable?
yes, i am intending to switch the voltage divider on with a PMO, and as i see it should work. you can see the diagram below and please let me know if it will work or not. also i am not sure if the voltage divider will be a significant load so i have to use a switch to turn it off when it's not in use. can you shade some light on this?
Ohh my god. thanks a lot, i fixed it.
that battery voltage 2.7~4.2v is relevant for the voltage divider circuit. as the voltage will be half of the actual voltage of the battery so i am concerned if the switch will work or not.
please see the latest circuit and let me know if the switches, voltage divider, and other parts are ok or not.
For a possible substitute for the AO4616 you simply have to look at say Mouser.com and search for the important characteristics that have already been mentioned in this thread, also that these fit your budget and are available locally.
I see now how you intend to wire the battery voltage measuring circuit. You seem to accept about a 20uA permanent drain on the battery with your 200k voltage divider network so you may as well connect the centre point of the voltage divider directly to the chosen ADC pin of the ESP32. There is probably anyway little point in making the voltage divider switchable with the mosfets you are using which have anyway a source drain leakage current of not that much less.
Your high side switches look OK, at least from the labelling. It is normal practice, though, to put a surge current limiting resistor between the ESP32 pin and a mosfet gate (say 100 ohms for a 40mA pin at 3.3 volt).
The latch circuit consisting of mosfets IRF73191 and IRF73192 seems to have got a bit more elaborate and the labelling of OUT+ and 5V seems odd.
Anyway, test everything, particularly the new things which have come as a result of replacing the 5v micro with a 3.3v ESP32, including quiescent current consumption, before committing your final design and good luck with it.
I will ditch the switch for the voltage measurement circuit. I connected the voltage divider directly to esp.
Those labeling is made by the eagle auto. app added number after the name so it looks like that.
I also thought about the surge current protract resistor. abut again thought same as the switch for the vlotage divider. As there is not much current flowing through the mosfet that i really need those resistor. But let me know what you think.