28BYJ encoder

The problems with the 28BYJ stepper motor and how to fix them

The 28BYJ stepper motor is a terrific device but it presents some design challenges. Here is a way to overcome those challenges.

The 28BYJ geared stepper motor is a terrific little unit, designed to operate direction flaps in air conditioning units and similar applications. Its slow gearing and good torque are perfect for such uses. It is made in high volumes, low cost, widely available, and often comes supplied with a driver board (usually based on the ULN2003 driver). With its combination of availability, cost, torque, driver bundling, and ease of use – it is no surprise that it has become very popular with the hobbyist, electronics enthusiast and inventor.

We like this unit. A lot.

But is has some challenges.

The challenges of the 28BYJ

There are basically three challenges that the hobbyist encounters:

  1. It does not have a precise number of steps per each 360 degree revolution. In fact, one motor we tested was geared such that it needed between 2037 and 2038 steps per revolution. We found that 2037.6 steps were needed per 360 degree revolution. Even then, 2038.6 is probably not perfectly accurate. This presents a challenge, because unlike other steppers (for example non-geared NEMA motors usually have a step angle of 1.8 degrees, so that exactly 200 steps are needed for each turn), it is not easy to simply count the pulses for accurate positioning. It’s OK for general use, but if you rely on 2038 pulses per rev, you will find that the shaft’s position will tend to drift over time.
  2. The gearbox has some backlash. Of course, most geared system have some backlash, but the 28BYJ stepper motor is made in volume and designed without a defined degree of backlash. This also makes positioning a little tricky.
  3. When you power up your project and motor, you (or specifically your control circuit) usually has no idea of the shaft’s position. This problem is, of course, not unique to the 28BYJ stepper motor; stepper motors are often used in open loop system where there isn’t any encoder feedback. Such is the benefit of having a precise angles per step.

Overcoming the challenges

For some project, the above challenges don’t matter. But where they do matter, you will need a way to:

  1. Determine the position as start-up
  2. Monitor (and correct) the variances in steps per revolution to prevent drift over time.
  3. Overcoming the variable backlash

This is where our positional encoder can help. It is supplied as a kit that enables easy and effective closed-loop feedback for a project using the 28BYJ geared stepper motor.

We supply two different actuators – one for 360 degree position and one for 90 degree positions. In essence, the micro switch will operate once or four times per revolution depending upon which actuator you use.

Designing in the positional encoder

Adding an positional encoder is half the battle. To complete the solution you need to factor in two considerations:

  1. Backlash. As you step the motor to and fro, backlash has to be accommodated.
  2. The micro switch will operate on either side of the raised nub of the actuator disk. Hence, your control circuit would read the position differently based upon the direction of the shaft’s rotation at that time.

To address these two factors, we like to advise this design method. Simply – define a deterministic direction. i.e. when more-accurate positioning is needed (which we guess is for most projects), you should wind the actuator in the same direction (the deterministic direction) each time you want to take a reading from the micro switch. This might mean that you might have to wind the shaft in the opposite direction until the micro switch has passed (closed and opened) and then wind back in the deterministic direction to attain a set position. This applies when using either of the actuator disks. Simply, this design method will help to overcome the backlash and switch position factors.

A switch is a switch

Micro switches are, well, just switches. Their operational characteristics might change over time with wear and tear. And although the switch supplied has a roller, the actuator disk (and the switch’s roller) will likely wear over time too.

For these reasons, this position encoder is designed to offer positional closed-loop feedback. It should not be relied-upon in applications where very precise, accurate and calibrated position reading are required. You will need a (very expensive) industrial encoder for such purposes.

Design considerations

When using the positioning encoder, you may mount the switch mounting plate on either the front or the rear of the motor’s mounting arms. As long as the motor’s mounting arms are located in the encoders locating slots.

The positioning encoder parts are made of Perspex Acrylic (and the micro switch is also plastic). So make sure that the operating environment is appropriate for those materials.

How to buy this positional encoder

The switch is available here, or from our eBay shop.

See the position encoder in action

You can see the encoder here on YouTube

Single position actuator
Four position actuator