I've challenged myself to build my own stepper driver, but first, I tried to build a simple H-Bridge to control the rotation of a DC motor as shown in this image.
This is how I hooked up everything.
The problem is... The voltage on the pins of the motor are below 1v and the mosfets are overheating really fast, any idea of what kind of stupidity I did here?
PM: I'm using IRF530n mosfets, they have 10Vgs, might this be the problem? (DATASHEET)
A mosfet needs 2-3 time it's Vgs(th) between gate and source to fully conduct.
When a mosfet is conducting (switch is closed), source and drain are on the same potential.
Drain is 12volt.
Meaning, you must provide 12volt + 10volt = 22volt at the gate of the two top fets.
10volt, because an IRF530 is not a logic level fet.
A 5volt Arduino pin can't provide that 22volt.
Leo..
Aniroth:
The problem is... The voltage on the pins of the motor are below 1v and the mosfets are overheating really fast, any idea of what kind of stupidity I did here?
PM: I'm using IRF530n mosfets, they have 10Vgs, might this be the problem? (DATASHEET)
Yes, as your high-side MOSFETs are in source-follower configuration, not common-source which they need to be for switching circuits. For low voltage H-bridges its quite common to use p-MOSFETs for the high-side drivers for this reason.
Source-follower circuit will fry your mosfets as its shockingly inefficient and wastes lots of volts.
Even better is to use bootstrapping gate-drivers which allows all n-FET's to be used efficiently, find the datasheet for gate driver chips such as FAN7380, IRS2001, HIP4081A, thousands of others are available.