# Anything wrong with this Mosfet H-bridge?

I am very knew to electronics and was planning to build my first robot. I search around google for H-bridge designs and drew the following schematic(OLD)

NEW I know that testing a circuit on a simulation and in real life are to very different things, on the simulation the circuit works good. The two inputs are coming from a RF module with a PT2262 decoder, that's why I chose two logic level n-channel mosfets(IRL520) at the low side. The motors are both(same circuit twice) 12V and 2,19A of stall current each. Each optocoupler is a 4n35. My power source is a 12V 5A lead acid battery.

The problem: (When testing on a breadboard)When one input is high, the mosfets that are not being used get really hot and the motor turn very slow or not at all. I was thinking maybe the way that I wired it to my breadboard is off? This problem has been bugging me for a little while. I am hoping one of you experts are able to tell me what might be happening here? I decided to build my own motor driver for educational purposes and cannot get any other components for now

*EDIT: I've uploaded a new schematic with the changes and switched the p-channel mosfets(my bad)

*EDIT 2: Motors are 12VDC brushed gearmotors.

EDIT 4: Sorry for the delay, here are some measurements that might aid in answering;

• After you edited That's something that you'll be able to put on your breadboard that won't burn up. The only "major" danger here is if you press down both buttons simultaneously. or if the time between pressing one button and the other button is too short. Because you got pull-down/pull-up resistors which are bleeds out slower than activating. – Harry Svensson Jul 25 '17 at 22:06
• What would you recommend to improve that? – User12345 Jul 25 '17 at 22:15
• If you will keep having it with just buttons, Either put a warning text nearby saying "never ever press both buttons down simultaneously". Or use two and-gates which works as enablers, if one button is pressed then that will disable the other button, if both are pressed they disable each other. If you are going to control the H-Bridge with a MicroController(aka µC), then just don't write bad code. – Harry Svensson Jul 25 '17 at 22:19
• I'll be very careful during simulation. My H-bridge will be controlled through RF by a PT2262 decoder, I'll ensure to wire it up good when putting the robot together. The RF modules I have can only send HIGHs and LOWs one at a time, but they have an impressive range. Besides that, could anything else go wrong(before I go testing it). – User12345 Jul 25 '17 at 22:47
• Some extra if you want to really go "all" the way. Put some capacitors from GND to the 12V to smooth out the voltage and voltage dips. I don't know exactly what kind of "motor" you'll drive, but if you will play with PWM and duty cycles. Then you should definitely check up on "bipolar and unipolar pwm". I'm really bad at explaining things, but unipolar switching is what you should always go for. The red lines are the voltages the motor sees. Unipolar is more kind to your circuit and more efficient. – Harry Svensson Jul 25 '17 at 23:13

When input switches go open circuit, there is nothing significant pulling charge from the mosfet gates on the low side. Try adding 1 kohm resistors to ground between gate and source on the low side mosfets. Without this addition, you cannot rely on the photodiode circuit for dragging down the gate to 0 volt and this will leave the lower mosfets partially on.

I'm not ruling out that there are other problems of course.

• And what other problems do you see? – User12345 Jul 25 '17 at 22:03
• The main problem is that you replaced the old circuit with a modified circuit incorporating the changes. This is not good because it invalidates any answers previously given potentially so retract your edits and play properly. – Andy aka Jul 25 '17 at 22:31
• Ok, I changed it the schematics – User12345 Jul 25 '17 at 23:07

Q1 and Q2 are wired in reverse. They're PMOS.

The optos are useless, simple NPN transistors would work.

Also, your optocouplers will introduce a delay which will cause both FETs to conduct at the same time on every transition, shorting the power supply. They will heat a lot (or burn).

Your P-types have $10k\Omega$ gate termination resistors. This is hte only source of gate charge discharge & this will produce a longer turn-off time (relative to the N-TYPE)
The N-Types have $1k\Omega$, equally their gates are directly connected to the A & B terminals and these may provide a low-impedance LOW -> Fast turn off & equally a possible fast turn-on.