Bukit Mertajam, Penang

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 Pi Maker Drive Stepper Motor Battery
GPIO 17 Pin M1A
GPIO 18 Pin M1B
5V 5Vo
GND GND
GPIO 27 Pin M2A
GPIO 22 Pin M2B
Terminal M1A Yellow
Terminal M1B White
VB+ Positive
VB- Negative
Terminal M2A Red
Terminal M2B Black

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 Posts

Leave a comment