nicksydney
New Member
Hi,
Managed to salvage stepper motor from a CD ROM and now I'm trying to connect it to Arduino to see if I can make it rotate. Following are the steps that I have taken so far
----------------------------------------------
How did I find which pin does what ?
----------------------------------------------
Using a 3v cell coin battery I tried to find which connection from the flex cable is ground (you can see the labelling of the connection in the file 'marked.jpg' and I found that the left most seems to be ground as when I put the negative of the battery in there and move around the positive of the battery I can see the motor move or have a jerk movement and this happens for all the 3 connections after the ground connection (as I've labelled + in 'marked.jpg')
Thinking that I found the connection so I dive into Arduino
-------------------------
What I did in Arduino
--------------------------
I followed this website for the configuration https://www.azega.com/controlling-a-stepper-motor-with-an-arduino-part-2/#more-151. In my configuration I just connect 2 connection (the connection after the ground) to pin 7 and 8 and I use NPN transistor with 2.2k resistor on the base and only use diode at the collector 1N4002 to avoid feedback from the motor.
I connect the ground of the Arduino to the ground connection of the motor that I labelled G (as seen in 'marked.jpg') while connecting pin 7 and 8 of Arduino to the next 2 connection after the G in the motor. I used the following code
#include <Stepper.h>
// change this to the number of steps on your motor
#define STEPS 200
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 7, 8);
void setup()
{
// Initialize random number generator
randomSeed(analogRead(5));
}
void loop()
{
// Pick a random direction and distance to move
int rand = random(-200, 200);
// Pick a random speed
int spd = random(25, 100);
// Go
stepper.setSpeed(spd);
stepper.step(rand);
delay(1000);
}
taken from this website https://www.azega.com/controlling-a-stepper-motor-with-an-arduino/
But so far I got nothing, running the Arduino does not yield anything as I can't see the motor move at all.
The funny thing is if I just use battery and connect it to the motor (connecting + of battery to the connector after the G in the motor while connecting - of the battery to G of the motor) I can see I'm getting jolt.
Not sure if I have identify the connection correctly or there is something that I overlooked.
Appreciate any help
Cheers
Managed to salvage stepper motor from a CD ROM and now I'm trying to connect it to Arduino to see if I can make it rotate. Following are the steps that I have taken so far
----------------------------------------------
How did I find which pin does what ?
----------------------------------------------
Using a 3v cell coin battery I tried to find which connection from the flex cable is ground (you can see the labelling of the connection in the file 'marked.jpg' and I found that the left most seems to be ground as when I put the negative of the battery in there and move around the positive of the battery I can see the motor move or have a jerk movement and this happens for all the 3 connections after the ground connection (as I've labelled + in 'marked.jpg')
Thinking that I found the connection so I dive into Arduino
-------------------------
What I did in Arduino
--------------------------
I followed this website for the configuration https://www.azega.com/controlling-a-stepper-motor-with-an-arduino-part-2/#more-151. In my configuration I just connect 2 connection (the connection after the ground) to pin 7 and 8 and I use NPN transistor with 2.2k resistor on the base and only use diode at the collector 1N4002 to avoid feedback from the motor.
I connect the ground of the Arduino to the ground connection of the motor that I labelled G (as seen in 'marked.jpg') while connecting pin 7 and 8 of Arduino to the next 2 connection after the G in the motor. I used the following code
#include <Stepper.h>
// change this to the number of steps on your motor
#define STEPS 200
// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 7, 8);
void setup()
{
// Initialize random number generator
randomSeed(analogRead(5));
}
void loop()
{
// Pick a random direction and distance to move
int rand = random(-200, 200);
// Pick a random speed
int spd = random(25, 100);
// Go
stepper.setSpeed(spd);
stepper.step(rand);
delay(1000);
}
taken from this website https://www.azega.com/controlling-a-stepper-motor-with-an-arduino/
But so far I got nothing, running the Arduino does not yield anything as I can't see the motor move at all.
The funny thing is if I just use battery and connect it to the motor (connecting + of battery to the connector after the G in the motor while connecting - of the battery to G of the motor) I can see I'm getting jolt.
Not sure if I have identify the connection correctly or there is something that I overlooked.
Appreciate any help
Cheers