Back to the 2024 paper

Module 6: Applications

202414m

With the help of schematic diagram, explain the interfacing of stepper motor with 8051 Microcontroller. Also, write ALP to change the speed and direction of motor.

Worked SolutionAI Assisted

Stepper Motor Interfacing with 8051 + ALP for Speed/Direction

Hardware: 4-phase unipolar stepper (e.g., 28BYJ-48) requires driver ULN2003 (Darlington) or L293D; 12V supply, common +12V, 4 coils → ULN2003 outputs 1A-4A→ P1.0-P1.3. Diode protection. Bipolar uses L298 with 2 coils.

Sequence (full-step): Wave: 08H→04H→02H→01H→08H (clockwise), reverse anticlockwise 01→02→04→08. Half-step interleaves. Supply via external.

Circuit description: P1.0-P1.3→ULN2003 IN1-4 → OUT1-4 → motor coils, COM to +12V, GND common.

ALP to control speed/direction:

ORG 0000H
MOV TMOD,#01H
MAIN: JB P2.0,CLKWISE ; switch on P2.0 selects direction
      MOV R0,#08H ; start sequence anticlk
ACW:  MOV P1,R0
      ACALL DELAY ; speed control delay value
      RR A
      MOV R0,A
      SJMP MAIN
CLKWISE: MOV A,R0
      MOV P1,A
      ACALL DELAY
      RL A
      MOV R0,A
      SJMP MAIN
DELAY: MOV TH0,#HIGH(-counts) ; variable counts via potentiometer ADC or fixed R7
      ; delay = speed: shorter→faster. Adjust R7 value or TH/TL.
      ; example 10ms per step = 100 steps/sec
      RET
END

Speed: Change delay between steps; shorter delay = faster; Direction: reverse sequence. Use Timer interrupt for precise speed.

Similar questions

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.