Learn how to create an Arduino Wiring sketch on Raspberry Pi 2 and 3 or Minnowboard Max that controls a stepper motor. The app runs the motor in default forward mode, default reverse mode and small-step forward mode in a loop.
Connect the circuit based on the Fritzing diagram below.
Start by hooking up the Raspberry Pi 2 or 3 to the Big Easy Driver.
Connect the ENABLE pin on the driver to pin 12 (GPIO 18) on the Pi.
Connect the MS1, MS2 and MS3 pins on the driver to pins 36, 38 and 40 respectively. (GPIO 16, GPIO 20 and GPIO 21)
Connect the STEP pin on the driver to pin 10 (GPIO 15) on the Pi.
Connect the DIR pin on the driver to pin 8 (GPIO 14) on the Pi.
Finally, connect the GND pin on the driver to pin 39 on the Pi.
Next connect the motor to the driver. The Black and Green cables of the motor connect to the pins marked ‘A’ on the driver and the Red and Blue cables on the motor connect to the pins marked ‘B’ on the driver.
Hook up a 12V/2A power source to the driver by connecting the positive lead of the power source to the pin marked M+ on the driver and the negative lead to the pin marked GND.
Replace the existing code in your main .ino file with the following code: