Hey, I´ve run into a problem. As you can see on the picture I´ve tried 2 circuit scenarios. In the 2nd scenario everything works perfectly and the motor spins at full speed. However when I put the motor between the 2 MOSFETs it spins only very slow and the MOSFET with the red ring around it gets very hot, like it´s not fully switched on.
I don´t understand why this is the case and how can I solve it?
(Sorry for the bad sketch) and thanks for your help!

in circuit 1, replace the top N-channel mosfet with an equivalent P channel mosfet.

Why 2 MOSFETs?
Vcc = 5V? If so, are you using Logic Level MOSFETs? Standard MOSFETs need 10V on the Gate to turn full on. Logic Level MOSFETs have lower Gate levels.

yes, these are logic-level MOSFETs with a threshold-voltage of 2.2 volts. @ 4.4 volts they are basically fully on and as you can see in circuit 2 it works perfectly, only when I put the motor between those 2 these problems occur. I´m building an h-bridge :slight_smile:

But if I replace the top MOSFET in circuit (1) with a p-channel MOSFET, I can´t control it anymore, since p-channel MOSFETs need opposite polarity and the Arduino can only apply positve voltage, am I right?

The gate switch on isn't 2.2V above ground, it is 2.2V above the drain voltage. You have a motor in there which will have a non zero voltage across it.

So, can I solve this issue by a p-channel MOSFET with the same specs, ony an inverted voltage on top in circuit (1)?

The "opposite" logic level will turn the p-channel mosfet on. FYI: Pchannel devices often show negative voltages in the datasheet. This is somewhat misleading,3 but is that way due to the historical way PNP transistors were shown. Basically, PNP (or p channel) devices work inversely and do not require negative polarity to work. The datasheet really just shows which pins need to be "more" positive... to work correctly.

Yeah, but the Arduino only can provide 1 polarity, so would it work if I just replace the top n-channel MOSFET with a p-channel one and provide the same voltage (+5V) on both gates (n- and p-channel)?

You would drive the N-channel to logic 1 to turn it on... and the P-channel to logic "0" to turn it on.

Yes, as long as you are only switching 5V thru the motor.

over the source and drain of the MOSFETs 8.4 volts should be applied. I use 5 volts to switch them. why does it work only as long as I switch 5 volts through the motor?

The gate of the P-channel MOSFET needs to go to 8.4V to turn it off. You can use an NPN or another N-chanel FET to pull it low, with a 1K resistor to pull it up to 8.4V to turn it off.

  1. Don't power the motor and Arduino from the same supply rail. This means that its
    unlikely the simple p-channel circuit will work reliably as the motor voltage might be more
    than the 5V of the Arduino - solution is add a level-shifter (typically an NPN transistor)
    to drive the p-channel gate.

  2. p-channel is the mirror image of n-channel, its simple once you understand that.

  3. The best way to do an H-bridge is use high-low MOSFET driver and two n-channel
    devices - then the motor voltage can be completely independent of the Arduino, but this
    does require a 12V supply for the MOSFET driver(s), which might be a pain. For an
    example look for the datasheet to the HIP4081

Half-H bridge design

Is there an easier way how I can just spin a dc motor in 2 directions, which I can realize only with n-channel MOSFETs?

Not really.

hey lads! well, thanks very much for all your suggestions, based on them I thought about a schematic. would this work.

Below is an old discussion (there have been others too) on making a DIY H-bridge that might show some of the issues.

For the pnp-MOSFETs I chose these =>, which show a threshold voltage of -2 - -4 volts. someone in this thread explained me earlier that pnp-MOSFETs are bascially ON when, there is no voltage at the gate. does this apply to these also and what does the threshold voltage in pnp datasheets then mean?