I am testing a custom motor drive (small 6V DC motor) controlled by an ESP32 using Arduino code. The direction A and B are controlled by High/Low digital writes on GPIO pins 16 & 17. Using an NPN transistor (NPN transistor - BC847 - datasheet) and a (dual n/p mosfet IRF7105 - datasheet).
The speed is controlled by PWM (ledc) on pin 26 with a mosfet: (IRLML2502 n-channel mosfet datasheet)
But the results are not consistent, when I set A or B high and PWM at 100%, I would expect close to 6V on the motor pins (1 and 2). Sometimes this is indeed the case, but sometimes I only measure 3.7V. When the testpoint T6 is shorted to ground, the 6V is reached. I am not even sure where the different voltage goes "missing", I measured the following voltages with my DMM (no oscilloscope available unfortunately).
- M1 - M2: 3.7V
- M1 to GND: 0V
- M2 to 6V: 6V
Is there something I am missing in the schematic or in the way I drive this with the ESP32?
Arduino.jpg