Switching of a running ULN2003 Stepper Motor Driver IC

Thread Starter

Doceave

Joined Nov 16, 2019
49
Hi there.

Below is a (rather messy) schematic illustrating a part of my circuit. I hope for comments esp relating to:
1) Whether or not the stepper motors will be properly switchable by the ESP32 GPIOs?
- I am not worried about a small leak through the stepper motors
2) Whether a heating element connected to KR will be properly switchable by the ESP32 GPIOs?

Any other comments will be welcomed.

1573986102120.png
 

Attachments

ScottWang

Joined Aug 23, 2012
7,409
How much current does the stepper motor needed?

About Q1, R13 and Q2, R14, they seem can't match the current of stepper motor needs.

When you using npn(or pnp) transistor or NMosfet( or PMosfet) to design the circuit and connecting to Mcu, you have to consider the power up condition and the high low states of Mosfet or bjt.

Only using pnp to control positive power is not a good idea, because the power up of mcu is low, but the pnp needs to use high to control it.

There is an another problem is that you can't use 7V(Only for 5V) for stepper motor, because the Vb will be too high, so you can't turn off the Q1 and Q2 through a 5V mcu i/o port, use npn with pnp is ok.
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
How much current does the stepper motor needed?

About Q1, R13 and Q2, R14, they seem can't match the current of stepper motor needs.

When you using npn(or pnp) transistor or NMosfet( or PMosfet) to design the circuit and connecting to Mcu, you have to consider the power up condition and the high low states of Mosfet or bjt.

Only using pnp to control positive power is not a good idea, because the power up of mcu is low, but the pnp needs to use high to control it.

There is an another problem is that you can't use 7V(Only for 5V) for stepper motor, because the Vb will be too high, so you can't turn off the Q1 and Q2 through a 5V mcu i/o port, use npn with pnp is ok.
Hi there Scott

The 28BYJ stepper motor has resistance of about 20ohm per phase --- thus 250mA (I will only energize one phase at a time)

Q2, according to datasheet should be able to handle 600mA --- can you suggest more appropriate values for R13 and R14 given load of 250mA?

I have also corrected an error --- The stepper motors are to be powered by 5V only :)

Please see the updated schematic below.

Any comments will be most welcomed.

1573996530271.png
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
The circuit with Q1 and Q2 willonly work if the steppers are powered from the same voltage as the ESP32.
The ESP32 is indeed also powered from VCC (5V) --- you may just want to see it all... (your comments have already saved me hours of head scratching....)

1573997444344.png
 

ScottWang

Joined Aug 23, 2012
7,409
Q2, according to datasheet should be able to handle 600mA --- can you suggest more appropriate values for R13 and R14 given load of 250mA?
The resistance of stepper motor is 20Ω, and driving current is 250mA,
The calculation of R13, R14 below :
R13 = (Vcc - Vbe1)/(Ic1/10)
=(5V-0.7V)/(250mA/10)
=4.3V/25mA
=172Ω (you can try 160Ω or 180Ω)

Theoretically when the stepper motor have 4 phases then we can drive it as I=250mA*4=1A (2SA684 1A), but for the safety reason, so you just try it close to 250mA first, if you using 2N2907A to try, you can use your finger to touch 2N2907A when it is working, whatever it is no feeling or just a little warm then it is OK, if you fell that it is hot then you have to find some other PNP.

The R17 and R18 can be try as 4.7K~10K.
 

ScottWang

Joined Aug 23, 2012
7,409
AlbertHall given you the good suggestion in #12 and that is to use a NPN with PNP, you just need to add the Rbe, the good condition is on the power up when you using the mcu with bjt, I also mentioned in #25, but you seem missed it, so I have to say it again.
 

MisterBill2

Joined Jan 23, 2018
18,600
If you want to inhibit the drive to one motor while leaving the others run, it is easy to do it digitally using 4 of the 2- input AND gates to switch off drive to a particular motor driver IC. Each motor control would have an enable line. That is simple and easily expandable and would take less room than discrete devices and their resistors.
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
AlbertHall given you the good suggestion in #12 and that is to use a NPN with PNP, you just need to add the Rbe, the good condition is on the power up when you using the mcu with bjt, I also mentioned in #25, but you seem missed it, so I have to say it again.
Gentlemen.... you have been invaluable. I really hope to show you a working machine soon.... Does this integrate both your and Albert's advice?: (the schematic is looking horribly messy now --- I apologise)
1574016521375.png
 

Thread Starter

Doceave

Joined Nov 16, 2019
49
If you want to inhibit the drive to one motor while leaving the others run, it is easy to do it digitally using 4 of the 2- input AND gates to switch off drive to a particular motor driver IC. Each motor control would have an enable line. That is simple and easily expandable and would take less room than discrete devices and their resistors.
I see there is un-used capacity in the ULN2003 for this --- I do not have the skill to implement this. Would you be super kind and make a simple schematic?
 

eetech00

Joined Jun 8, 2013
3,961
Hi there Scott

The 28BYJ stepper motor has resistance of about 20ohm per phase --- thus 250mA (I will only energize one phase at a time)

Q2, according to datasheet should be able to handle 600mA --- can you suggest more appropriate values for R13 and R14 given load of 250mA?

I have also corrected an error --- The stepper motors are to be powered by 5V only :)

Please see the updated schematic below.

Any comments will be most welcomed.

View attachment 191670
hi

The specs for the28BYJ is 5V and 50 ohm DCR.

eT
 

ScottWang

Joined Aug 23, 2012
7,409
The 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
 
Top