28BYJ-48 Stepper motor control board

Hi,

I bought a 28 BYJ-48 Stepper and it came with a generic control board, like this:

I'm interesting in knowing how the board works but the resources I can find only teaches you how to connect it to the motor and Arduino. I want to implement that board from scratch on a breadboard, using a schematics. But I found multiple versions and I'm not sure which one is right.

I found this:

A few questions on the pic above:

  1. The resistors are only used to protect the LEDs, so if I don't need LED indicators I don't need the resistors right?

  2. What does pin 1 of CN2 do?

  3. What does CN3 do?

  4. Is the 5V at the bottom powering both the stepper and the ULN2003?

Thanks.

driver_board_pic.png

schematic_complex2003.png

schematic3_2003.png

anyone please?

If you don't want the LEDs then you won't need the resistors is correct. However, the LEDs will help you determine if the motor is hooked up correctly (it can be wrong, and still move. The leds will show you the order each coil is activated.)

I can't see where CN3 is on the board you showed. CN2 is the connector to attach the motor to the board. Pin 1 of the connector is the power. The 28byj-48 is a unipolar motor (that can also be run as a bipolar motor.) Look at this page:

The wiring diagram for the unipolar version is similar to what you are showing. You can also wire it up as a bipolar motor by simply ignoring the red wire (the one that goes to pin 1 of CN2.)

The ULN2003 chip won't work for bipolar motor connections-- the outputs will only sink current to ground, so you have to leave the motor power lead connected (to motor power supply plus).

ChrisTenone:
If you don't want the LEDs then you won't need the resistors is correct. However, the LEDs will help you determine if the motor is hooked up correctly (it can be wrong, and still move. The leds will show you the order each coil is activated.)

I can't see where CN3 is on the board you showed. CN2 is the connector to attach the motor to the board. Pin 1 of the connector is the power. The 28byj-48 is a unipolar motor (that can also be run as a bipolar motor.) Look at this page:

https://www.arduino.cc/en/Tutorial/StepperOneRevolution

The wiring diagram for the unipolar version is similar to what you are showing. You can also wire it up as a bipolar motor by simply ignoring the red wire (the one that goes to pin 1 of CN2.)

Ok, here's another schematics that makes more sense:

I see that pin 1 is powering the stepper motor. Where the is the ground of the stepper motor though? Is it just the ground on the ULN2003?

Also, what if I want to drive two motors (in sync with each other), can I just parallelize the connection coming out of the ULN2003 and have another set of wires drive the 2nd motor? The ULN2003 can handle 500mA of current I think. (500-mA-Rated Collector Current (Single Output)) Or is it better to have a 2nd ULN2003 for the 2nd motor (but have both ULN2003 feed off the microprocessor).

Thanks

jremington:
The ULN2003 chip won't work for bipolar motor connections-- the outputs will only sink current to ground, so you have to leave the motor power lead connected (to motor power supply plus).

Based on the spec, the 28BYJ-48 is an unipolar motor. But I guess I can use a H-bridge to run it in bipolar mode right? The drive circuit will be more complex, but from what I read, bipolar mode is more "efficient", because windings are better utilized. Does it mean battery life will be longer for the same amount of power output? Or does it merely mean it's more powerful for a given size (but uses more battery too)?

BTW, both unipolar and bipolar mode will allow the motor to run in both directions right?

thanks

There isn't much difference between unipolar and bipolar drive, for the same motor. The windings can be energized in different ways, with either type of connection (e.g. full step versus half step, etc.). For more than you want to know, consult Jones on steppers.

You need a dual H-bridge driver for bipolar excitation.

Hi

I'm interesting in knowing how the board works but the resources I can find only teaches you how to connect it to the motor and Arduino.

This may help, block diagram of inside the IC.


Tom... :slight_smile:

paulwece:
Based on the spec, the 28BYJ-48 is an unipolar motor. But I guess I can use a H-bridge to run it in bipolar mode right? The drive circuit will be more complex, but from what I read, bipolar mode is more "efficient", because windings are better utilized. Does it mean battery life will be longer for the same amount of power output? Or does it merely mean it's more powerful for a given size (but uses more battery too)?

BTW, both unipolar and bipolar mode will allow the motor to run in both directions right?

thanks

These motors can step in either direction either as unipolar or bipolar.

You can run it as bipolar by simply ignoring the common (red) wire and driving it with an h-bridge or one of the chips of a modern motor driver. This however wastes a lot of current and reduces the torque, because the coils are still connected. Driver chips such as the TB6612 are more efficient than the older L293, and they are easier to find any more.

If you carefully pry off the blue cover on the motor, you will see a small circuit board that the wires are attached to. The circuit board has 3 traces on it; the middle trace connects the red wire to both sets of coils. By cutting this trace, you will disconnect the coils, so they can be powered independently. This results in higher torque and top speed for the motor. If you can supply 6 volts to the motor, it will run even better than it does on 5.

Here is a tutorial for doing the surgery. I have done this myself, and drive the motors with either a TB6612 breakout board, or a L293D motor shield. It really works.

ChrisTenone:
These motors can step in either direction either as unipolar or bipolar.

You can run it as bipolar by simply ignoring the common (red) wire and driving it with an h-bridge or one of the chips of a modern motor driver. This however wastes a lot of current and reduces the torque, because the coils are still connected. Driver chips such as the TB6612 are more efficient than the older L293, and they are easier to find any more.

If you carefully pry off the blue cover on the motor, you will see a small circuit board that the wires are attached to. The circuit board has 3 traces on it; the middle trace connects the red wire to both sets of coils. By cutting this trace, you will disconnect the coils, so they can be powered independently. This results in higher torque and top speed for the motor. If you can supply 6 volts to the motor, it will run even better than it does on 5.

Here is a tutorial for doing the surgery. I have done this myself, and drive the motors with either a TB6612 breakout board, or a L293D motor shield. It really works.

I appreciate the help. However, at this time I think I will run it in unipolar mode since it satisfies my need and is easier in many ways. My short term goal is to understand the unipolar circuit with the ULN2003 first before going for more advanced stuff. My background is in machine learning and I'm a noob when it comes to hardware. I will ask a lot of novice questions and also do self study on my own. That said, here are some questions:

  1. Suppose I want to run two stepper motors rather than one, and they both can be in sync, can I drive them with a single ULN2003 and a single microprocessor (ATtiny85)?

  2. Speaking of microprocessor, other than ATtiny85, what other widely available, cheap microprocessors are out there (Arduino doesn't count)?

  3. Just curious, in the industry, say a company that makes a device that uses microcontroller, how do they load the firmware in? Is it a manual process like how we load sketches into the Arduino via a USB?

Thanks

if someone can answer the 3 questions that'll help me a lot. Thanks

  1. Yes, if you strictly observe the voltage and current limitations of the ULN2003
  2. There are tens of thousands of different microprocessors
  3. Using one of several different automated processes, some unique to a particular uP

jremington:

  1. Yes, if you strictly observe the voltage and current limitations of the ULN2003
  2. There are tens of thousands of different microprocessors
  3. Using one of several different automated processes, some unique to a particular uP

I've done some self study and I think I understand the 28BYJ-48 driver board better now. Things are starting to make sense. Can you check if I got it right?

  1. The transistors in the ULN2003 are pnp bipolar ones. The signal from the Arduino is connected to the "base" of the Darlington pair which allows current to flow from the "collector" to the "emitter." The emitter in this case is the ground, and the collector is sinking current from the stepper motor. The power voltage provided to the stepper motor is the collector voltage.

  2. So when a Darlington pair gets signal from the Arduino, current flows through the corresponding coil in the stepper motor (from the anode of the stepper to a ground in the ULN2003).

thanks

The transistors are NPN, and the collector of the Darllington pair approximates a switch to "ground", sinking motor current. Schematic below.

uln2003.gif

jremington:
The transistors are NPN, and the collector of the Darllington pair approximates a switch to "ground", sinking motor current. Schematic below.

uln2003.gif

Oops, I meant NPN.

I'm still a bit confused with that COM pin (9) of the ULN2003 and all those flyback diodes connected to it. I understand it's because of the inductive load. You connect the power supply to the COM, so the flyback diode will be reverse biased when there is current at the collector, but as you make the switch, the flyback diode will be forward biased and since the COM is connected to the power source (same as the motor), it will essentially form a loop through the motor to dissipate the the energy?

thanks

Hi, LOts of details and example code for the motor and driver combination HERE

Can someone tell me if I understood the COM pin of the ULN2003 correctly?

"I'm still a bit confused with that COM pin (9) of the ULN2003 and all those flyback diodes connected to it. I understand it's because of the inductive load. You connect the power supply to the COM, so the flyback diode will be reverse biased when there is current at the collector, but as you make the switch, the flyback diode will be forward biased and since the COM is connected to the power source (same as the motor), it will essentially form a loop through the motor to dissipate the the energy?"

Thanks

Here are some specs of the 28BYJ-48 stepper motor:

4 Phase 5 Wire Connection

Current : 160 mA per winding (320 mA in 4-step mode) Measured: 250mA stopped, 200 mA running fast
Resistance : 31 Ω per coil winding (from Red wire to any coil) (Some 24-28 ohms)
Voltage : 5V DC

The maximum collector current of the ULN2003 is 500mA.

That mean if I want to run TWO 28 BJ-48 motors in sync, it's probably better to use two ULN2003 (one for each) correct? If I use a single ULN2003 it's pushing really close to the limit...

Please advise. thanks

if I want to run TWO 28 BJ-48 motors in sync, it's probably better to use two ULN2003 (one for each)

That's right.. The Arduino can easily drive the inputs of two ULB2003's

Thanks for all the responses so far.

In a previous thread, I talked about using ATiny85 as the microprocessor. I also talked about powering the stepper motor and the ATiny85 using a common power source. I wanted to use NiMh AA batteries, but if I used 4 AA cells, the voltage at peak charge will be more than what the ATiny85 can handle (5.3 V I think). However, as the battery drops in voltage, it might not have enough voltage to drive the stepper motor.

Some solutions were given in that thread. After further thoughts, I'm thinking of using two AA batteries rather than 4, and use a boost converter to fix the output voltage at 5V, and use that to drive both the motor and the ATiny85. What do you think?

Thanks