With your help I am taking this circuit on part-by partThe calculation of R22(Q7), R23(Q6) below:
Ib_Q7 = 25mA/10 = 2.5mA
Ib_Q6 = 25mA/10 = 2.5mA
R22 = (V_ESP32-Vbe_Q7)/Ib_Q7
= (5V-0.7V)/2.5mA
= 4.3V/2.5mA
= 1.72K (Try 1.8K)
When the bjt using as switch then the hFE = 10 (some others maybe = 20)
So Ic_Q1 = 250mA
Ic_Q7 = Ib_Q1 = Ic_Q1/10 = 250mA/10 = 25mA
Ib_Q7 = Ic_Q7/10 = 25mA/10 = 2.5mA
So we now have an NPN-PNP combination switching the stepper and its driver.
The schematic is a bit upside down but do you otherwise agree with this?