latching push-button controlled MOSFET switch with IRF7319 - Page 1
Forum section: electronics / projects

author: luca0074
author_rank: Contributor
timestamp: September 10, 2021, 10:52:47 am
content: Hello allI have integrated the "soft power switch" from Sparkfun (https://cdn.sparkfun.com/assets/5/6/6/6/0/SparkFun_Soft_Power_Switch.pdf) in my handheld device.Due to the unavailability of the SIL2308, I used the IRF7319TRPBF as in the original design (http://www.mosaic-industries.com/embedded-systems/microcontroller-projects/raspberry-pi/on-off-power-controller).Here is the schematic of my implementation:I have the following problem:I can only switch on the device via S1 (or ON_BUTTON_EXT) if I have vBus > 4.4V.Is this due to the IRF7319TRPBF used (https://www.mouser.ch/datasheet/2/196/Infineon_IRF7319_DataSheet_v01_01_EN-1228230.pdf) or is there another cause of the problem?Is there an easy fix for the problem?Thanks for your help!Greetings Luca

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 10, 2021, 03:44:17 pm
content: No. The problem is not due to the IRF7319TRPBF.Try, in the following order:1. increase value of C3 between R14 and R15 from 0.1uF to 1uF, then retest, if still fails, then keeping C3 at 1uF, do2. increase value of C5 from 10uF to 22uF.

author: luca0074
author_rank: Contributor
timestamp: September 11, 2021, 11:45:12 am
content: Quote from: eblc1388 on September 10, 2021, 03:44:17 pmHi eblc, thanks for your suggestions!1. didn't work.2. this just made the time longer that is needed for shutdown the device.

author: Peabody
author_rank: Super Contributor
timestamp: September 11, 2021, 02:51:35 pm
content: The threshold voltage of the SIL2308 has a minimum of 0.5V and a maximum of 1V. But the IRF part has a minimum of 1.0V, with no maximum shown. So maybe that difference is enough to make it not operate properly at low voltages.Would the processor power up fast enough that it could turn on the N-channel and keep the power on with just a brief button press? If so, you could move all the latching stuff into the processor and greatly simply the circuit.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 12, 2021, 08:22:04 am
content: This type of circuits behave heavily on the nature of the connected load. Most hated load with large capacitor connected.Can you also confirm the circuit does not work even if no output load is connected? This might point to a different approach in modifying the component values.

author: luca0074
author_rank: Contributor
timestamp: September 12, 2021, 09:06:04 am
content: Quote from: Peabody on September 11, 2021, 02:51:35 pmThanks for checking!Quote from: Peabody on September 11, 2021, 02:51:35 pmi wanted a solution, where i can disconnect the power via hardware completely, in case of bad programming of the microprocessor.Quote from: eblc1388 on September 12, 2021, 08:22:04 ami have total 11.2uf capacitance on vcc. there is only my regulator.the starting current is @5V 120mA. running current is @5V 100mA.i disconnected the load; the circuit doesn't work below 4.4V.

author: Peabody
author_rank: Super Contributor
timestamp: September 12, 2021, 02:46:21 pm
content: Do you have a scope? It would be good to know whether the p-fet turns fully on when you press the button. In other words, what exactly isn't working? Is the p-fet not turning on at all, or is the p-fet turning on but the n-fet isn't?Well, I think the problem almost has to be the different threshold voltages versus the original design mosfets. It's possible that playing with the capacitor and/or resistor values could get it to work at lower voltages, but in the end you may need to use discrete mosfets with the right threshold voltages, if you can find them. Still, it seems like there ought to be a way to make it work with 3.7V input.Edit: If you start it up at 4.4V or more, then lower the input voltage, at what input voltage does it turn off?Edit2: This may be crazy, but I wonder if replacing the n-fet with an NPN might make it work. Well, that would be a different circuit. Anyway, I just wondered.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 12, 2021, 03:59:25 pm
content: Quote from: luca0074 on September 12, 2021, 09:06:04 amI did a simulation of your actual circuit, using 1uF and 22uF as stated above. I have chosen PMOS and NMOS with Vth=1V to match with IRF7319TRPBF and an external load consists of 10R and 47uF in parallel. After power is applied, a switch is close at time=2 and released a second later.The simulation results show that the circuit can work down to 2.3V or lower. This indicates that the IRF7319TRPBF will most likely works without problem. You may have errors in pin connections or have defective components.

author: Peabody
author_rank: Super Contributor
timestamp: September 12, 2021, 09:08:45 pm
content: Would it be possible to run the simulation with mosfets having Vth of 2V? If that simulation still works well below 4.4V, then the OP may have some other problem.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 13, 2021, 05:57:01 am
content: Quote from: Peabody on September 12, 2021, 09:08:45 pmIn simulation with mosfets having Vth of 2V, the circuit won't work for Vin=2.3V. It works OK with Vin=2.5V or more.

author: luca0074
author_rank: Contributor
timestamp: September 13, 2021, 09:29:52 am
content: Quote from: Peabody on September 12, 2021, 02:46:21 pmSadly i dont have a scope, but i could measure with a multimeterI have a PowerProfilerKit2, where i could measure up to 8 digital signals. where should i measure what?Quote from: Peabody on September 12, 2021, 02:46:21 pmIt turns off at 2.8V.Quote from: eblc1388 on September 12, 2021, 03:59:25 pmCool! Thanks for sharing the .asc file!Quote from: eblc1388 on September 12, 2021, 03:59:25 pmI have 4 assembled devices here and all show the same fault behaviour.Maybe i made a mistake with the pcb design?

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 13, 2021, 12:10:34 pm
content: Quote from: luca0074 on September 13, 2021, 09:29:52 amThe cut off voltage should be a lot lower.I did the simulation with Vin at 4.4V and start decreasing at time=6s to see when the circuit will turns off. It did so at about 1.5V. The orange curve is the NMOS gate voltage during the voltage drop test.Please repeat the same voltage dropping test starting at Vin=4.4V, then at 4.2, 4.0, 3.8..., decrease Vin at 0.2V interval and record the NMOS gate voltage(pin2 of the IC) until the circuit cut off. Post back the results.

author: luca0074
author_rank: Contributor
timestamp: September 13, 2021, 01:36:35 pm
content: Quote from: eblc1388 on September 13, 2021, 12:10:34 pmI did the measurements, but i have very different results.MeasurmentVBUS 3.3V_EN (NMOS GATE) 15.02.3124.92.2834.82.2744.72.2654.62.2564.52.2474.42.2384.32.2294.22.2104.12.2114.02.18123.92.17133.82.15143.72.14153.62.13163.52.1173.42.1183.32.1193.22.05203.12213.01.98222.91.95232.81.93242.71.92252.60262.50272.40282.30292.20302.103120321.90331.80341.70351.60361.50

author: Peabody
author_rank: Super Contributor
timestamp: September 13, 2021, 02:37:40 pm
content: Could you also measure Vcc at a few of these points? Maybe I don't understand the circuit, but it seems that at VBUS of 5V, the gate should be at the zener voltage, which should be 3.3V. Why is it lower?Edit: Ok, it may be your meter dragging it down. Instead of measuring the gate voltage, try measuring the intersection of the 10K, 300K and zener.

author: luca0074
author_rank: Contributor
timestamp: September 13, 2021, 03:56:23 pm
content: Quote from: Peabody on September 13, 2021, 02:37:40 pmI measured at VCC and POWERSENSE to GND. The measured values are practically the same...Maybe I choose the false Zenerdiode?I choose MM3Z3V3T1Ghttps://media.digikey.com/pdf/Data%20Sheets/ON%20Semiconductor%20PDFs/MM3ZyyyT1G_SZMM3ZyyyT1G_Series_rev.11_Sep2014.pdfIt has the correct Device Marking (05) on it.

author: Peabody
author_rank: Super Contributor
timestamp: September 13, 2021, 04:47:27 pm
content: The zener value is only valid at a specified minimum current, which you are probably well below. So it will pass some current at a lower voltage. As long as nothing is connected to 3.3V_EN or POWERSENSE, you could remove the zener and see if everything works better. But if you really want this to work from 3.3V to 12V, you're going to need the zener to prevent high voltage from reaching the processor I/O pins.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 13, 2021, 06:39:13 pm
content: Judging from the results, it is probably caused by the zener diode not getting sufficient rated current via R13(10K). The zener voltage will drops quite a lot from the rated voltage under this condition.You have one of five possible choices.1. Change one end of resistor R13 from connecting to VCC(input of the 3V3 regulator) into connect it to output of the 3V3 regulator instead. This will ensure the gate of the NMOS be supplied by 3.3V even the Vin falls from 4.4V to 3.5V.2. Put in series a silicon diode like 1N4148 with the 3V3 zener. The diode's 0.65V drop will add to the current 2.31V drop to a total voltage drop of around 3V which enable your circuit to work below VBus of 4.4V, hopefully at min. 3.8V.3. Lower the value of R13 from 10K to somewhere between 1K~330R. This would gives 5mA zener current when Vin=5V if R13=340R but higher value reduces power dissipation in zener diode. The calculation for R13 is (5V-3.3V)/5mA = 340R.4. Use a higher voltage zener diode, e.g. 3V9 instead of 3V3. With R13=10K ~ 1K, this would hopefully gives 3.3V when Vin=5V.5. Use a 3.3V reference diode to replace the zener diode,e.g. the ZRC330 by DIODE INC. The ZRC330 is a two terminal device in SOT23 package and will give 3.3V with forward current from 20uA~25mA. However, this is the most expensive option.ps. edited: added three more options for a possible solution. Corrected mistake in calculation of R13 value.

author: Peabody
author_rank: Super Contributor
timestamp: September 13, 2021, 10:14:23 pm
content: The problem is it has to work at both 3.3V and 12V. So if you tweak it so it works at 3.3V, the voltage may be too high at 12V because the zener will actually produce a 3.3V drop, or 3.9V.I wonder if a white LED (about 2.7V drop) in place of the zener would give a sharper knee. Or a white LED in series with a regular signal diode (1N4148) to give about 3.3V in total.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 14, 2021, 06:31:29 am
content: Quote from: Peabody on September 13, 2021, 10:14:23 pmWhy does it has to work at 12V?The OP's circuit in reply#5 clearly shown a regulator with Vin of max. 6V.

author: luca0074
author_rank: Contributor
timestamp: September 14, 2021, 09:24:46 am
content: Quote from: eblc1388 on September 14, 2021, 06:31:29 amSorry, it has only to work up to 5.5V. (Powered via 5V USB)Quote from: eblc1388 on September 13, 2021, 06:39:13 pmThanks for all the choices!i choose number 3, because i can fix that with just a change in the BOM.The Voltage on POWERSENSE, when the Device is ON is with R13=48Ohm @ 5V now at 3.9V. With R13=10kOhm @ 5V it is at 2.3V (see attachment in Reply #14).Sadly it dosn't fix the issue. Also id would be >3.3V and could damage my microcontroller; with 10k it would be sufficient for a logic High on most controllers.EDIT: The following informations are false, because I measured wrong. see the correct measurements in Reply #22I dig a little deeper and recorded the current consumption of the device in state OFF. I discovered a hysteresis on the issue.when VCC goes under 4.3V the current goes from 65uA up to a average of 1-2mA with 15mA peaks, till VCC is again greater than 4.8V.The device can only be turned on, when the current is at the low value (65uA).(i measured with R13=48 and also R13=10k. The results are the same)also shouldn't the current consumption overall not be much smaller? or is my measurement not precise enough for that little currents?Quote from:https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2:Quote

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 14, 2021, 10:15:22 am
content: Quote from: luca0074 on September 14, 2021, 09:24:46 amSorry. My bad.R13 value should be (5V-3.3V)/5mA but I mistakenly used 0.05 as the divisor instead of 5mA. Therefore the correct value of R13 for 5V should be 340R or more.I cannot see any reason why the supply current will increase with the decrease of Vin. When the circuit is OFF, it should consume no current. Are you referring to the 3.3V microcontroller consumption only instead of this power On/OFF circuit? Have you follow the instructions on how to setup the power profiler to measure current? You need an extra 5V supply to power up the device in order to measure its current consumption. The power profiler cannot be both the source and as a current meter.

author: jfiresto
author_rank: Frequent Contributor
timestamp: September 14, 2021, 10:28:16 am
content: Quote from: Peabody on September 13, 2021, 10:14:23 pmI am not sure where, but I came across the attached current vs. voltage curves for a blue LED over a wide range of currents and temperatures. Perhaps they might help address your question.

author: luca0074
author_rank: Contributor
timestamp: September 14, 2021, 12:53:39 pm
content: Quote from: eblc1388 on September 14, 2021, 10:15:22 am320Ohm works perfect! now it looks much more as in your simulation.Quote from: eblc1388 on September 14, 2021, 10:15:22 amSorry. My bad.next time I rtfmThe current draw looks now better. 1uA@5V and 100nA@4Vbut i still can't turn on the device below VCC of 4.4V

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 14, 2021, 04:14:30 pm
content: Quote from: luca0074 on September 14, 2021, 12:53:39 pmIf that is the case, there must be some loading pulling down on the "3.3V_EN" and/or "POWERSENSE" connections. This is possible as the MCU had no supply voltage yet and the above two signal pins could be powering up the MCU via port pin internal diodes. This affect the operation of power On/Off circuit badly.A good circuit designer should make sure this situation could not happen, i.e. there must be no loading on these two signal pins until the MCU has properly powered up, reset and running.

author: Peabody
author_rank: Super Contributor
timestamp: September 14, 2021, 05:12:56 pm
content: If VBUS is, say, 4V, and you press the button, the first thing that has to happen is the P-fet turns on. Is that happening? If you put your meter on Vcc, do you get any kind of blip when you push the button?"A scope! A scope! My kingdom for a scope!" - Richard III

author: luca0074
author_rank: Contributor
timestamp: September 14, 2021, 08:01:34 pm
content: Quote from: eblc1388 on September 14, 2021, 04:14:30 pmI tested the circuit without a mcu. i have a micromod connector on my board. i will use the SAMD51 Processor boardhttps://www.sparkfun.com/products/16791Quote from: Peabody on September 14, 2021, 05:12:56 pmI will have access to a scope tomorrow.then i can check.

author: luca0074
author_rank: Contributor
timestamp: September 15, 2021, 06:33:32 pm
content: i made some measurements with a scope.These were my measuring points:With the scope the circuit worked down to 3.75V. Without the scope as before to 4.4V

author: luca0074
author_rank: Contributor
timestamp: September 15, 2021, 06:35:54 pm
content: more screenshots:

author: luca0074
author_rank: Contributor
timestamp: September 15, 2021, 07:10:44 pm
content: in the first 5us there is some contact bouncing (or another phenomena)but i dont think this should affect my circuit.

author: Peabody
author_rank: Super Contributor
timestamp: September 15, 2021, 11:39:28 pm
content: No, it's oscillating. I don't know if that matters in this case.Looking at the scope displays, the P-fet gate (the blue line) just drops part of the way to ground when the switch is closed. Then it drops all the way when the N-fet turns on. But as the input voltage is reduced, the GS voltage during the first knee gets closer to the threshold voltage, and the response is delayed because the P-fet just isn't turning on as fully. Then finally, when the input voltage is low enough, the threshold voltage isn't met at all, and the P-fet never turns on. Which means the N-fet never turns on.Also, it seems odd that the level of the first knee on that blue line doesn't vary more with the input voltage. In any case, increasing the capacitor value should lower the knee level. But I don't know why the circuit doesn't behave more like the simulation, or only does so when the scope probes are attached.

author: Peabody
author_rank: Super Contributor
timestamp: September 16, 2021, 12:29:34 am
content: Ok, I think the knee on the blue line occurs because the P-fet gate is in the middle of a capacitive voltage divider made up of C3 and C4. So when you close the On switch, the voltage only goes half way to ground. In theory, this could be improved by increasing the value of C3, or decreasing the value of C4, or both. But I would first try reducing C4 to a very small value. I think it might work for its intended purpose on as little as 20pF. You could test what effect this would have by temporarily removing C4 altogether, and see what your scope displays look like then.

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 16, 2021, 10:24:12 am
content: Quote from: luca0074 on September 15, 2021, 06:33:32 pmThere is something not quite right about the traces. With a normal circuit, when the whole circuit is in the OFF state, the red and blue trace should have the same potential(voltage). I even perform a simulation and indeed the two voltages are found to be the same.You would need to resolve this situation (or find out why) before your circuit will operate correctly. It is possible that the scope probes has too low an impedance but this type of measurement should only be carried out with a normal X10 probe to avoid the probe's impedance affecting the circuit performance and measurement results. What kinds of scope probes are you using for the measurement?

author: Peabody
author_rank: Super Contributor
timestamp: September 16, 2021, 04:29:57 pm
content: Assuming the actual circuit is the same as the schematic, then the difference in the red and blue voltages when the power is off could also be caused by a leak of a few uAs through the N-fet to ground. In that case, he would get the same difference when measuring the voltage with a multimeter, and there would be a voltage differential across the 100K resistor, indicating that current is flowing through it.

author: Peabody
author_rank: Super Contributor
timestamp: September 19, 2021, 02:24:43 pm
content: Looks like the OP has lost interest. I was hoping we would get to a solution on this circuit, but I guess not.

author: luca0074
author_rank: Contributor
timestamp: September 20, 2021, 11:34:22 am
content: Quote from: Peabody on September 19, 2021, 02:24:43 pmI have allowed myself a few days holidayof course i want to find out what is wrong with my circuit.Also I amincredibly gratefulto you and also to eblc1388 for the thought, time and effort you put into troubleshooting!so... Thank you!Quote from: eblc1388 on September 16, 2021, 10:24:12 amI use a PicoScope 4824A.https://www.picotech.com/download/datasheets/picoscope-4824-data-sheet-de.pdfQuote from: eblc1388 on September 16, 2021, 10:24:12 amMaybe thats also a problem. I just have very long long BNC to banana plug cables.Quote from: Peabody on September 16, 2021, 12:29:34 amI cut open AUTOON, so C4 isn't connected to anything.The knee is gone, andthe circuit works as intended!(even without the scope attached)Quote from: Peabody on September 16, 2021, 12:29:34 amI don't have any pf caps lying around to test with such a small capacity. Is there a need for a capacitor at C4?

author: eblc1388
author_rank: Frequent Contributor
timestamp: September 20, 2021, 12:26:54 pm
content: Quote from: luca0074 on September 20, 2021, 11:34:22 amI'm glad you've finally get the circuit running OK. If you remove C4 (AutoON), then the operation of your circuit is unpredictable. It might turns ON upon power Up without user pressing any button.The Picoscope has an input impedance of 1Mohm, when used directly as an input. This is way too low for measuring this circuit. You need to use a proper probe which allows x1 and x10 selection. When the X10 range is selected, your probe will have an impedance of 10Mohm, which only slightly loaded the signal your are measuring. You'll need some probes like the following:

author: Peabody
author_rank: Super Contributor
timestamp: September 20, 2021, 03:10:48 pm
content: C4 only matters when you first connect power to the circuit. It's there to make sure the P-fet doesn't turn on automatically when power is applied. But it may not do that even without C4. You would have to test it a few times after leaving power disconnected for several minutes to make sure all the caps have discharged. And in the worst case, if it turns on when power is applied, you can always just turn it off by holding down the button long enough.But it doesn't have to be 20pF. If it's 0.1uF now, you might try 0.01uF if you have one of those. That would be cutting the capacitance by 90%, which may give you more than enough low-voltage performance.