First play with bipolar stepper motor and easy driver
Hello!
This is a gentle introduction to one of the coolest things in modern hardware - stepper motors. Printers, 3D printers, robotic arms, CNC machines - all it's based on stepper motors. And you can play around with it and make something cool by yourself!
During my experiments I used 17HS2408 Nema.
The main advantage of stepper motor is precision. Just imagine:
Step Angle: 0.9°
Alright, let's get to job.
Here is the connection schema.
Attention!
In all tutorials over the internet you will see a different connection of stepper motor. I spent 1 DAY to figure out that it was the reason of my problems.
There are 2 options: guys who created it are too lazy to draw proper scheme or I have a different motor. In any case, use the image above first.
Battery
It doesn't really matter which power source you will use. Mostly it will affect maximum speed. More voltage, higher RPM. But for a simple test, you can use anything you have. I used source made up from 3 x 3.7V batteries.
Code
The code itself is stupidly simple. Pin 8 - specify direction. Pin 9 - specify step. You can play around with interval and see what will happen.
void setup() {
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}
void loop() {
digitalWrite(9, HIGH);
delay(1);
digitalWrite(9, LOW);
delay(1);
}
Alright, cool!
I hope you got it working. In the next posts, I will describe the purpose of all other PINS of easy driver.