H-bridge Circuit Not Working

Hello, new member here.

I've made a circuit to drive a magnetorquer using an L293D driver and an external H-bridge (reason being that the driver IC switches off at low PWM). It worked fine the first time, but now the load isn't drawing any current.

Screenshot 2024-08-04 174447

I'm using L293D as the gate driver. The top half uses two IRF9540N pmosfets and the bottom half, two IRFZ44N nmosfets. Poking around with a DMM, I saw that the source pin of the nmos that was supposed to be ON was pulled up to 2.3 V?? I figure it could be a breadboard problem or a wiring issue, but I'd appreciate any suggestion.

Code to drive L293D:

int pwm1 = 8; //pmos control (violet) these are the colours of the jumper wires
int pwm2 = 9; //pmos control (blue)
int pwm3 = 10; //nmos control (yellow)
int pwm4 = 11; //nmos control (red)
int pval = 255;

void setup() {
pinMode(pwm1, OUTPUT);
pinMode(pwm2, OUTPUT);
pinMode(pwm3, OUTPUT);
pinMode(pwm4, OUTPUT);
}

void loop() {
analogWrite(pwm1, 0); //mosfet(p) 1 on
analogWrite(pwm2, 255); //mosfet(p) 2 off
analogWrite(pwm3, pval); //mosfet(n) 3 on
analogWrite(pwm4, 0); //mosfet(n) 4 off
}

That cannot work in your given circuit :frowning:
Please supply a real circuit diagram.

That's what your given circuit will do. It pulls the input as low as a Darlington can do, thus opening the PMOS but closing the NMOS FET.


Here's a more accurate model. Couldn't find the PMOS I used, so used a closer version.

I don't understand this point. Please explain.

I see that you miss most basic electronic knowledge. Add the gate signals to your MOSFETs and watch what happens.

Which arduino are you using?

Arduino Uno

The Uno does not have PWM on pin 8, only 3, 5, 6, 9, 10, 11

Your code turns on MOSFET P 1 and MOSFET N 3. That will create a direct short to ground and burn out P1 and N3

I see, that's so careless of me. Thanks, I'll change it.

I would connect the P MOSFET gates to 5V with a 5.1K resistor and the N MOSFET gates to ground with a 5.1K resistor. That will ensure that all the MOSFETs are OFF, until the Uno can set the pinModes to outputs.
In your code, make sure to set the output levels so that all MOSFETs are OFF in setup()

Yes, I did think of connecting pull-up and pull-down resistors but a senior told me it's not necessary

It's never a good idea to leave a MOSFET gate floating. It could go high or low or somewhere inbetween until power is applied and the gate voltage is set.

Be sure on the same side you do not turn on the top and bottom half of the bridge at concurrently. If you do parts will probably fry and interesting things could happen, mostly not good. During switching be sure one is off before the other is turned on,

Hi, @rkomm
Welcome to the forum.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

1 Like

So I solved the problem partially by grounding the nmos source pins individually. The circuit is drawing more current, but it's well below the calculated value.

I think some of the MOSFETs are not switching on properly, but I think I can solve it now. Thanks for your help.

Turns out it was a breadboard issue. Touched the ends of two wires shorted to ground placed far from each other, and got more than 0.5 V on DMM. Problem is more or less solved.

That is a recurring theme on the forum. The breadboards nowadays seem to be of very poor quality with intermittent and high resistance connections

Anyway, thanks for your help.

Glad you got it working
Have a nice day!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.