Controlling Stepper Motor Using Maker Drive and Raspberry Pi

Controlling Stepper Motor Using Maker Drive and Raspberry Pi

INTRODUCTION

A stepper motor is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor’s position can then be commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller). Besides controlling DC brush motor, we can use Maker Drive to control stepper motor. So, in this I will show you how to control stepper motor using Maker Drive and Raspberry Pi.

Tutorial you may need to read first:

  1. Getting Started with Maker pHAT
  2. Getting Started with Maker Drive and Raspberry Pi

VIDEO

This video will show you how to control stepper motor using Maker Drive and Raspberry Pi.

 
 

Untuk versi bahasa Melayu, sila rujuk video diatas.

 

HARDWARE PREPARATION

Below is the list of items used in the video

Wiring connection table

Raspberry PiMaker DriveStepper MotorBattery
GPIO 17Pin M1A  
GPIO 18Pin M1B  
5V5Vo  
GNDGND  
GPIO 27Pin M2A  
GPIO 22Pin M2B  
 Terminal M1AYellow 
 Terminal M1BWhite 
 VB+ Positive
 VB- Negative
 Terminal M2ARed 
 Terminal M2BBlack 
 

Sample Code

This is sample code used in the video. Save the second code as PigpioStepperMotor. Please run pigpio daemon (sudo pigpiod) before run the program.

 

Thank You

References:

  1. Getting Started With Maker pHAT
  2. Getting Started With Maker Drive and Raspberry Pi
  3. The pigpio Library

Thanks for reading this tutorial. If you have any technical inquiry, please post at Cytron Technical Forum.

Related Products