Leider ist der Eintrag nur auf Amerikanisches Englisch verfügbar. Der Inhalt wird unten in einer verfügbaren Sprache angezeigt. Klicken Sie auf den Link, um die aktuelle Sprache zu ändern.

This tutorial gives you a quick and simple idea how to control a stepper motor via Raspberry Pi and a Python script.


Connection between motor and shield

  • Red: A-
  • Green: A+
  • Yellow: B-
  • Blue: B+

Red+Green and Yellow+Blue are one phase each, in this case (4-pin bipolar motor) it does not matter if you swap Red with Green or Yellow with Blue.


Connection between shield and RPi

  • 5V+ (VCC): Pin 2
  • GND: Pin 6
  • IN1: Pin 12
  • IN2: Pin 16
  • IN3: Pin 18
  • IN4: Pin 22
  • VIN: Pin 4 (not needed; or separate power source)
  • GND (near VIN): Pin 10 (not needed; or separate power source)

For INx, you can of course choose other GPIO ports on your RPi, but you have to fit the script.

Python Script



raspberry pi with stepper motor and shield 2

raspberry pi with stepper motor and shield 1



In general, I highly recommend to only power the shield (especially the motor) when it is needed, not all the time. The motor takes about 0,5A even when idle, and the L293D chip gets quite hot.

So use a switch etc. for the power line, or maybe use another driver chip.








  [email protected]