Today was a busy shopping day in Deira, Dubai. Finally found a location where I can buy electronic stuffs like resistors, capacitors, LED etc. The things I bought today was
- Regulated Power Supply
- Soldering Station
Once I was home, I started to solder the EasyDriver Stepper Motor Driver.
Basically I soldered few male header so I can fix the EasyDriver board easily to a bread board. Then connected the Stepper Motor to the driver board and needed connection to Arduino board.
#define DIR_PIN 2
#define STEP_PIN 3
int rotation=0;
int direction = 1;
int ledYellowPin = 8;
int ledRedPin = 9;
void setup() {
pinMode(DIR_PIN, OUTPUT);
pinMode(STEP_PIN, OUTPUT);
pinMode(ledYellowPin, OUTPUT);
pinMode(ledRedPin, OUTPUT);
}
void loop(){
rotation++;
if(rotation==10){
direction = direction * -1;
rotation = 0;
digitalWrite(ledYellowPin, HIGH);
digitalWrite(ledRedPin, HIGH);
delay(1000);
digitalWrite(ledYellowPin, LOW);
digitalWrite(ledRedPin, LOW);
delay(1000);
digitalWrite(ledYellowPin, HIGH);
digitalWrite(ledRedPin, HIGH);
delay(1000);
digitalWrite(ledYellowPin, LOW);
digitalWrite(ledRedPin, LOW);
delay(1000);
}
if(direction>0){
digitalWrite(ledYellowPin, HIGH);
digitalWrite(ledRedPin, LOW);
}else{
digitalWrite(ledYellowPin,LOW);
digitalWrite(ledRedPin, HIGH);
}
rotateDeg(direction * 360, 1.0);
}
void rotateDeg(float deg, float speed){
int dir = (deg > 0)? HIGH:LOW;
digitalWrite(DIR_PIN,dir);
int steps = abs(deg)*(1/0.225);
float usDelay = (1/speed) * 70;
for(int i=0; i < steps; i++){
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(usDelay);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(usDelay);
}
}
Reference: Use The EasyDriver Stepper Motor Driver + Arduino, Blink



hi bro……..can u tell me the location where in deira???? i want to buy arduino……
Hi
I lso live In Dubai, it wd be nic of you if you were a friend of mine In facebook
FB://[email protected]
So that You can help me find some electric stuff (arduino) 🙂
055 6088344
nice post!
if you dont want to buy the shield or some CI, just use some transistors tip122 to control your stepper. Take a look in this project, I’m using 4 tip 122 and a super nintendo controller to control my stepper, and the arduino off corse!
https://www.youtube.com/watch?v=TZKmCCr20KY&feature=plcp
https://www.youtube.com/watch?v=2jldAR0xdRQ
What’s the name of the shop,its location & contact details where you got your stepper motor & other electronic stuff?