Steppers 28BYJ-48 for webcam pan-tilt

Hello all.

I am a new in steppers, so I have many questions..
First of all - I have made mini pan-tilt system for my webcam with two micro servo sg 90.
It working ok but now I want to change servos to steppers because servos are noisy and I want to make as possible silent pan-tilt.

I have bought two 28BYJ-48 5v + ULN2003 and start to testing..
But now I see that these steppers maybe not suitable for my project - they are very slow.
But I will continue to use it before I decide what other stepper I should buy.

And there is my first quiestion - how can I check the max speed of rotation of this stepper, let's say, to 90 degree ?
I need to rotate shaft from 0 to 180 or may be more but if it not going round and tear my cables.
What kind of limit should I use ?
And what code for arduino will help me to run this stepper very quickly ?
I have tried many examples but I dont understand it - just copy-paste and compile.
I want to choose one the best way for my task and learn it.
Please advise.

Steppers only hold position when powered up, so after they've been off the position won't be well defined.
(by contrast hobby servos have an absolute reference built in).

You need some means to obtain a reference position, typically a limit switch. On power-up you
need then to step till the limit switch is hit, this defines your current position, and thereafter you
can just rely on the stepper keeping accurately to the step output (assuming it has enough
torque for the load).

There are alternatives like an absolute encoder, but not commonly or cheaply available. Microswitches
are stock items.

MarkT
Thank you !
So you advise put two microswitches on the stepper in two places where shaft will get 0 and 180 degree and somehow get a signal from them to ardiuno sketch ?
But what they should switch ? How to get these signals to arduino ?
Maybe encoders are good idea, but what kind of them should I search ?

Is there any other way to know position of stepper ? I really need to do it.
May I need be some rotary encoder, but I dont know which and how to connect it to my stepper
I many time have tried to find solution in google but nothing ..

d00m:
Is there any other way to know position of stepper ? I really need to do it.
May I need be some rotary encoder, but I dont know which and how to connect it to my stepper
I many time have tried to find solution in google but nothing ..

Check out this You Tube Video. This is where I am heading to make a dividing head for my mini lathe. I want to cut brass gears, so if I need 16 teeth in my gear, I set it for 16 divisions. You may be able to use this concept

Here is the link to the video:: Infra Red Remote Controlled Arduino Dividing Head - YouTube

Harvey
in Kelowna, BC

If you have a mechanical stop then 2 methods become possible. Just rotate long enough so you know you are at the limit. Or use my library to detect the change in current to a winding when it hits the stop. Only a resistor is needed for hardware using this code.

harriscreekcentral

Thank you. So did you use encoder in your project ? And seems you used nema23 motor - seems easy install encoder because of size of motor..
in my case I have only my little stepper (
Also I will try to use nema11, but I still need to know which encoders should I use.

sbright33
Thank you too. Could you please give some examples of code with your library ? I am really interested with it but still can't understand how to use your functions (

Check out the beginning of this post. You can test my code with only 1 line or by uncommenting a few lines in my Setup()/Loop().
http://arduino.cc/forum/index.php/topic,89159.0

Here's the newest code:

Start with this in loop():
degrpmslowCool(1,180*100,1000); //180 degrees at 10 rph speed

which calls:
void degrpmslowCool(boolean bcw, long deg100, int rph100)

Sbright33 do you have plans to turn your code into a library at some point? Are there specific tests you would like people to do or just try and break it? I got one of the 28BYJ-48/ULN2003 combos mostly just to play around with (and partially because I couldn't believe it only cost $2.50).

Hi D00m

Thank you. So did you use encoder in your project ? And seems you used nema23 motor - seems easy install encoder because of size of motor..
in my case I have only my little stepper (

Just to keep things straight, I am kinda jumping from one project to the next. My FIRST encounter was using the 28BYJ-48-5 motor and the little ULN2003 board that comes with it from Ebay. I got this set up running but only at 1 rpm. I have to go in and change the code to increase the speed, and maybe also figure out how to write the code to go Clockwise and Counter clockwise. At my age (75) codes are definately a foreign language. But I am here to have fun.

My second project is from the Arduino "UNO" c/w the 1602 LCD Shield, and using the A4988 or 4983 board to now make this little (28BYJ-48-5) motor react to the command that I program into the LCD Screen. This is where I refered you to the Chuck Fellows YouTube video so you could see what I was trying to do. So far I have the motor buzzing, but I will not advance or retract a position. I read in one of the postings to try editing the pin sequence. So again I'm back to the "Learning Experiences". To answer you question I am using no encoder.

RWiens, Just try it and enjoy! Any suggestions for improvements?

When I'm finished making improvements I'll make it into a real Library.