DC motor issue, MOSFET problem?

Hello, I have a problem with controlling the DC motor using a mosfet,
when I measure the voltage with a meter and PWM is at 0, the voltage is 3.44 V, and when PWM is at 255, it is 3.27 V. I checked the voltages and everything seems fine. Anyone know what the problem could be?
1

What controller are You using?
Between which points are You measuring?
Where is the power coming from? Batt needs to be expained.
What's the code used?

I use ESP32, and the points on which I measured were M1 + and -, but I checked whether the voltage comes out from the IO pin and it is fine, I can also check other voltages if someone needs it.
I use 1s lipo 25C batteries.

const int mot = 27;

void setup() {
   pinMode(mot, OUTPUT);
}

void loop() {
   analogWrite(mot, 255);
   delay(5000);
   analogWrite(mot, 0);
   delay(5000);
}

With the motor connected or disconnected?

Where are you measuring the voltages ?

What is the motor’s resistance ?

What is the battery voltage with the motor directly connected to the battery ?

You should really measure Vds.

  • Let’s see the PCB.

Your MOSFET is not a logic level device. Your ESP32 can only drive the gate to 3.3V but the MOSFET want a much higher voltage to fully turn on.

It isn't?

Maximum gate threshold voltage is 1.45V

AO3400A

It will work at 2.5v

IMG_2246

Why is the motor always on if the PWM is 0?
I measured pin 27 and it also has 0v

You have been asked questions, please answer them.

You may have damaged the MOSFET.

That looks like a PCB layout but clearly is not the actual layout, since the grounds are not connected. Makes me wonder what the actual layout is.

Because you somehow damaged the MOSFET.
The capacitor across the motor was a bad idea.
Accidentally shorting the two M1 pins together for just a microsecond can destroy the MOSFET

the points on which I measured were M1 + and -
Motors i use: Motors
Battery have 3.75v when i connect motor directly drop to 3.64.

I send link to my project: PCB

Should i try to change mosfet to new one? And also remove capasitor from motor?

Why?

we recommend you always solder at least one capacitor across your motor terminals.

Well I don't

Yes to both

I do it and it nothing change. Any ideas?

So you measured the voltage at the gate of Q3 and it is less than 0.65V, yet the motor is still running.
Is that correct?
If yes, then I can't see how it is possible if the MOSFET is good

If you remove power and measure between the MOSFET drain and ground it should be a high resistance.

I measure the voltage on gate and when PWM is 0 voltage also is 0v, but between pins M1+ and M1- voltage is 3,4v. I change mosfet 4 times and still it same, maby project is bad or mosfet should be defferent?

I'm new to electronics design, can you tell me how to correctly measure the resistance between drain and ground?