Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Stepper motor

Status
Not open for further replies.

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
 

Mr RB

Well-Known Member
Yeah it looks brushless. The copper tracks have 4 large tracks which I assume are for the 2 motor windings, and 4 skinny tracks which are probably connected to two magnetic (hall) sensors.

It should run using a bipolar stepper motor driver or two phase BLDC driver.
 

4pyros

Well-Known Member
Most Helpful Member
and 4 skinny tracks which are probably connected to two magnetic (hall) sensors.
They go to the other side of the board not the motor.
 

dr pepper

Well-Known Member
Most Helpful Member
A bldc motor will work from a stepper driver, but you wont get much speed or torque.
There are sensorless bldc's which dont have any feedback, microchip has a app note for a pic micro to drive one.
I have a schematic that drives a bldc using one phase, it only produces a fraction of the motors capacity torque wise, but on the motors I've tried it the speed was very high, gyroscope high.
Let me know I'll dig it out if you want.
 

nicksydney

New Member
I have a schematic that drives a bldc using one phase, it only produces a fraction of the motors capacity torque wise, but on the motors I've tried it the speed was very high, gyroscope high.
Let me know I'll dig it out if you want.

Hi,

Please do post it if you can.

Cheers
 

dr pepper

Well-Known Member
Most Helpful Member
Ok then, I'll point out this is not my idea, I copied the schematic off the net, I dont claim credit for this one, by the way the motors I ran with this worked best with a 100n cap, and I used a irf540 and a irf740 fet both were ok, I also disnt bother with either transistors or the 1 k resistors, I just connected pin 7 of the '741 to +12, I didnt need speed or tach signals.
Heres the schem:

hdd.jpg

And heres a youtube link to it:

https://www.youtube.com/watch?v=LwruLrhchcE
 
Last edited:

nicksydney

New Member
Hi,

Thanks all for the answer. I got a ULN2003APG in my parts bin so I thought I give that a go, but I'm still stuck. I tried following the attached schematics from this website https://robotics.hobbizine.com/ulndrive.html and I connect it to the Arduino.

I connect Pin 4 of Arduino to Pin 1 of ULN while the rest of the ULN pin I connect as follows:

Pin 8 ==> 9v (+) power supply (look at my question 2 for my explanation about why I connect Pin 8 to 9v batterY)

Pin 16 ==> output pin connected to one of the connector of the motor

The ULN is powered by an external 9v battery and the GND of the 9v I connect to the GND of Arduino (this is right ?). The code that I'm running in Arduino is simple just on and off Pin 4 with delay of 100.

Two things I tried and come out with something weird:

(1) I connect Pin 16 to the connector of the brush but nothing move at all, I tried the different connector in the motor but nothing budge, I was expecting at least it will have a sudden movement, but when I connect Pin 16 of the ULN to a LED with the (-) of the LED to the GND I can see the LED blinking and when I change the delay I can see it blinks accordingly which means Pin 16 is working, but my question is why the motor is not budging ?

(2) According to the ULN2003APG specification Pin 8 must be connected to GND and Pin 9 connected to (+) of the battery, but when I do this I can't see the LED light at all but when I connect Pin 8 to the (+) of the 9v battery is light up very brightly, what am I doing wrong here ?

Thanks for the help.

Cheers
 

alec_t

Well-Known Member
Most Helpful Member
what am I doing wrong here ?
In the second pic the IC doesn't seem to be connected to anything. Pin 8 must go to GND and pin 9 to +V, otherwise current may flow the wrong way inside the IC and do damage. Does the LED have a series resistor which pulls up to +V(the IC outputs are open-collector)? Is the LED cathode connected to the IC output?
 
Last edited:

dr pepper

Well-Known Member
Most Helpful Member
Did you figure out which connections on the motor are which, there will be 3 windings and one common, you can find the common as its the only one with a lower resistance to any other connection with a multimeter.
Also you could connect up the battery direct to the motor, just briefly touch the motor wires to the battery to see if it will step, maybe the motor is faulty or too high a voltage for your battery (unlikely though if its a cd rom motor).
Your schematic looks ok, except that a cd rom spindle motor if its a bldc will only have 3 windings not 4.
 
Last edited:

nicksydney

New Member
Did you figure out which connections on the motor are which, there will be 3 windings and one common

There is one connection that has got 3 windings into 1 which I presume this is common right ? while the rest of the connection has got only 1 winding total of 4 windings (including common).
 

nicksydney

New Member
In the second pic the IC doesn't seem to be connected to anything. Pin 8 must go to GND and pin 9 to +V, otherwise current may flow the wrong way inside the IC and do damage. Does the LED have a series resistor which pulls up to +V(the IC outputs are open-collector)? Is the LED cathode connected to the IC output?


Sorry when I took the picture I disassemble everything, attached is the breadboard with everything in it.

Made the following changes and made a slight progress:

1. I connect the motor common connection to GND on the breadboard and wired up the ULN2003 and took the plunge by connecting the output to the motor, the ULN is connected to 9v battery. I didn't connect GND of the ULN2003 to breadboard GND as if I do that the whole the ULN2003 does not work. With this setup I was able to connect one the output pin to the motor and it make a sudden quick move which I assume shows that the motor is receiving the signal

2. I tried using a single transistor to see if I can make the motor move slightly but was not able to do . What I notice the current coming out from transistor is much lower than if I use ULN2003, so I assume the current produce by ULN2003 is very strong that it's able to make the motor move slightly ? is this a correct assumption.

Most of the diagram about brushless motor does not shows connection from the motor to GND, but why is it mine does not want to move if I don't connect common to GND, is this common ?

Thanks
 

alec_t

Well-Known Member
Most Helpful Member
Your motor apparently has three coils, each having one end connected to a common point. If that common point is GND (as you have it now) then the other ends of the coils have to be connected in sequence to a voltage source to make the motor rotate. The 2003 can't do that because its outputs are open-collector. Instead you need to connect the common point of the coils to +V and use the 2003 to connect the other ends of the coils in sequence to GND. So connect the IC pin 8 to GND and connect pin 9 to +V (so that voltage spikes produced when the coils switch off are suppressed and don't damage the IC).
 
Last edited:

shortbus=

Well-Known Member
Most Helpful Member
If I'm not mistaken, the common wire is the V+ supply. The other three are grounded in the correct order to make the motor turn. Some BLDC motors are also wound in the "delta" configuration while it seems that yours is wound in the "star" configuration.
 

4pyros

Well-Known Member
Most Helpful Member
Most of the diagram about brushless motor does not shows connection from the motor to GND, but why is it mine does not want to move if I don't connect common to GND, is this common ?
You need to figer out just how it is wired.
Maybe you need to take it apart.
And then look here;
https://www.bavaria-direct.co.za/models/motor_info.htm
Yes most BLDC Motors only have three wires.
You need to find the ones you need to use and how to use them.
Like this;
https://www.youtube.com/watch?v=q4Od94fsfqs
 
Last edited:

nicksydney

New Member
Your motor apparently has three coils, each having one end connected to a common point. If that common point is GND (as you have it now) then the other ends of the coils have to be connected in sequence to a voltage source to make the motor rotate. The 2003 can't do that because its outputs are open-collector. Instead you need to connect the common point of the coils to +V and use the 2003 to connect the other ends of the coils in sequence to GND. So connect the IC pin 8 to GND and connect pin 9 to +V (so that voltage spikes produced when the coils switch off are suppressed and don't damage the IC).

Does this mean that I still have to configured the 2003 to Arduino pins too ? and make PWM via code on the pins that are connected to the 2003 ?
 

nicksydney

New Member
Your motor apparently has three coils, each having one end connected to a common point. If that common point is GND (as you have it now) then the other ends of the coils have to be connected in sequence to a voltage source to make the motor rotate. The 2003 can't do that because its outputs are open-collector. Instead you need to connect the common point of the coils to +V and use the 2003 to connect the other ends of the coils in sequence to GND. So connect the IC pin 8 to GND and connect pin 9 to +V (so that voltage spikes produced when the coils switch off are suppressed and don't damage the IC).

Hi,

I rewired the ULN2003 again but this time I tried it out using LED and not motor and was able to make the LED flash on the output, I have posted a youtube video https://www.youtube.com/watch?v=U8ZnzA0iqFk&feature=youtu.be to show the circuit setup but there are 2 things I don't understand and I mentioned that in the video too:

(1) The flashing of the LED shows very clearly if I don't connect the GND of the battery to Arduino GND but it's not bright which means less current is going through it, but when I connect the battery GND I can see the LED is very bright and even if the flashing is not very obvious to my eye but if I focus myself enough to the LED I can see a very weak blink but not totally like ON and OFF blink but you can see the LED go slightly dim and bright again continously.

(2) When I connect the output pin that the LED is connected to pin 8 of the ULN the LED lit up very bright but the flashing was very obvious as can be seen from the video.

Any feedback is appreciated.

Cheers
 

nicksydney

New Member
Just to add to my previous post another thing that I tried after trying out the LED was I connect the common connection of the motor to the positive of the battery and connected the output pin of the ULN to one of the motor connection but I can't see any movement at all, seems like it's not making any difference to it.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top