Driving a tiny stepper on an Arduino (without a driver!)
I had this stepper knocking around in my junk draw. And figured it would be interesting to hook it up to an Arduino and play around with. Probing the motor showed it was a Bipolar stepper (no center tap) with 40Ohm windings.
Not really wanting to waste an EasyDriver or motor shield on it I was thinking about what else I could do. Another option was to use a ULN2003 which I’ve done before though it’s slightly problematic driving bipolar steppers with them.
In the end I figured the motor is tiny, and unlikely to require much current. The Arduino itself can source and sink up to 40mA so why not try driving it directly!
Four Arduino pins are used, a pair for each winding on the stepper:
I then used code adapted from elabz to drive the stepper (listing in the notes below). I should really also add some current limiting resistors, as without them I think I’ll be drawing about 100mA and am liable to kill my Arduino if I keep running it in this configuration. Video below shows the stepper working and describes the setup:
I really like these parts, and I’ll have to think of a project to use them in. I’ve been interested in imaging IC dies and these stepper could be used to make a cute little low profile XY stage with just enough torque to move a die around.
Notes
int motorPin1=2; int motorPin2=3; int motorPin3=4; int motorPin4=5; void setup() { // set the digital pin as output: pinMode(motorPin1, OUTPUT); pinMode(motorPin2, OUTPUT); pinMode(motorPin3, OUTPUT); pinMode(motorPin4, OUTPUT); } void loop() { digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW); delay(50); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, HIGH); delay(50); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH); delay(50); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH); delay(50); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH); delay(50); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, HIGH); delay(50); digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW); delay(50); digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW); delay(50); }