Hi all,
I could really use your help guys!
I've looked all day on the internet for the following.
I have a EasyDriver 4.4 and I want to drive a stepper motor
with it on 12v. But I can't find any tutorials on how to operate
it though python.
Any help / links / directions are welcome!
Cheers!
- DougieLawson
- Posts: 42176
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Python + EasyDriver + Stepper motor?
Install wiringPi or pigpio or RPi.GPIO (search on here for those).
That gives you a python library that let's you set the GPIO pins high or low.
Then you should be able to do stuff following the Sparkfun instructions.
You will need to connect SJ2 to get it running at 3V3.
That gives you a python library that let's you set the GPIO pins high or low.
Then you should be able to do stuff following the Sparkfun instructions.
You will need to connect SJ2 to get it running at 3V3.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Python + EasyDriver + Stepper motor?
Thanks, will look at it!
Is it correct that the jumpers to the RPi GPIO have to have a resistor of 1K Ohm to ground?

I don't see it anywhere but in this example.
Also, don't I need to connect the ground of the RPi to the ground of the motor input?
Is it correct that the jumpers to the RPi GPIO have to have a resistor of 1K Ohm to ground?

I don't see it anywhere but in this example.
Also, don't I need to connect the ground of the RPi to the ground of the motor input?
- DougieLawson
- Posts: 42176
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Python + EasyDriver + Stepper motor?
In general all grounds should be connected together. That avoids getting stray voltage differentials.
Whether you need to pull down resistor on your Easydriver depends on the chips used on that board and what happens if you let the signals float. Read the datasheet for it.
Whether you need to pull down resistor on your Easydriver depends on the chips used on that board and what happens if you let the signals float. Read the datasheet for it.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
- davef21370
- Posts: 897
- Joined: Fri Sep 21, 2012 4:13 pm
- Location: Earth But Not Grounded
Re: Python + EasyDriver + Stepper motor?
I've written a module to control the easydriver here https://github.com/davef21370/EasyDriver it's not quite complete but could be useful.
Dave.
Dave.
Apple say... Monkey do !!
-
- Posts: 19
- Joined: Thu Dec 13, 2012 3:44 am
Re: Python + EasyDriver + Stepper motor?
Could you describe the pin assignments for your easy driver module?davef21370 wrote:I've written a module to control the easydriver here https://github.com/davef21370/EasyDriver it's not quite complete but could be useful.
Dave.
Thanks.
Re: Python + EasyDriver + Stepper motor?
I don't really know Python that well so I am unsure as to what that script is doing when.
With a stepper motor should I be able to just set the pin to 'on' and that operate the motor provided it is all wired up correctly? I am just trying to test to see if it works how I have set it up at the moment.
With a stepper motor should I be able to just set the pin to 'on' and that operate the motor provided it is all wired up correctly? I am just trying to test to see if it works how I have set it up at the moment.
- davef21370
- Posts: 897
- Joined: Fri Sep 21, 2012 4:13 pm
- Location: Earth But Not Grounded
Re: Python + EasyDriver + Stepper motor?
The motor will take a single step for each pulse on the step pin. To test the board you only need ground and step connected but do make sure the easydriver is set to 3.3V.
Dave.
Dave.
Apple say... Monkey do !!
Re: Python + EasyDriver + Stepper motor?
Ok guys, noob here.
I am confused as to where is the SJ2 located on the Easy Driver v4.4 board, for making it compatible with 3V3 RPi logic.
It has MS1, MS2, sleep, gnd and a bunch of other stuff all over but no SJ2.
In this picture:
http://schmalzhaus.com/EasyDriver/EasyD ... er_v44.png
Is it on the lower left corner where it says 3/5V?? That is the only place I figure it is but dont want to fry either the Pi or the Easy Driver
So I ask.
If it is there how and what should I solder??
Thanks..
I am confused as to where is the SJ2 located on the Easy Driver v4.4 board, for making it compatible with 3V3 RPi logic.
It has MS1, MS2, sleep, gnd and a bunch of other stuff all over but no SJ2.
In this picture:
http://schmalzhaus.com/EasyDriver/EasyD ... er_v44.png
Is it on the lower left corner where it says 3/5V?? That is the only place I figure it is but dont want to fry either the Pi or the Easy Driver
So I ask.
If it is there how and what should I solder??
Thanks..
-
- Posts: 1
- Joined: Fri May 23, 2014 7:21 pm
Re: Python + EasyDriver + Stepper motor?
Yep those are the ones that I soldered and at least it didn't explode my version is 4.4 of the easy driver.
I'm putting all together again cause I did not got the same results with arduino at 5v than with the pi on 3.3v and I want to check if its related with that (the steps where not exactly the same to get a loop)
I'll write it down later when I got it working again.
Regards,
Alex
I'm putting all together again cause I did not got the same results with arduino at 5v than with the pi on 3.3v and I want to check if its related with that (the steps where not exactly the same to get a loop)
I'll write it down later when I got it working again.
Regards,
Alex
-
- Posts: 21
- Joined: Mon Nov 05, 2012 1:59 pm
Re: Python + EasyDriver + Stepper motor?
Ok so I found an unacceptable amount of help returned from the google query "raspberry pi easy stepper python"
Therefore I bestow unto you (on behalf of rowboboat.com) the following python which will turn your stepper left and right very simply.
Therefore I bestow unto you (on behalf of rowboboat.com) the following python which will turn your stepper left and right very simply.




Code: Select all
#Step 0: Preamble
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Code Written by: Salty Scott
#Current Project: www.rowboboat.com
#This code is a very basic example of using python to control a spark fun
# easy driver. The spark fun easy driver that I am using in this example
# is connected to a 42HS4013A4 stepper motor and my raspberry pi. Pin 23
# is the direction control and pin 24 is the step control. I am using
# these components in the www.rowboboat.com project version 2.0 and I
# hope someone finds this a useful and simple example.
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Step 1: Import necessary libraries
#------------------------------------------------------------------------
#------------------------------------------------------------------------
import sys
import RPi.GPIO as gpio #https://pypi.python.org/pypi/RPi.GPIO more info
import time
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Step 2: Read arguements https://www.youtube.com/watch?v=kQFKtI6gn9Y
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#read the direction and number of steps; if steps are 0 exit
try:
direction = sys.argv[1]
steps = int(float(sys.argv[2]))
except:
steps = 0
#print which direction and how many steps
print("You told me to turn %s %s steps.") % (direction, steps)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Step 3: Setup the raspberry pi's GPIOs
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#use the broadcom layout for the gpio
gpio.setmode(gpio.BCM)
#GPIO23 = Direction
#GPIO24 = Step
gpio.setup(23, gpio.OUT)
gpio.setup(24, gpio.OUT)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Step 4: Set direction of rotation
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#set the direction equal to the appropriate gpio pin
if direction == 'left':
gpio.output(23, True)
elif direction == 'right':
gpio.output(23, False)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Step 5: Setup step counter and speed control variables
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#track the numebr of steps taken
StepCounter = 0
#waittime controls speed
WaitTime = 0.000001
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Step 6: Let the magic happen
#------------------------------------------------------------------------
#------------------------------------------------------------------------
# Start main loop
while StepCounter < steps:
#turning the gpio on and off tells the easy driver to take one step
gpio.output(24, True)
gpio.output(24, False)
StepCounter += 1
#Wait before taking the next step...this controls rotation speed
time.sleep(WaitTime)
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#Step 7: Clear the GPIOs so that some other program might enjoy them
#------------------------------------------------------------------------
#------------------------------------------------------------------------
#relase the GPIO
gpio.cleanup()
#------------------------------------------------------------------------
#------------------------------------------------------------------------
Re: Python + EasyDriver + Stepper motor?
This might help
Control stepper motor with mobile | RaspberryPi | EasyDriver
https://www.youtube.com/watch?v=pVSgOyK ... 97Dr0zH5lk
Control stepper motor with mobile | RaspberryPi | EasyDriver
https://www.youtube.com/watch?v=pVSgOyK ... 97Dr0zH5lk