I am using ESP32. I have made an H bridge with MOSFETs and I am planning to run a 6V latching solenoid with this bridge. Briefly, latching solenoid; It opens when 12ms +6V is applied, and closes when 12ms -6V is applied. I am sharing the image of the H bridge I designed below.
I mounted the schematic in the image on the breadboard. Unlike the MOSFETS in the image; I used IRF9640 as P channel MOSFET and IRFZ44N as N channel MOSFET.
I can't switch P channel MOSFET with ESP32. I apply 3.3V to the Gate, but I cannot stop the voltage flow between Drain and Source. I also tested the same H bridge with Arduino UNO and it worked fine. When I apply 5V to the Gate, I can switch quickly. Is there a way to switch these mosfets with ESP32? so how can I switch by applying 3.3V to the Gate?
I shared an image from the datasheet of p channel mosfet below. What does the Vgs threshold values mean here? What I want to ask is, in which part of the datasheet is the information on minimum how much Volt should be applied to the Gate in order for this mosfet to switch?
The threshold voltage is the gate voltage at which the mosfet just begins to conduct. It varies from part to part. In the case of your two mosfets, it can range from a minimum of 2V to a maximum of 4V. You have to apply gate voltage well above the threshold to turn the mosfet fully on. Generally, when you are switching mosfets with 3.3V signals, you would use a "logic level" mosfet, which would have a typical threshold voltage of about 1V.
But the question I have is what is "Vcc" when you are using the ESP32? I assume it is 5V when using the Uno, but is it still 5V when you switch to the ESP32? If so, then the gate/source voltage is 1.7V when the gate voltage is 3.3V. That shouldn't be enough to leave the P-channel on, but apparently it is.
If Vcc will be 3.3V, then you probably need different mosfets to make sure they turn fully on and off. But if it's 5V or higher, then I think you can make it work by adding transistors to the ESP32 GPIO outputs so the gate voltage will swing from rail to rail.
Edit: This is what the right half of the circuit might look like:
It's the minimal voltage where the MOSFET starts conducting, higher voltage determines the possible drain current according to the Forward Conductance. It's a very unspecific limit by construction, varying widely amongst items of the same series.
For your project you can study the circuits of working H-bridges, how they shift low logic levels to effective gate voltages.
You will have what is called shoot through when you switch. What that is that both the upper and lower MOSFET turn on at the same time. Look at the Vgs of each of the MOSFETs. You will find a point where both are on during the switching transition from low to high to low. This causes a lot of heating and can blow MOSFETs. The higher the VCC and/or the resistance of R4 the worse it will get. Gates are capacitive.
It seems you have forgotten that the gate of Q3 and Q4 must be 8-10volt higher than their source/drains. If VCC is 6volt, then the gate pulse on A or B must be >14volt.
Leo..
Ok. thank you. Also I am planning to order logic level MOSFET instead of Power MOSFETs. So I won't need to add 2 extra mosfets or transistors to the schematic.
You haven't said what voltage you have on VCC. If VCC is 3.3V, then you may be able to drive each mosfet directly from a GPIO pin. But if VCC is higher, then you may have the same problem you described in the original post. In fact, it may be worse using logic level mosfets.
If VCC is 6V, then if you drive the gates with 3.3V, you won't be able to turn off the P-channel mosfets. The G/S voltage will be 6 - 3.3 = 2.7V, which is still way above the threshold voltage. So the P-channel mosfet will stay on when you are trying to turn it off. You will need the extra transistor as shown in my circuit, or something similar. And I don't think you gain anything using logic level mosfets for the H-bridge.
Thank you very much for your explanation. It was very informative for me, I want to ask one last thing. While researching on the internet, I found DIODE brand DMP3098L P channel MOSFET. When I examine the datasheet, the threshold values are as follows;
With a source voltage of 6 V a gate voltage of at least 6-1 = 5 V is required to turn the MOSFET off.
2.7 V from GND will mean 6-2.7 = 3.3 V minimum Vgs. You need a FET that is guaranteed off with that voltage, and sufficiently on with the full swing of 6 V.
The only way to reliably turn the mosfet on and off is to drive the gate to 6V or ground, or nearly so. Then, I think mosfets with higher threshold voltages, like your original ones, will produce less shoot-through current. There's just no way to make it work if you drive the gate directly with GPIO output (3.3V or ground). So you need the extra transistor to do the translation.