Sei sulla pagina 1di 18

InterfacingStepperMotorwith8051usingKeilCAT89C51

B Y E B I N G E O RG E (HTTP S : / / E L E CTRO S O ME . CO M/ A UTHO R/ E B I NG / ) / 1 0 CO MME NTS


(HTTP S : / / E L E CTRO S O ME . CO M/ I NTE RFA CI NG S TE P P E RMO TO R8 0 5 1 K E I L CA T8 9 C5 1 / # CO MME NTS )

MotorStarter

VFD015EL43AVFDELSeries

alibaba.com/MotorStarter

WholesaleSuppliers&FactoryPrice
ContactDirectly&GetLiveQuotes!

fasttobuy.com

Digitaliclayo
cadence.com

DeltaVFD2HP3phase380V1500WNewin
Box$240/pc

SeeCadenceFull
ImprovePPA.Red

AndroidMicrocontrollerProjectKit
(https://electrosome.com/electronicsandroid
projectkit/)
A Stepper Motor is a brushless, synchronous DC Motor. It
has many applications in the field of robotics and
mechatronics. The total rotation of the motor is divided into
steps. The angle of a single step is known as the stepper
angle of the motor. There are two types of stepper motors
(https://electrosome.com/steppermotor/)

Unipolar

and

Bipolar.Duetotheeaseofoperationunipolarsteppermotor
iscommonlyusedbyelectronicshobbyists.Formoredetails
please read the article Stepper Motor or Step Motor

(https://electrosome.com/wp
(https://electrosome.com/steppermotor/). Stepper Motors content/uploads/2012/06/Stepper
can be easily interfaced with a microcontroller using driver Motor.jpg)
ICs such as L293D (https://electrosome.com/l293d
Stepper
Motor
quadruplehalfhdcmotordriver/)

or

ULN2003

(https://electrosome.com/uln2003highvoltagecurrent
driver/).

DrivingUnipolarStepperMotorwith8051

(https://electrosome.com/stepper
motor/)

Unipolar stepper motors can be used in three


modes namely the Wave Drive, Full Drive and
Half Drive mode. Each drive have its own
advantages and disadvantages, thus we should
choose the required drive according to the
applicationandpowerconsumption.

WaveDrive
Inthismodeonlyoneelectromagnetisenergized
at a time. Generated torque will be less when
compared
(https://electrosome.com/wp
content/uploads/2012/06/Unipolar
StepperMotorWindings.jpg)

to

full

drive

in

which

two

electromagnets are energized at a time but


power consumption is reduced. It has same
numberofstepsasinthefulldrive.Thisdriveis
preferred when power consumption is more

UnipolarStepperMotorWindings

importantthantorque.Itisrarelyused.
WaveDriveSteppingSequence
Step

FullDrive
In this mode two electromagnets are energized at a time, so the torque generated will be
larger when compared to Wave Drive. This drive is commonly used than others. Power
consumptionwillbehigherthanothermodes.

3Phase
VFD015EL43A
Motor
VFDELSeries
Wholesale
fasttobuy.com

Printedcircuit
board

DeltaVFD2HP3
Choosefrom phase380V1500W
1M+Verified NewinBox
$240/pc
Suppliers.
Contact
Directly&
GetLive
Quotes!

PCBboard,circuit
boards,protoboard
allaboutPCBin
Korea.

alibaba.com

drpcb.co.kr

Snow
Mixed
Downhole Digitalic ElectricMotor
Panther Signal
Electronics layout
Gearbox
Motor
Integration
nse.no
cadence
ecer.com
ESC
mixsig.com
High
See
QualityElectricMotor
Switched
Capacitor
Reliable
Sourcefor Highpass
NotchCMOS
RC
Products. Mixer/filter
Standard
Fast
Shipping Products
andBest
Price.
asiatees

Temperature Cadence
Gearbox
Electronicsfor FullFlow Supplier&Manufacturer
downhole/wir Solution
FromChina.
elinetools
Improve
PPA.
Reduce
Iterations.

FullDriveSteppingSequence
Step

HalfDrive
Inthismodealternativelyoneandtwoelectromagnetsareenergized,soitisacombinationof
WaveandFulldrives.Thismodeiscommonlyusedtoincreasetheangularresolutionofthe
motor but the torque will be less, about 70% at its half step position. We can see that the
angularresolutiondoubleswhenusingHalfDrive.
HalfDriveSteppingSequence
Step

ElbaTec
Electron

QCM,Hi
Voltage
Amplifie
HATsfor
Raspberr
AFM&S

Nowwewillseehowtoimplementthesedrives.

InterfacingUsingL293D

(https://electrosome.com/wpcontent/uploads/2013/05/InterfacingUnipolarStepperMotor
with8051usingL293D.jpg)
InterfacingUnipolarStepperMotorwith8051usingL293D

Thisisthecircuitdiagramofdrivingabipolarsteppermotorusing8051microcontrollerusing
L293D.24MHzcrystalisconnectedtoprovidetherequiredclockforthemicrocontroller.10F
capacitorand10KisusedtoprovidePowerOnReset(POR)forthe8051microcontroller.
L293D is connected to pins P2.0, P2.1, P2.2, P2.3 of the microcontroller and two pairs of
L293DareenabledbytieingEN1,EN2to5V.LogicVoltage(5V)isconnectedtoVsspinand
Motor Supply (12V) is connected to the Vs pin of L293D. Center Tap of each windings of
stepper motor is shorted and connected to the motor supply. Now we can energize each
windingofthemotorbymakingcorrespondingpinofL293DLOW.

InterfacingUsingULN2003

(https://electrosome.com/wpcontent/uploads/2013/05/InterfacingUnipolarStepperMotor
with8051usingULN2003.jpg)
InterfacingUnipolarStepperMotorwith8051usingULN2003

InthiscircuitinsteadofL293D,ULN2003isused.Workingissimilartothepreviouscircuit,
whenaninput(say1B)isHIGHcorrespondingoutputpin(1C)willbegrounded.Thuswecan
energizeanywindingofsteppermotor.

KeilCCodeForWaveDrive

#include<reg52.h>
#include<stdio.h>

voiddelay(int);

voidmain()
{
do
{
P2=0x01;//0001
delay(1000);
P2=0x02;//0010
delay(1000);
P2=0x04;//0100
delay(1000);
P2=0x08;//1000
delay(1000);
}
while(1);
}

voiddelay(intk)
{
inti,j;
for(i=0;i<k;i++)
{
for(j=0;j<100;j++)
{}
}
}

KeilCCodeforFullDrive

#include<reg52.h>
#include<stdio.h>

voiddelay(int);

voidmain()
{
do
{
P2=0x03;//0011
(https://electrosome.com)
delay(1000);
P2=0x06;//0110
delay(1000);
P2=0x0C;//1100
delay(1000);
P2=0x09;//1001
delay(1000);
}
while(1);
}

voiddelay(intk)
{
inti,j;
for(i=0;i<k;i++)
{
for(j=0;j<100;j++)
{}
}
}

KeilCCodeforHalfDrive

(https://electrosome.com/cart/)

#include<reg52.h>
#include<stdio.h>

voiddelay(int);

voidmain()
{
do
{
P2=0x01;//0001
delay(1000);
P2=0x03;//0011
delay(1000);
P2=0x02;//0010
delay(1000);
P2=0x06;//0110
delay(1000);
P2=0x04;//0100
delay(1000);
P2=0x0C;//1100
delay(1000);
P2=0x08;//1000
delay(1000);
P2=0x09;//1001
delay(1000);
}while(1);
}

voiddelay(intk)
{
inti,j;
for(i=0;i<k;i++)
{
for(j=0;j<100;j++)
{}
}
}

Youcansimplifythesecodesusingtheshift(<<>>)operatorsinC.

InterfacingBipolarStepperMotor
Bipolarsteppermotorshavenocentertapandhavingequalcoilresistances.Itcanbeeasily
interfacedwithamicrocontrollerusingL293DDCMotorDriverIC.

CircuitDiagram

(https://electrosome.com/wpcontent/uploads/2013/05/InterfacingBipolarStepperMotorwith
8051usingL293D.jpg)
InterfacingBipolarStepperMotorwith8051usingL293D

KeilCCode

#include<reg52.h>
#include<stdio.h>

voiddelay(int);

voidmain()
{
do
{
P2=0x01;//0001
delay(1000);
P2=0x04;//0100
delay(1000);
P2=0x02;//0010
delay(1000);
P2=0x08;//1000
delay(1000);
}while(1);
}

voiddelay(intk)
{
inti,j;
for(i=0;i<k;i++)
{
for(j=0;j<100;j++)
{}
}
}

YoucandownloadKeilCfilesandProteusfileshere
Interfacing Stepper Motor with 8051 using Keil C (https://electrosome.com/wp
content/uploads/2013/05/InterfacingStepperMotorwith8051usingKeilC.zip)

3PhaseMotorWholesale
Choosefrom1M+VerifiedSuppliers.ContactDirectly&GetLiveQuotes!

Like 3,796peoplelikethis.Bethefirstofyourfriends.

electroSome
Follow

+1

+ 706

RelatedPosts:
InterfacingStepper
InterfacingServo
MotorwithPIC
Motorwith8051
StepperMotoror
Microcontroller
usingKeilC
StepMotor
(https://electrosome.com/stepper
(https://electrosome.com/interfacing
(https://electrosome.com/steppermotorpic
servomotorwith
motor/)
microcontroller/)
8051usingkeilc/)

InterfacingDCMotor
InterfacingServo
L293DQuadruple
withPIC
MotorwithAtmega32
HalfHDCMotor
Microcontrollerusing
Microcontroller
Driver
L293D
(https://electrosome.com/interfacing
(https://electrosome.com/l293d
(https://electrosome.com/dc servomotorwith
quadruplehalfhdc
motorl293dpic
atmega32
motordriver/)
microcontroller/)
microcontroller/)

InterfacingDCMotor
with8051using
L293DAT89C51
(https://electrosome.com/interfacing
ServoMotor
dcmotor8051keilc
(https://electrosome.com/servo
at89c51/)
motor/)

CATE G O RI E S : 8 0 5 1 MI CRO CO NTRO L L E R (HTTP S : / / E L E CTRO S O ME . CO M/ CA TE G O RY / TUTO RI A L S / 8 0 5 1


MI CRO CO NTRO L L E R/ ), TUTO RI A L S (HTTP S : / / E L E CTRO S O ME . CO M/ CA TE G O RY / TUTO RI A L S / )
TAG S : 8 0 5 1 MI CRO CO NTRO L L E R (HTTP S : / / E L E CTRO S O ME . CO M/ TA G / 8 0 5 1 MI CRO CO NTRO L L E R/ ),

LOVEIT ,SHAREIT

MI CRO CO NTRO L L E R (HTTP S : / / E L E CTRO S O ME . CO M/ TA G / MI CRO CO NTRO L L E R/ ), P RO TE US

(HTTP S : / / E L E CTRO S O ME . CO M/ TA G / P RO TE US / ), S TE P P E R MO TO R (HTTP S : / / E L E CTRO S O ME . CO M/ TA G / S TE P P E R


MO TO R/ ), TUTO RI A L S (HTTP S : / / E L E CTRO S O ME . CO M/ TA G / TUTO RI A L S / )

9Comments

electroSome

Login

Share

Recommend 4

SortbyBest

Jointhediscussion
fariqizwan 2yearsago

iwanttoput4pushbuttonasstart,stop,clockwiseandanticlokwise.butigotsomeproblem
howtotriggerthepintoensurethatsteppermotorfollowthepushbutton.ifusingdcmotorit
moresimplejustin1=0andin2=0tostopthemotorandviceversa.canugivesomeidea??
thankyou.

10

Reply Share

Harsh>fariqizwan 5monthsago

YoucaneasilymanageusingMicrocontrollerprogramming

Reply Share

2yearsago

pleasesendmetheprogramfor3stepsperrevolutioninasteppermotorusing8051and
l293d
1

Reply Share

Karan ayearago

Cananyonehelpmetodrivethisbipolarmotorthroughexternalswitch?

Reply Share

chandradheeraj 2yearsago

iusedthethesamecircuitwithl293dand8051andiusedsimilarprogramforfulldrive.
butididn'tgettherotation,themotorisjustvibratingoritjustdeflectsacoupleofdegrees,i
havetriedall24combinationsofinputstomotorthinkingthatthemotorpositionandthe
programshouldsynchronize,butitdidn'tsolve.

whatmightbetheproblem??

Reply Share

febronia 2yearsago

iwanttointerfacesynchronousmotorwith89c51..whattypeofdrivercircuitshouldbeused
forrunnigasynchronousmotor..

Reply Share

Rohan 2yearsago

Hwbigasteppermotorcanbeusedwithuln2003

Reply Share

LigoGeorge

Mod >Rohan

2yearsago

Itdependsuponthecurrentratingofmotor...IthinkULN2003candriveupto1A...so
maximumcurrentlimitofmotoris1A..
1

Reply Share

RabindraMaharana>LigoGeorge 2yearsago

thanks

Reply Share

WHAT'STHIS?

ALSOONELECTROSOME

UsingUARTofPICMicrocontrollerHi
TechC

InterfacingEM18RFIDreaderwith
RaspberryPi

41comments3yearsago

24commentsayearago

jaydiphowcanwesendatextlike"hi"

RenukaSir,IhaveaEM18readerboard

fromonepicandreceiveitonanotherpic.i
musingpic16f887.wannasendtextand
alsoreceiveit.compilermikroc

suchastheoneshownbelow.HowcanI
connectittoRaspberryPi?

UsingPushButtonSwitchMPLABXC8

AMGenerationusingMatlab

12comments2yearsago

3comments2yearsago

LigoGeorgeItwillmaketheLEDglow

RiteshDumpala@ManojShenoyThank

continuously...

yousomuchforpostingthis.Iamworking
onaprojectformysubjectandhave
forgottenallmybasics.Thiscodewillreally

Subscribe

AddDisqustoyoursiteAddDisqusAdd

RECENTCOMMENTS
Ihaveadoubt.Iamunabletodrivethemotorsby[..]

Privacy

GAGANDEEPSINGHKHANUJA(MAILTO:GAGANDEEP.AIESEC@GMAIL.COM)
onInterfacingDCMotorwithPICMicrocontrollerusingL293D(https://electrosome.com/dcmotorl293dpic
microcontroller/#comment5911)

sirifiwanttocountelectricpulseonpic,so[..]

SHUBHAM(MAILTO:SH.MANMODE@GMAIL.COM)
onBlinkingLEDusingPICMicrocontrollerMikroC(https://electrosome.com/ledblinkingpic/#comment
5910)

thnx...........

QASIMALKHAIRI(MAILTO:QASIM1121359@GMAIL.COM)
onUSBPICProgrammer:PICKit2(https://electrosome.com/pickit2/#comment5909)

CouldyouexplainhowtoconnectmultiplereaderstoRPi?Thanks[..]

AKASH(MAILTO:AKASH.NAMBOO@GMAIL.COM)
onInterfacingEM18RFIDreaderwithRaspberryPi(https://electrosome.com/em18rfidreaderraspberry
pi/#comment5908)

hicanyoutellmehowtoconvertitintovhdlcode

ANKITKUMAR(HTTP://WWW.DOHACK.ORG/ABOUT)
onAMGenerationusingSimulink(https://electrosome.com/amgenerationsimulink/#comment5907)

IAMLITTLEBITUNDERSTANDTHEPROGRAM

VIKNESWARAN(MAILTO:VIKNESWARANMN@GMAIL.COM)
onLEDChaserusingPICMicrocontroller(https://electrosome.com/ledchaserpic/#comment5906)

INEEDTHEPROGRAM

VIKNESWARAN(MAILTO:VIKNESWARANMN@GMAIL.COM)
onLEDChaserusingPICMicrocontroller(https://electrosome.com/ledchaserpic/#comment5905)

thisprogramsomeerrorineedyourhelpsir

VIKNESWARAN(MAILTO:VIKNESWARANMN@GMAIL.COM)
onLEDChaserusingPICMicrocontroller(https://electrosome.com/ledchaserpic/#comment5904)

SUBSCRIBEUS
EMAIL

SUBMIT

DONATEUS

RECENTPOSTS
AUTOMATICNIGHTLAMPUSINGLDR
(HTTPS://ELECTROSOME.COM/AUTOMATICNIGHTLAMP/)
BYARUNBHASKAR(HTTPS://ELECTROSOME.COM/AUTHOR/ARUNBHASKAR/)

TRANSFORMERLESSCAPACITORDROPPERPOWERSUPPLY
(HTTPS://ELECTROSOME.COM/CAPACITORPOWERSUPPLY/)
BY(HTTPS://ELECTROSOME.COM/AUTHOR/LIJOPPANS/)LIGOGEORGE(HTTP://WWW.ELECTROSOME.COM)

SIMPLEELECTRONICPIANOUSING555TIMER
(HTTPS://ELECTROSOME.COM/ELECTRONICPIANO555TIMER/)
BY(HTTPS://ELECTROSOME.COM/AUTHOR/LIJOPPANS/)LIGOGEORGE(HTTP://WWW.ELECTROSOME.COM)

BISTABLEMULTIVIBRATORUSING555TIMER
(HTTPS://ELECTROSOME.COM/BISTABLEMULTIVIBRATOR555TIMER/)
BY(HTTPS://ELECTROSOME.COM/AUTHOR/LIJOPPANS/)LIGOGEORGE(HTTP://WWW.ELECTROSOME.COM)

USINGADCOFPICMICROCONTROLLERMPLABXC8
(HTTPS://ELECTROSOME.COM/ADCPICMICROCONTROLLERMPLABXC8/)
BY(HTTPS://ELECTROSOME.COM/AUTHOR/LIJOPPANS/)LIGOGEORGE(HTTP://WWW.ELECTROSOME.COM)

MONOSTABLEMULTIVIBRATORUSINGTRANSISTORS
(HTTPS://ELECTROSOME.COM/MONOSTABLEMULTIVIBRATORTRANSISTORS/)
BY(HTTPS://ELECTROSOME.COM/AUTHOR/LIJOPPANS/)LIGOGEORGE(HTTP://WWW.ELECTROSOME.COM)

GENERATINGPWMWITHPICMICROCONTROLLERMPLABXC8
(HTTPS://ELECTROSOME.COM/PWMPICMICROCONTROLLERMPLABXC8/)
BY(HTTPS://ELECTROSOME.COM/AUTHOR/LIJOPPANS/)LIGOGEORGE(HTTP://WWW.ELECTROSOME.COM)

GETTINGSTARTEDWITHDIPTRACE(HTTPS://ELECTROSOME.COM/GETTING
STARTEDWITHDIPTRACE/)
BYFEBINMATHEW(HTTPS://ELECTROSOME.COM/AUTHOR/FEBIN/)

PRODUCTS
FLAMESENSORINFRAREDRECEIVER
Rs.300.00 Rs.289.00

(HTTPS://ELECTROSOME.COM/SHOP/FLAMESENSORINFRAREDRECEIVERMODULE/)

RFIDTAGCARD125KHZ
Rs.30.00 Rs.29.00

(HTTPS://ELECTROSOME.COM/SHOP/RFIDTAGCARD125KHZ/)

DS3231RTCANDEEPROMMODULE
Rs.350.00 Rs.319.00

(HTTPS://ELECTROSOME.COM/SHOP/DS3231RTCAT24C32EEPROM/)

BERGSTRIPFEMALESTRAIGHT
Rs.7.00 Rs.6.50

(HTTPS://ELECTROSOME.COM/SHOP/BERGSTRIPFEMALESTRAIGHT/)

WHITESCREWMOUNTWHEEL10X4
Rs.120.00 Rs.109.00

(HTTPS://ELECTROSOME.COM/SHOP/WHITESCREWMOUNTWHEEL10X4/)

DCMINIMOTOR1
Rs.30.00 Rs.27.00

(HTTPS://ELECTROSOME.COM/SHOP/DCMINIMOTORHOBBYTOY1/)

FLEXSENSOR2.2"
Rs.560.00 Rs.480.00

(HTTPS://ELECTROSOME.COM/SHOP/FLEXSENSOR22/)

DS1307RTC
Rs.50.00 Rs.49.00

(HTTPS://ELECTROSOME.COM/SHOP/DS1307RTC/)

SUBSCRIBEUS

SUBMIT

electroSome
LikePage

Follow

706

(https://electrosome.com)

DONATEUS

Termsandconditions(https://electrosome.com/termsconditions/) /
PrivacyPolicy(https://electrosome.com/privacypolicy/) /ShippingPolicy(https://electrosome.com/shippingpolicy/) /
RefundPolicy(https://electrosome.com/refundpolicy/) /AboutUs(https://electrosome.com/aboutus/)
electroSomeDiscover...Develop...Deliver...

Potrebbero piacerti anche