I started this circuit with stm32. But it doesn't work properly. When I set zero to all four pins and I don't want any movement, the voltage of 3 volts is at the two ends of the motor again. Or if I want the motor to turn in the right direction The MOSFETs become extremely hot and the motor does not move. What could be the problem? Is the amount of resistance appropriate? I use a 3 volts DC motor.enter image description here

  • 2
    \$\begingroup\$ Four pins? I only see two STM32 output pins. \$\endgroup\$ – skvery Apr 1 at 20:52
  • 1
    \$\begingroup\$ Please specify what the other two pins do. What motor are you using? \$\endgroup\$ – sgt_johnny Apr 1 at 20:59
  • 2
    \$\begingroup\$ My "small motor" is as big as my pinkie finger. I know guys whose "small motor" is as big as my whole car. What size is your small motor? Can you edit your question with motor specifications, like voltage and stall torque, or even the manufacturer's part number? \$\endgroup\$ – TimWescott Apr 1 at 21:08
  • \$\begingroup\$ Well a pin from the top of the bridge with a pin from the bottom diagonally connected to rotate the motor in the left and right directions.....I use a 3 volts DC motor. \$\endgroup\$ – Mojtaba Miraki Apr 1 at 21:12
  • \$\begingroup\$ "3 volts DC motor" doesn't tell the whole story. Details matter. How big is it? Did it come with specifications? \$\endgroup\$ – TimWescott Apr 1 at 21:15

Your NMOSFETs achieves their rated \$R_{dson}\$ at 4V but your STM32 output pins only apply 3.3V. Your PMOS gates achieve their rated \$R_{dson}\$ at 10V but you are only applying 5V to it.

Your MOSFETs get hot and your motor doesn't move because your MOSFETs are only partially turning on, acting as resistors that heat up a lot, but don't allow enough current to get to the motor.

Pay ZERO attention to \$V_{gsth}\$ when trying to use a MOSFET as a switch. \$V_{gsth}\$ is when the MOSFET just barely starts to turn on. Do you want the MOSFET to barely turn on? Or do you want to achieve the rated \$R_{dson}\$? In that case, use at least the \$V_{gs}\$ specified in the datasheet to obtain the rated \$R_{dson}\$.

Also, PWM won't work well if you do not slam the MOSFET gate-source capacitance with enough current to turn it on and of quickly. Your MOSFET will just heat up since it spends too much time in the region of half-on/half-off where it acts as a resistor. Your STM32 pins driving the NMOS are limited in drive current and the 10k pull-up resistors also limit your PMOS gate drive currents.

| improve this answer | |
  • \$\begingroup\$ I figured out the bug, what is the solution now?My circuit is on PCB....thanks \$\endgroup\$ – Mojtaba Miraki Apr 2 at 6:22
  • \$\begingroup\$ @MojtabaMiraki Find different MOSFETs. \$\endgroup\$ – DKNguyen Apr 2 at 13:05
  • \$\begingroup\$ @MojtabaMiraki Those mosfet are called: logic level mosfets \$\endgroup\$ – Huisman Apr 2 at 16:58
  • \$\begingroup\$ @Huisman Not just logic level MOSFETs in his case but logic level MOSFETs with a rated RDson at his Vgs. His NMOS are actually logic level already but still too high a Vgs. \$\endgroup\$ – DKNguyen Apr 2 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.