Upload
anonymous-ef1tufho
View
315
Download
1
Embed Size (px)
Citation preview
8/18/2019 Datasheet BYJ48 Stepper Motor - All
1/21
let's make Explore (/tag/type- id/) Publish (/about/create.jsp)Login (/account/login) | Sign Up (/account/gopro?sourcea=header${sourceaurlPar
eatured: Intel IoT(/id/intel/) Laser Cutting(/tag/type-id/categor y-workshop/channel-laser-cutting/)
Life Hacks(/tag/type-id/category-home/channel-life-hacks/) Fusion 360(/id/Fusion/)
Stepper Motor is a motor controlled by a series of electromagnetic coils. The
center shaft has a series of magnets mounted on it, and the coils surrounding
the shaft are alternately given current or not, creating magnetic fields which
repulse or attract the magnets on the shaft, causing the motor to rotate.
This design allows for very precious control of the motor,There are two basic
types of stepper motors, unipolar steppers and bipolar steppers .
In This instructable , I will talk about an Unipolar Stepper Motor 28-BYJ48 .
The unipolar stepper motor has five or six wires and four coils (actually two coils
About This Instructable
8
310.374 views
295 favorites
License:
(/member/Mohannad+Rawashdeh/)
Mohannad Rawashdeh(/member/Mohannad+RaMohannad Rawashdeh(http://www.genotronex.com/)
Follow 235
More by Mohannad Rawashdeh:
(/id/Motor-Driver-
BTS7960-43A/)
(/id/BYJ48-Stepper-Motor/)
(/id/RF-315433-MHz-
Transmitter-receiver-Module-and-Ardu/)
stepper motor (/tag/type-id/keyword-stepper%20motor/)
arduino (/tag/type-id/keyword-arduino/)
BYJ48 (/tag/type-id/keyword-BYJ48/)
Driver (/tag/type-id/keyword-Driver/)
ULN2003 (/tag/type-id/keyword-ULN2003/)
stepper (/tag/type-id/keyword-stepper/)
DC (/tag/type-id/keyword-DC/)
Module (/tag/type-id/keyword-Module/)
Tags:
Related
)
Download (/id/BYJ48-Stepper-Motor/?download=pdf)
Favorite I Made it!
Collection
BYJ48 Stepper Motor by Mohannad Rawashdeh (/member /Mohannad+Rawashdeh/)
4 Steps
Share
h
(/id/BYJ48-Stepper-Motor/)
share what you make
http://www.instructables.com/tag/type-id/keyword-DC/http://www.instructables.com/tag/type-id/keyword-Driver/http://www.instructables.com/tag/type-id/keyword-ULN2003/http://www.instructables.com/tag/type-id/keyword-Module/http://www.instructables.com/id/BYJ48-Stepper-Motor/http://www.instructables.com/member/Mohannad+Rawashdeh/http://www.instructables.com/id/BYJ48-Stepper-Motor/?download=pdfhttp://www.instructables.com/http://www.instructables.com/tag/type-id/keyword-Module/http://www.instructables.com/tag/type-id/keyword-DC/http://www.instructables.com/tag/type-id/keyword-stepper/http://www.instructables.com/tag/type-id/keyword-ULN2003/http://www.instructables.com/tag/type-id/keyword-Driver/http://www.instructables.com/tag/type-id/keyword-BYJ48/http://www.instructables.com/tag/type-id/keyword-arduino/http://www.instructables.com/tag/type-id/keyword-stepper%20motor/http://www.instructables.com/id/RF-315433-MHz-Transmitter-receiver-Module-and-Ardu/http://www.instructables.com/id/BYJ48-Stepper-Motor/http://www.instructables.com/id/Motor-Driver-BTS7960-43A/http://www.genotronex.com/http://www.instructables.com/member/Mohannad+Rawashdeh/http://www.instructables.com/member/Mohannad+Rawashdeh/http://www.instructables.com/file/F65M3G8HMMF4YRG/http://www.instructables.com/file/FI0SQ71HMMF4YR9/http://www.instructables.com/file/FRWXF7GHMMF4YR8/http://www.instructables.com/id/Fusion/http://www.instructables.com/tag/type-id/category-home/channel-life-hacks/http://www.instructables.com/tag/type-id/category-workshop/channel-laser-cutting/http://www.instructables.com/id/intel/http://www.instructables.com/account/gopro?sourcea=header${sourceaurlParams}http://www.instructables.com/account/loginhttp://www.instructables.com/about/create.jsphttp://www.instructables.com/tag/type-id/
8/18/2019 Datasheet BYJ48 Stepper Motor - All
2/21
divided by center connections on each coil). The center connections of the coils
are tied together and used as the power connection. They are called unipolar
steppers because power always comes in on this one pole.
Step 1: Specification , Motor Driver
There are many Types of Drivers , L293 , ULN2003 , A3967SLB
(https://www.sparkfun.com/datasheets/Robotics/A3967.pdf), And More ,
The 28-BYJ48 Even comes with Breakout using ULN2003 As a Motor driver
chip .
Show All Items
28BYJ-48 Stepper Motor
Control System Based On
Arduino With ULN2003 Chip
(/id/28BYJ-48-Stepper-Motor-
Arduino Library for 28BYJ-48
Stepper Motor and ULN2003
Driver (/id/Arduino-Library-
for-28BYJ-48-Stepper-Motor-
An Arduino-powered
microplate
spectrophotometer (/id/An-Arduino-powered-microplate-
Small Solar Room
Temperature Regulator
(/id/Small-Solar-Room-
Temperature-Regulator/)
The "all in one box"
aquarium feeder (/id/The-all-
in-one-box-aquarium-feeder/)
by Brian from Belgium
http://www.instructables.com/member/Brian+from+Belgium/http://www.instructables.com/id/The-all-in-one-box-aquarium-feeder/http://www.instructables.com/id/The-all-in-one-box-aquarium-feeder/http://www.instructables.com/member/ChanL2/http://www.instructables.com/id/Small-Solar-Room-Temperature-Regulator/http://www.instructables.com/id/Small-Solar-Room-Temperature-Regulator/http://www.instructables.com/id/An-Arduino-powered-microplate-spectrophotometer/http://www.instructables.com/id/An-Arduino-powered-microplate-spectrophotometer/http://www.instructables.com/id/Arduino-Library-for-28BYJ-48-Stepper-Motor-and-ULN/http://www.instructables.com/id/Arduino-Library-for-28BYJ-48-Stepper-Motor-and-ULN/http://www.instructables.com/id/28BYJ-48-Stepper-Motor-Control-System-Based-On-Ard/http://www.instructables.com/id/28BYJ-48-Stepper-Motor-Control-System-Based-On-Ard/http://www.instructables.com/file/FXTLPI9HMMF4YXN/http://www.instructables.com/file/F68GVS8HMMF4YXM/http://www.instructables.com/file/F4107VIHMMF4YXL/http://www.instructables.com/file/F0SUW4EHMMF4YXK/http://www.instructables.com/file/F45YX55HMMF4YXJ/http://www.instructables.com/file/FP5CJZCHMWVZPBT/https://www.sparkfun.com/datasheets/Robotics/A3967.pdf
8/18/2019 Datasheet BYJ48 Stepper Motor - All
3/21
Specification for this Motor " And you can download datasheet from the
attachment "
Rated voltage 5VDC
Number of Phase 4
Speed Variation Ratio 1/64
Stride Angle 5.625° /64
Frequency 100Hz
DC resistance 50Ω±7%(25℃)
Idle In-traction Frequency > 600Hz
Idle Out-traction Frequency > 1000HzIn-traction Torque >34.3mN.m(120Hz)
Self-positioning Torque >34.3mN.m
Friction torque 600-1200 gf.cm
Pull in torque 300 gf.cm
Insulation grade A
and the schematics of This breakout shown like the Pictures on the attachment
Note that if you want to use L293 Instead of ULN2003 , You will need to leave
Red wire No connection .
Materials :
you will need :
1) Arduino Board .
2) BYJ48 Stepper Motor 5v
3) ULN2003 Moror driver Module
4) Jumper .
5) 5v voltage source "Optional" .
28BYJ-48.pdf (/files/orig/FQY/RHST/HMVJ7U24/FQYRHSTHMVJ7U24.pdf)
Step 2: Arduino Code .
http://www.instructables.com/files/orig/FQY/RHST/HMVJ7U24/FQYRHSTHMVJ7U24.pdf
8/18/2019 Datasheet BYJ48 Stepper Motor - All
4/21
The Arduino IDE Support a Library for Stepper Motor , Very Easy to use , After
Connect Motor with arduino You can Upload the Sketch on to the arduino .
But ...
You must take something in consider :
This Motor has a Gear ratio of 64 , and Stride Angle 5.625° so this motor has a
http://www.instructables.com/file/FZGPTQ4HMMF4Z5S/http://www.instructables.com/file/FEOP930HMMF4Z5R/http://www.instructables.com/file/FB6LOAWHMMF4Z5Q/http://www.instructables.com/file/FT68TVVHMMF4Z5P/http://www.instructables.com/file/FXRWP1EHMMF4Z5O/
8/18/2019 Datasheet BYJ48 Stepper Motor - All
5/21
4096 Steps .
steps = Number of steps in One Revolution * Gear ratio .
steps= (360°/5.625°)*64"Gear ratio" = 64 * 64 =4096 . this value will
substitute it on The arduino Sketch
For adafruit Stepper Motor (http://www.adafruit.com/products/918) , the Stride
Angle 7.5° and Gear ratio is 16 , So number of steps in 1 Revolution is :
steps in One Revolution = 360 / 7.5 = 48 .
steps= 48 * 16 = 768
That's will be different depend on what motor you are using , So check The
Datasheet for Your stepper Motor to calibrate this values
28-BYJ48 Motor Datasheet (http://robocraft.ru/files/datasheet/28BYJ-
48.pdf).
Motor Driver ULN2003 BreakOut Connected To Arduino From IN1 - IN4 To D8 -
D11 Respectively
To Power you Motor , Recommanded to use external Power Supply with 5V-500mA at least , Don't power it directly from arduino Board 5V .
Step 3: Library Direction Issue ... And how to fix it .
When You Upload the sketch to the arduino , The Motor will Be rotate in one
direction By type the command :
step(steps);
http://www.instructables.com/file/FG9S3MRHMWVZNZR/http://www.instructables.com/file/FBD8BUKHMWVZNZQ/http://robocraft.ru/files/datasheet/28BYJ-48.pdfhttp://www.adafruit.com/products/918
8/18/2019 Datasheet BYJ48 Stepper Motor - All
6/21
So you must Put the Number of step to turn the motor .
The reference (http://arduino.cc/en/Reference/StepperStep) said You can put
the positive value to turn one direction, negative to turn the other.
If that's OK With Your stepper Motor , You don't need to read the following .
If Not , Your Motor turn to same direction even you Put the steps Positive Value
or negative , What is the issue ?
This Motor need to operate as the Table on the attachment .
the arduino Stepper Library need to modify to match this requirement .
I wrote a code which is allow to this motor to Move clockwise and counter clock
wise
Code in the next step :
Step 4: Modify Code
the final code for this Stepper motor :
http://www.instructables.com/file/FV9LEN8HMWVZP97/http://arduino.cc/en/Reference/StepperStep
8/18/2019 Datasheet BYJ48 Stepper Motor - All
7/21
/*
BYJ48 Stepper motor code
Connect :
IN1 >> D8
IN2 >> D9
IN3 >> D10
IN4 >> D11
VCC ... 5V Prefer to use external 5V Source
Gnd
written By :Mohannad Rawashdeh
http://www.instructables.com/member/Mohannad+Rawashdeh/
28/9/2013*/
#define IN1 8
#define IN2 9
#define IN3 10
#define IN4 11
int Steps = 0;
boolean Direction = true;// gre
unsigned long last_time;
unsigned long currentMillis ;
int steps_left=4095;
long time;
void setup(){
Serial.begin(115200);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
// delay(1000);
}
void loop()
{
while(steps_left>0){
currentMillis = micros();if(currentMillis-last_time>=1000){
stepper(1);
time=time+micros()-last_time;
last_time=micros();
steps_left--;
}
}
Serial.println(time);
Serial.println("Wait...!");
delay(2000);
Direction=!Direction;
steps_left=4095;
}
void stepper(int xw){
for (int x=0;x
8/18/2019 Datasheet BYJ48 Stepper Motor - All
8/21
digitalWrite(IN3, HIGH);
digitalWrite(IN4, HIGH);
break;
case 2:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 3:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 4:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 5:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);digitalWrite(IN4, LOW);
break;
case 6:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 7:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);break;
default:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
}
SetDirection();
}
}
void SetDirection(){
if(Direction==1){ Steps++;}if(Direction==0){ Steps--; }
if(Steps>7){Steps=0;}
if(Steps
8/18/2019 Datasheet BYJ48 Stepper Motor - All
9/21
We have a be nice comment policy.
Please be positive and constructive. w I Made it! Add Images Post Comment
Reply7 days ago
Reply4 days ago
Reply6 days ago
Reply6 days ago
Stepper Motor 28 BYJ48 Arduino
rabiuls (/member/rabiuls)
Thank you very much, it works!! But the stepper motor gets
very hot, I am using 12v. Is it ok?
Alderin (/member/Alderin) .
rabiuls (/member/rabiuls)
It is very common for stepper motors to get hot. Many 3d printer and CNC
mill designs include heatsinks and fans on each stepper motor, and inrobust designs a temperature sensor is added to each stepper to allow the
control circuits to shut down before the motor is damaged.
he ULN2003 is pretty much just an amperage amplifier that steps up the
rduino's power signal to be enough for the motor. Specialized stepper
motor drivers have different amperage settings for 'moving' and 'holding'states, which can drastically lower heat and power usage. They are a bit
more expensive, though.
ith that all said, the typical use for this stepper motor does not have a
dedicated fan, and generally no temperature based shut-off. It is probably
not getting too hot for its design, but if you are concerned, adding a 40mman ( like this one: http://www.digikey.com/product-detail/en/sunon-
ans/HA40101V4-000U-999/259-1616-ND/3694183 ) wouldn't hurt.
nbc12 (/member/nbc12) .
rabiuls (/member/rabiuls)
Depends on your amperage, though it is normal for steppers to get a little
warm, so you're probably fine
AbuM12 (/member/AbuM12)
hello
http://www.instructables.com/member/AbuM12http://www.instructables.com/member/rabiulshttp://www.instructables.com/member/nbc12http://www.instructables.com/member/rabiulshttp://www.instructables.com/member/Alderinhttp://www.instructables.com/member/rabiulshttps://www.youtube.com/watch?v=6zlxlOrSh-Q
8/18/2019 Datasheet BYJ48 Stepper Motor - All
10/21
Replya month ago
Replya month ago
Reply
a month ago
Reply2 months agoX
Reply2 months ago
Reply2 months agoX
8
Its mostako, I am very new to stepper motor control with Arduino.
I need to rotate my stepper motor 28byj-48, ULN2003 driver IC both in forward and in reverse direction when the
respective push button is pressed.
I have I have a stepper motor, ULN2003, arduino and two
push button
Please provide me a code for arduino such that i can rotate
the stepper in both direction only when push button is
pressed
My email id is [email protected]
CaptainZ (/member/CaptainZ)
Thanks, just what I needed to make sure my board wasgood. I changed the pins to the ones for a nano and it
started right up.
Meterry52 (/member/Meterry52)
Cool project! Only took minutes to get it going! Thank you!!!!
WillandsometimesWendyK (/member/WillandsometimesWendyK)
This was great! Helped me a lot - thank you muchly!
Thank you for posting this. My steppers had the direction problem so your fix is
greatly appreciated.
(http://cdn.instructables.com/FUN/PU82/IKVFUWCJ/FUNPU82IKVFUWCJ.LARGE.jpg)
rizawerks (/member/rizawerks)
thanks for tutorial :)
TheElectromania (/member/TheElectromania)
Worked perfectly... can you please put comments on your
sketch code, to understand the logic.
I would like to control speed and rotate it 360deg
JamalN1 (/member/JamalN1)
MarcusBlaisdell (/member/MarcusBlaisdell) made it!
http://www.instructables.com/member/MarcusBlaisdellhttp://www.instructables.com/member/JamalN1http://www.instructables.com/member/TheElectromaniahttp://www.instructables.com/member/rizawerkshttp://cdn.instructables.com/FUN/PU82/IKVFUWCJ/FUNPU82IKVFUWCJ.LARGE.jpghttp://www.instructables.com/member/WillandsometimesWendyKhttp://www.instructables.com/member/Meterry52http://www.instructables.com/member/CaptainZ
8/18/2019 Datasheet BYJ48 Stepper Motor - All
11/21
Reply3 months ago
Reply3 months ago
Reply3 months ago
Reply3 months ago
Reply4 months ago
Reply5 months ago
Reply5 months ago
Reply5 months ago
Can you plz add commentals in the code to explain it
MartynSudworth (/member/MartynSudworth)
My setup would do nothing until i realised the pin marked
"+" wasn't actually connected to anything (on the motor board). When i connected 5v to both the two pins
previously jumpered together (like your image above) itburst into life. Do i have a badly designed motor board?
MartynSudworth (/member/MartynSudworth) .
MartynSudworth
(/member/MartynSudworth)
on further examination i find this: pin 1 (marked "-") is
ground, as it should be). Pin 2 (marked "+") not
connected. Pin 3 is connected to "com" on uln chip,so should be 5v. Pin 4 connected through the LEDs
to the motor a to the uln outputs. I put 5v on this aIso.Implies you can split the power to drive a different
power stepper? Odd, what do people think?
CalvT1 (/member/CalvT1)
Many thanks, works well.
aurelien.a.walker (/member/aurelien.a.walker)
Hello,
And thanks for your help. Now i understand :-)
I try to do a program who control my motor with a pusher
button.
When i push the button, i would that my motor do a step of
25°.
Could you help me?
MatthewW80 (/member/MatthewW80)
Hi, I have followed your instructions and it worked fine. I
have built on your code and make what I think to be a
neater implementation. Here is my github repo with it in,hope someone finds it useful.
https://github.com/mattcow12/BYJ48-Stepper/tree/master
JonGolcha (/member/JonGolcha) .
MatthewW80 (/member/MatthewW80)
Thanks for sharing your code Matthew, this is indeed
useful :)
malijai (/member/malijai)
http://www.instructables.com/member/malijaihttp://www.instructables.com/member/MatthewW80http://www.instructables.com/member/JonGolchahttp://www.instructables.com/member/MatthewW80http://www.instructables.com/member/aurelien.a.walkerhttp://www.instructables.com/member/CalvT1http://www.instructables.com/member/MartynSudworthhttp://www.instructables.com/member/MartynSudworthhttp://www.instructables.com/member/MartynSudworth
8/18/2019 Datasheet BYJ48 Stepper Motor - All
12/21
Thanks for your code. I managed to have my Uno control the same
stepper motor, whereas I could not with other examples. The code could
be made simpler though.
Here is my attempt, using arrays, renaming variables and simplifying control
/*BYJ48 Stepper motor code
Connect :IN1 >> D8
IN2 >> D9
IN3 >> D10IN4 >> D11
VCC ... 5V Prefer to use external 5V SourceGnd
written By :Mohannad Rawashdeh
http://www.instructables.com/member/Mohannad+Rawashdeh/28/9/2013
*/
#define IN1 8
#define IN2 9#define IN3 10
#define IN4 11
const int NBSTEPS = 4096;const int STEPTIME = 900;
int Step = 0;boolean Clockwise = true;
int arrayDefault[4] = {LOW, LOW, LOW, LOW};
int stepsMatrix[8][4] = {{LOW, LOW, LOW, HIGH},
{LOW, LOW, HIGH, HIGH},
{LOW, LOW, HIGH, LOW},{LOW, HIGH, HIGH, LOW},
{LOW, HIGH, LOW, LOW},{HIGH, HIGH, LOW, LOW},
{HIGH, LOW, LOW, LOW},
{HIGH, LOW, LOW, HIGH},};
unsigned long lastTime;
unsigned long time;
void setup(){
Serial.begin(9600);Serial.println("Starting...");
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);}
void loop(){unsigned long currentMicros;
int stepsLeft = NBSTEPS;time = 0;
while(stepsLeft > 0){
currentMicros = micros();if(currentMicros - lastTime >= STEPTIME){
stepper();time += micros() - lastTime;
lastTime = micros();
stepsLeft--;}
8/18/2019 Datasheet BYJ48 Stepper Motor - All
13/21
Reply5 months ago
Reply5 months ago
Reply6 months ago8
}Serial.println(time);
Serial.println("Wait...!");
delay(2000);Clockwise = !Clockwise;
stepsLeft = NBSTEPS;}
void writeStep(int outArray[4]){for (int i=0;i < 4; i++){
digitalWrite(IN1 + i, outArray[i]);
}
}
void stepper(){
if ((Step >= 0) && (Step < 8)){
writeStep(stepsMatrix[Step]);}else{
writeStep(arrayDefault);}
setDirection();
}
void setDirection(){(Clockwise) ? (Step++) : (Step--);
if(Step>7){Step=0;
}else if(Step
8/18/2019 Datasheet BYJ48 Stepper Motor - All
14/21
Reply
6 months ago
Reply6 months ago
8
Reply6 months ago8
Reply6 months ago
8
Reply6 months ago
Reply7 months ago
Reply6 months ago
My stepper motor seem to be broken.. or do i have a power problem? It only
turns when i give it a little help... rest works fine.... it only vibrates if i dont help it
turn with my fingers.. so guess its broken... that sucks
GavinS11 (/member/GavinS11) .
vandenbrande (/member/vandenbrande)
Make sure your pins are mapped right. Mine was doing thatbecause I had pins 8 & 9 flipped
vandenbrande (/member/vandenbrande) .
GavinS11 (/member/GavinS11)
Yes i know i used 2 blue cables and i wasnt sober lol.... but thanks see my other comment that i left
after that... it works fine..
vandenbrande (/member/vandenbrande)
Fixed it.. just being stoned.. used 2 blue cables lol.. and
gues what? i put in3 on pin 11
and in4 on pin 10... lol ok then nothing broken here
vandenbrande (/member/vandenbrande) .
vandenbrande (/member/vandenbrande)
And thanks man! nice tutorial mohannad
jaysonl ooi (/member/jayson looi)
Hello guys, I'm new here. May I know where can i get
stepper motor's library? TQ
AshleyO3 (/member/AshleyO3)
Your tutorial is helping me a lot in my project! I'm just a
beginner, and this is one of my first circuits I'm building in
real life. Can OP or someone tell/show me how thisexample connects to a power supply since I have an
ardunio nano instead of the arduino uno used in thisexample?
Sorry, I'm really new and this is all so confusing for me!
LaurensHuizer (/member/LaurensHuizer) .
AshleyO3 (/member/Ashley O3)
Hi AshleyO3,
I recommend you to use a PC power source,
especially is you are using multiple stepper motors inyour setup. You can connect the driverboard VCC pin
to a red wire and the GND pin to a black wire. I'vecreated a class to control your PC power source:
http://www.laurenshuizer.nl/blog/arduino/power-
http://www.laurenshuizer.nl/blog/arduino/power-source-libraryhttp://www.instructables.com/member/AshleyO3http://www.instructables.com/member/LaurensHuizerhttp://www.instructables.com/member/AshleyO3http://www.instructables.com/member/jaysonlooihttp://www.instructables.com/member/vandenbrandehttp://www.instructables.com/member/vandenbrandehttp://www.instructables.com/member/vandenbrandehttp://www.instructables.com/member/GavinS11http://www.instructables.com/member/vandenbrandehttp://www.instructables.com/member/vandenbrandehttp://www.instructables.com/member/GavinS11
8/18/2019 Datasheet BYJ48 Stepper Motor - All
15/21
Reply
6 months ago
Reply
7 months ago
Reply6 months ago
Reply6 months ago
source-library(http://www.laurenshuizer.nl/blog/arduino/power-
source-library).
AshleyO3 (/member/AshleyO3) .
LaurensHuizer (/member/LaurensHuizer)
Thank you, but I need a way to attach a battery pack power
source so I can transport my circuit around! Any suggestions
for that at all? I'm using an Arduino Nano >_>
LuisF37 (/member/LuisF37) .
Ashley O3 (/m ember/AshleyO3)
If you look at the picture of the controller, there are two pins,marked - and +, with 5-12V. That's it.
DonD10 (/member/DonD10)
I want to make an arduino-based robotic tripod head (for a
DSLR - for panoramic & 360 degree photos), but I havenever actually used a stepper motor before. I have one
(same as yours) from a kit & plan to order a couple more(need to use 2; 1 sideways & 1 up & down), but I'm not
sure the best way to attach (whatever) to the 'spinny part'
of the motor :)
Any thoughts / direction? I'm brand-new to messing with
Arduinos (I have an UNO and a couple ATTINY85 boards)and so far have only lit LEDs, so maybe this is too
ambitious ... but commercial robotic heads are almost$1000 & my budget is closer to $20 :)
Thank you very much for this priceless example ! I had a trouble to run mystepper motor 28BYJ-48 with ULN2003 with standard "stepper" library of the
latest Arduino IDE :( It make a few steps and stuck with a big current... After Itried your way and everything is nice ! :) After I decided to look at logic levels on
pins from IN1 to IN4 in both situations. As I see the library function "step" run in
1 full phase, and your code run motor in 1/2 phase, as your wrote. I attached 4screenshots of your code CCW and CW rotating in 2 different time/div and a
screenshot of the library function.
My question is : are you think that the first (library) function correct for this
(http://cdn. instructables.com/FR3/JDCK/IFUEFLAP/FR3JDCKIFUEFLAP.LARGE.jpg)
binobino (/member/binobino) made it!
http://www.instructables.com/member/binobinohttp://cdn.instructables.com/FR3/JDCK/IFUEFLAP/FR3JDCKIFUEFLAP.LARGE.jpghttp://www.instructables.com/member/DonD10http://www.instructables.com/member/AshleyO3http://www.instructables.com/member/LuisF37http://www.instructables.com/member/LaurensHuizerhttp://www.instructables.com/member/AshleyO3http://www.laurenshuizer.nl/blog/arduino/power-source-library
8/18/2019 Datasheet BYJ48 Stepper Motor - All
16/21
Reply
6 months ago
Reply
6 months ago
Reply
6 months ago
Reply6 months ago
(http://cdn.instructables.com/FZO/NIIK/IFUEFL9Z/FZONIIKIFUEFL9Z.LARGE.jpg)
(http://cdn.instructables.com/FYC/4Q18/IFUEFL7N/FYC4Q18IFUEFL7N.LARGE.jpg)
(http://cdn.instructables.com/F9M/5J4F/IFUEFL7K/F9M5J4FIFUEFL7K.LARGE.jpg)
(http://cdn.instructables.com/FU2/95L1/IFUEFL2D/FU295L1IFUEFL2D.LARGE.jpg)
binobino (/member/binobino) . binobino (/member/binobino)
Sorry, the screenshots are misplaced when upload - the
LAST screenshot is from a library function "step"....
LaurensHuizer (/member/LaurensHuizer) .
binobino (/member/binobino)
Hi binobino,
I've created an object oriented library to control your BYJ48stepper motor:
https://github.com/LaurensHuizer/Arduino/tree/master/libraries(https://github.com/LaurensHuizer/Arduino/tree/master/librarie
binobino (/member/binobino) .
LaurensHuizer (/member/LaurensHuizer)
Great thanx, Laurens!
LaurensHuizer (/member/LaurensHuizer)
If you want to control you stepper motor in an object
oriented way, you can view my blogposthttp://www.laurenshuizer.nl/blog/arduino/stepper-motor-
http://www.laurenshuizer.nl/blog/arduino/stepper-motor-libraryhttp://www.instructables.com/member/LaurensHuizerhttp://www.instructables.com/member/LaurensHuizerhttp://www.instructables.com/member/binobinohttps://github.com/LaurensHuizer/Arduino/tree/master/libraries/StepperMotorhttp://www.instructables.com/member/binobinohttp://www.instructables.com/member/LaurensHuizerhttp://www.instructables.com/member/binobinohttp://www.instructables.com/member/binobinohttp://cdn.instructables.com/FU2/95L1/IFUEFL2D/FU295L1IFUEFL2D.LARGE.jpghttp://cdn.instructables.com/F9M/5J4F/IFUEFL7K/F9M5J4FIFUEFL7K.LARGE.jpghttp://cdn.instructables.com/FYC/4Q18/IFUEFL7N/FYC4Q18IFUEFL7N.LARGE.jpghttp://cdn.instructables.com/FZO/NIIK/IFUEFL9Z/FZONIIKIFUEFL9Z.LARGE.jpg
8/18/2019 Datasheet BYJ48 Stepper Motor - All
17/21
Reply
6 months ago
Reply2 years ago
Reply
6 months ago
Reply7 months ago
Reply2 years ago
X
8
Reply7 months ago
Reply8 months ago
library (http://www.laurenshuizer.nl/blog/arduino/stepper-motor-library).
binobino (/member/binobino) .
LaurensHuizer (/member/LaurensHuizer)
Thank you very much, Laurens for great explanation, work
and library! It was very useful for me !
M.razik (/member/M.razik)thanks for the explaining, but i have a problem after using Ur
code and the same pin out the motor is make a vibratesound ! .. and don't turn .. !? and i have a question ? how
can i tell the stepper motor to start point at a defined degree(0)deg or step and from it go to (180) deg (90)deg ... etc. I
wonder if you can help me ... thanks in advance :)
LaurensHuizer (/member/LaurensHuizer) .
M.razik (/member/M.razik)
Hi M.razik,
This is probably because the motor doens't get enoughpower. I recommend you to use an external power supply
LuisF37 (/member/LuisF37) .
M.razik (/member/M.razik)
For that, you should calculate the number of steps to reach these angles,based on the number of steps/turn. Or (which seems more elegant for
your case) would be using a servo motor instead.
http://www.instructables.com/id/Arduino-Servo-Motors/
Mohannad Rawashdeh (/member/Mohannad Rawashdeh) (author) .
M.razik
(/member/M.razik)
Check your connection again , I tested before .
Yes you can
AhmeedS (/member/AhmeedS)
I put this together and it's really cool thank you. Before your explanation I was
lost and almost burned up a motor. Is your code documented anywhere? Itworks great, but it's a bid advanced for me... So is lighting LEDs... hahahaha
Thank you again, I would recommed this project to everyone.
Billdwp (/member/Billdwp) made it!
http://www.instructables.com/member/Billdwphttp://www.instructables.com/member/AhmeedShttp://www.instructables.com/member/M.razikhttp://www.instructables.com/member/Mohannad%20Rawashdehhttp://www.instructables.com/member/M.razikhttp://www.instructables.com/member/LuisF37http://www.instructables.com/member/M.razikhttp://www.instructables.com/member/LaurensHuizerhttp://www.instructables.com/member/M.razikhttp://www.instructables.com/member/LaurensHuizerhttp://www.instructables.com/member/binobinohttp://www.laurenshuizer.nl/blog/arduino/stepper-motor-library
8/18/2019 Datasheet BYJ48 Stepper Motor - All
18/21
Reply
7 months ago
Reply
7 months ago
Reply8 months ago
Reply8 months ago
(http://cdn.instructables.com/FH0/4Q0K/IE184JN4/FH04Q0KIE184JN4.LARGE.jpg)
AshleyO3 (/member/AshleyO3) . Billdwp (/member/Billdwp)
wesome set up! I'm trying to do something similar for my
project here. Do you mind showing me or telling me whatsgoing on with the power supply? Like, how you have the
power supply connected to the breadboard and arduino and
driver board?
AshleyO3 (/member/AshleyO3) .
Ashley O3 (/m ember/AshleyO3)
Oh, I should add it's because I have an ardunio nano insteadof the uno!
Thanks for your code! I used it to make an Arduino Bumper Robot! Check it outhere if you want your own: http://www.instructables.com/id/Super-simple-and-
S... (http://www.instructables.com/id/Super-simple-and-Super-cheap-Arduino-Bumper-robot-/)
(http://cdn.instructables.com/F9M/FJL6/IEB8DYQB/F9MFJL6IEB8DYQB.LARGE.jpg)
JoshS38 (/member/JoshS38)
Hi, I am using a motor from the same family as this one
(24BYJ48) I am using the Adafruit library to control the
stepping motor.
The issue I am having is running the motor at Full Speed.
Here is my code:
#include
#include
#include "utility/Adafruit_PWMServoDriver.h"
// Create the motor shield object with the default I2Caddress
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for
stacking)
sourcery (/member/sourcery) made it!
http://www.instructables.com/member/sourceryhttp://www.instructables.com/member/JoshS38http://cdn.instructables.com/F9M/FJL6/IEB8DYQB/F9MFJL6IEB8DYQB.LARGE.jpghttp://www.instructables.com/id/Super-simple-and-Super-cheap-Arduino-Bumper-robot-/http://www.instructables.com/member/AshleyO3http://www.instructables.com/member/AshleyO3http://www.instructables.com/member/Billdwphttp://www.instructables.com/member/AshleyO3http://cdn.instructables.com/FH0/4Q0K/IE184JN4/FH04Q0KIE184JN4.LARGE.jpg
8/18/2019 Datasheet BYJ48 Stepper Motor - All
19/21
Reply8 months ago
Reply8 months ago
Replya year ago
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Connect a stepper motor with 200 steps per revolution(1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200,
2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say
1KHz
myMotor->setSpeed(100); // 10 rpm
}
void loop() {
Serial.println("Microstep steps");
myMotor->step(50, FORWARD, MICROSTEP);
}I am very new to arduino so would appreciate the help :)
I just put this together on a 'Moteino' small wireless arduino clone. It worksperfectly with no alterations to the code at all. I am making an automatic
chicken coop door, and will monitor a few things (temp, humidity, water & foodconsumption) to provide data back to a base Raspberry Pi. This will (I hope)
open & close the door mechanism, but even if the motor proves not strong
enough it has taught me what I need to know, thanks!
(http://cdn.instructables.com/FDV/SAEC/IE4ZU9FU/FDVSAECIE4ZU9FU.LARGE.jpg)
humphrey.lees (/member/humphrey.lees)
I have the motor working as I write. I think it can be usedfor my coil winder that is using a dc motor and encoder.
How can I stop the pause and control the speed andduration?
urkraft (/member/urkraft)
Thank you for the information, but i believe that the code wasoverly complicated. I simplified it dramatically and my code
worked great as well as being much simplier to understand.
Here is my suggestion:
Domonsura (/member/Domonsura) made it!
http://www.instructables.com/member/Domonsurahttp://www.instructables.com/member/urkrafthttp://www.instructables.com/member/humphrey.leeshttp://cdn.instructables.com/FDV/SAEC/IE4ZU9FU/FDVSAECIE4ZU9FU.LARGE.jpg
8/18/2019 Datasheet BYJ48 Stepper Motor - All
20/21
const char posArray[9] = { 0x08, 0x0C, 0x04, 0x06, 0x02,0x03, 0x01, 0x09 };
void setup() {// put your setup code here, to run once:
DDRB = 0xFF;}
void loop() {// put your main code here, to run repeatedly:
int pos;
int skritt;for (pos = 0; pos < 512; pos++) {for (skritt = 0; skritt < 8; skritt++) {
PORTB = posArray[skritt];
delay(1);}
}
delay(1000);
for (pos = 512; pos > 0; pos--) {for (skritt = 7; skritt > -1; skritt--) {
PORTB = posArray[skritt];delay(1);
}}
delay(1000);}
I
More Comments
FEATURED CHANNELS
Home Repair
(/tag/type-
id/category-
workshop/channel-
home-
improvement/)
Survival
(/tag/type-
id/category-
outside/channel-
survival/)
Breakfast
(/tag/type-
id/category-
food/channel-
breakfast/)
Minecraft
(/tag/type-
id/category-
play/channel-
minecraft/)
Knitting
(/tag/type-
id/category-
craft/channel-
knitting-and-
crocheting/)
USB
(/tag/type-
id/category-
technology/channel-
usb/)
Comics
(/tag/type-
id/category-
costumes/channel-
comics/)
Winter Drinks
(/id/Holiday-
Drinks/)
Wedding
(/howto/wedNewsletter
Join 2 million + to receive instant
inspiration in your inbox.
I'm in!enter email
Mobile
ownload our apps!
ndroid » (https://play.google.com/stor e/apps/details?id=com.adsk.instructables)
OS » (https://itunes.apple.com/app/instructables/id586765571)
Windows » (http://apps.microsoft.com/windows/en-us/app/7afc8194-c771-441a-9590-54250d6a8300)
http://apps.microsoft.com/windows/en-us/app/7afc8194-c771-441a-9590-54250d6a8300https://itunes.apple.com/app/instructables/id586765571https://play.google.com/store/apps/details?id=com.adsk.instructableshttp://www.instructables.com/howto/weddings/http://www.instructables.com/id/Holiday-Drinks/http://www.instructables.com/tag/type-id/category-costumes/channel-comics/http://www.instructables.com/tag/type-id/category-technology/channel-usb/http://www.instructables.com/tag/type-id/category-craft/channel-knitting-and-crocheting/http://www.instructables.com/tag/type-id/category-play/channel-minecraft/http://www.instructables.com/tag/type-id/category-food/channel-breakfast/http://www.instructables.com/tag/type-id/category-outside/channel-survival/http://www.instructables.com/tag/type-id/category-workshop/channel-home-improvement/
8/18/2019 Datasheet BYJ48 Stepper Motor - All
21/21
About Us
Who We Are (/about/)
dvertise (/ad vertise/)
ontact (/about/contact.jsp)
obs (/community/Positions-available-at-Instructables/)
elp (/id/how-to-write-a-great-instructable/)
Find Us
Facebook (http://www.facebook.com/instructables)
Youtube (http://www.youtube.com/user/instructablestv)
Twitter (http://www.twitter.com/instructables)
Pinterest (http://www.pinterest.com/instructables)
Google+ (https://plus.google.com/+instructables)
Tumblr (http://instructables.tumblr.com)
Resources
or Teachers (/teachers/)
rtists in Residence (/air)
Gift Pro Account (/account/give?sourcea=footer)
orums (/community/)
nswers (/tag/type-question/?sort=RECENT)
itemap (/sitemap/)
erms of Service (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |
rivacy Statement (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |
egal Notices & Trademarks (http://usa.autodesk.com/legal-notices-trademarks/) | Mobile Site (http://m.instructables.com)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
2016 Autodesk, Inc.
http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112http://m.instructables.com/http://usa.autodesk.com/legal-notices-trademarks/http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721http://www.instructables.com/sitemap/http://www.instructables.com/tag/type-question/?sort=RECENThttp://www.instructables.com/community/http://www.instructables.com/account/give?sourcea=footerhttp://www.instructables.com/airhttp://www.instructables.com/teachers/http://instructables.tumblr.com/https://plus.google.com/+instructableshttp://www.pinterest.com/instructableshttp://www.twitter.com/instructableshttp://www.youtube.com/user/instructablestvhttp://www.facebook.com/instructableshttp://www.instructables.com/id/how-to-write-a-great-instructable/http://www.instructables.com/community/Positions-available-at-Instructables/http://www.instructables.com/about/contact.jsphttp://www.instructables.com/advertise/http://www.instructables.com/about/