Stepper Motor Control with Raspberry Pi

Raspberry PiĀ is an ARM architecture processor based board designed for electronic engineers and hobbyists. The PI is one of most trusted project development platforms out there now. With higher processor speed and 1 GB RAM, the PI can be used for many high profile projects like Image processing andĀ Internet of Things.

stepper motor control with raspberry pi
Stepper Motor Control with Raspberry Pi

For doing any of high profile projects, one need to understand the basic functions of PI. We will be covering all theĀ basic functionalities of Raspberry PiĀ in these tutorials. In each tutorial we will discuss one of functions of PI. By the end of this Raspberry Pi Tutorial Series, you will be able to do high profile projects by yourself. Go through below tutorials:

In this tutorial, we will Control the Speed of a Stepper Motor using Raspberry Pi. In Stepper Motor, as the name itself says, the rotation of shaft is in Step form. There are different types of Stepper Motor; in here we will be using the most popular one that isĀ UnipolarĀ Stepper Motor. Unlike DC motor, we can rotate stepper motor to any particular angle by giving it proper instructions.

To rotate this Four Stage Stepper Motor, we will deliver power pulses by using Stepper Motor Ā Driver Circuit. The driver circuit takes logic triggers from PI. If we control the logic triggers, we control the power pulses and hence the speed of stepper motor.

There areĀ 40 GPIO output pins in Raspberry Pi 2. But out of 40, only 26 GPIO pins (GPIO2 to GPIO27) can be programmed. Some of these pins perform some special functions. With special GPIO put aside, we have only 17 GPIO remaining. Each of these 17 GPIO pin can deliver a maximum ofĀ 15mA current. And the sum of currents from all GPIO Pins cannot exceedĀ 50mA. To know more about GPIO pins, go through:Ā LED Blinking with Raspberry Pi

There areĀ +5V (Pin 2 & 4) and +3.3V (Pin 1 & 17) power output pinsĀ on the board for connecting other modules and sensors. These power rails cannot be used to drive the Stepper Motor, because we need more power to rotate it. So we have to deliver the power to Stepper Motor from another power source. My stepper motor has a voltage rating of 9V so I am using a 9v battery as my second power source. Search your stepper motor model number to know voltage rating. Depending on the rating choose the secondary source appropriately.

As stated earlier, we need a driver circuit to drive the Stepper Motor. We will also be designing a Simple Transistor Driver Circuit here.

Components Required:

Here we are usingĀ Raspberry Pi 2 Model BĀ with Raspbian Jessie OS. All the basic Hardware and Software requirements are previously discussed, you can look it up in theĀ Raspberry Pi Introduction, other than that we need:

  • Connecting pins
  • 220ā„¦ or 1Kā„¦resistor (3)
  • Stepper Motor
  • Buttons (2)
  • 2N2222 Transistor (4)
  • 1N4007 Diode (4)
  • Capacitor- 1000uF
  • Bread Board

Circuit Explanation:

circuit stepper motor control with raspberry pi

For more detail: Stepper Motor Control with Raspberry Pi

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Follow Us:
Scroll to Top