1

I've been trying to setup my stepper motor with my RPI according to this guide: http://www.raspberrypi-spy.co.uk/2012/07/stepper-motor-control-in-python/

However, nothing seems to be happening, have I've wired my pi wrong? Here are two pictures of my setup:

Picture of RPI

Picture of Steppermotor-connection

I've also tried to run this script: http://blog.scphillips.com/2012/12/a-python-class-to-move-the-stepper-motor/

I'm getting no errors from either of the scripts. What am I doing wrong?

Edit 1

When I run the code in the second link the output is:

$ sudo python move.py
Pause in seconds: 0.0029296875
moving 1024 steps
moving -1024 steps
moving -1024 steps
moving -1024 steps
moving 2048 steps

Notice that the code in the second example is setting up the pins like this:

GPIO.setmode(GPIO.BOARD)
m = Motor([18,22,24,26])

Is that ok?

EDIT 2 Here is another picture of the power wiring of the motor Zoomed

EDIT3 Here is the connection that solved the problem zoomed2

11
  • Your connections appear to be OK, I assume you are using the pictured stepper - a variant of the 28BYJ-48. Does the stepper vibrate at all when you try to move it?
    – joan
    Commented Jun 18, 2014 at 16:42
  • No nothing seems to be happening. It is cold and not moving. You are correct about the model of the motor!
    – OXp1845
    Commented Jun 18, 2014 at 16:59
  • Ummh, I'd expect vibration if the pulses were getting through but in the wrong order. Just confirm that pin P1-2 (5V) is connect to stepper power and P1-6 (ground) is connected to stepper ground.
    – joan
    Commented Jun 18, 2014 at 17:12
  • The P1-2 is connected to the plus sign on the stepper, the P1-6 is connected to the minus sign on the stepper. I think I've done it like they have in this guide: scraptopower.co.uk/Raspberry-Pi/…
    – OXp1845
    Commented Jun 18, 2014 at 17:31
  • 2
    I'm not familiar with that driver board. It is shown with a jumper over the two pins adjacent to the power pins. Perhaps you need to jumper those pins?
    – joan
    Commented Jun 18, 2014 at 20:26

1 Answer 1

1

Type gpio readall in terminal and check for status of pins, if it is not OUT or not going HIGH and LOW, then check whether Device Tree is enabled or not. It should be enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.