Electronic – Controlling a Stepper-Motor with 2 H-bridges

h-bridgemicrocontrollerresistorsstepper motortransistors

I think that I may have come up with a possible way to control a bipolar stepper motor using 2 simple H-bridges. The idea is to control the direction and the steps of the motor by switching the direction of the current flow using the H-bridges. Unfortunately, I am running into a few annoying issues. I am using a ROB-09238 bipolar, 1.8 degree step value stepper motor. I have an external voltage source of 12volts@5amps. For one, the rated current of the stepper motor is 0.33 amps, does this mean at max that the stepper motor will use is only 0.33 amps, or is this the average amperage? I am using a Raspberry Pi to output 3.3V and control the base of the transistors. The goal is to create an NPN transistor H-bridge using regular 2N2222 transistors. Will these transistors do the job? What is the required resistance value on each of the transistors to do the job efficiently without blowing the transistors?

No matter what I do to calculate the resistance value for the base of the transistors, I either make them get really hot, or can't even get enough current through the H-bridge to properly light an LED. I don't think that I am wiring it wrong because in my circuit simulation program, I get the same results. I have messed around with the resistance values within the program and still can't appear to get what I am looking for.

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

If you want to use BJTs, the following ought to work:

schematic

simulate this circuit – Schematic created using CircuitLab

You will, of course, need to do this 4 times.

ETA: I got the labeling wrong on the drive levels. Tip of the hat to Dave Tweed.

Q1 and Q3 take your 3-volt signals and use them to drive the bases of Q2 and Q4. The TIP series transistors are cheap and readily available (you can probably find them at Radio Shack). The 330 ohm base resistors will provide ~ 30 mA base drive to the power transistors, which will be enough for them to turn fully on when driving 300 mA to the steppers. If you use much less base current (larger base resistors), the power transistors will start getting hot, and the steppers won't get their rated current.

And yet another ETA: the 330 ohm resistors should be at least 1/2 watt, and 1 watt is better. Nominal power is .4 watts when conducting.

ETA: If you want to use a transistor as a switch, you want it to be fully on. This is characterized by an emitter-collector voltage of (about) .5 volts or less, and is referred to as saturation. To ensure that a transistor is in saturation, the rule of thumb is to provide base drive at 1/10 the desired collector current. This is not valid in some cases (particularly very high currents), but should work fine in this case.

If you want to really do this right, add 1K to 10K resistors from emitter to base on Q2 and Q4.