A stepper motor is a brushless synchronous motor that divides a complete rotation into steps. Each stepper motor will have some fixed step angle and the motor rotates at that angle. In this article I will show you how to interface a stepper motor with an 8051 using two different drivers (L293D and ULN 2003). Also, stepper motor control using 8051 microcontroller will be explained here.
Stepper motor control using 8051 microcontroller principle
The main principle of these circuits is to make the stepper motor rotate in steps at a specific step angle. Since the controller cannot provide the current required by the motor, the ULN2003 IC and L293D motor driver are used to drive the stepper motor.
Circuit 1: Stepper motor control using 8051 microcontroller and L293D
The first circuit in this project is implemented using the L293D motor driver IC. Since the L293D motor driver has the option of four output pins, you can only use it to drive bipolar stepper motors.
Circuit diagram
The figure below shows the circuit diagram for interfacing a bipolar stepper motor with an 8051 microcontroller and a L293D motor driver.
Required components
AT89C51 (8051 microcontroller)
L293D motor driver
5V bipolar stepper motor
16X2 LCD Diaplay
11.0592 MHz quartz crystal
10KΩ resistor X 2
10KΩ potentiometer
8 1KΩ resistor pack
33pF Ceramic Capacitor X 2
10μF/16V capacitor
ButtonX4
330Ω resistor
5V power supply
circuit design
First, the LCD's data pin is connected to the PORT0 pin of the 8051. Since PORT0 does not have any internal pull-up, use a resistor to pull PORT0 up. The RS and E pins of the LCD are connected to P2.0 and P2.1 of the 8051.
The RST pin is pulled down using a 10KΩ resistor. The combination of button and 10µF capacitor will be used to reset the microcontroller. Likewise, use a 10KΩ resistor to pull up the EA pin.
Next, the oscillator. It consists of two 80pF capacitors and an 11.0592 MHz crystal connected between the XTAL1 and XTAL2 pins of the 8051.
Going into the motor driver, the two enable pins and the two power pins are connected to the +5V supply. Four inputs are connected to the PORT1 pins of the 8051, namely P1.0, P1.1, P1.2 and P1.3. The four pins of the bipolar stepper motor are connected to the four output pins of the L293D.
To control the direction of the stepper motor, three buttons are connected to the PORT3 pins, namely P3.0, P3.1 and P3.2.
code
at work
The working of this circuit is very simple. A method called "half-stepping" is implemented in the program to rotate the stepper motor. When the forward button is pressed, the stepper motor will rotate in a clockwise direction.
Likewise, when the back button is pressed, it starts rotating in a counter-clockwise direction. To stop spinning completely, press the stop button.
Circuit 2: Stepper motor control using 8051 microcontroller and ULN2003
The second circuit of this project is to implement stepper motor control using 8051 microcontroller and ULN2003. Since the ULN2003 transistor array consists of 7 outputs, you can control both unipolar and bipolar stepper motors.
In this project I will show you how to control a 5-wire unipolar stepper motor using an 8051 microcontroller and a ULN2003 transistor array.
Circuit diagram
The figure below shows the circuit diagram for interfacing a stepper motor with an 8051 microcontroller and a ULN2003.
Circuit diagram of using AT89C51 microcontroller to control stepper motor
circuit components
AT89C51 microcontroller
ULN2003A
stepper motor
crystal
Resistor
Capacitors
circuit design
The circuit consists of AT89C51 microcontroller, ULN2003A, and motor. AT89c51 is a low power consumption, high performance, CMOS 8-bit 8051 series microcontroller. It has 32 programmable I/O lines. It has 4K bytes of Flash programmable and erasable memory. The external crystal oscillator is connected on pins 18 and 19 of the microcontroller. The motor is connected to port 2 of the microcontroller through the driver IC.
ULN2003A is a current driver IC. It is used to drive the current of the stepper motor as it requires more than 60mA. It is an array of Darlington pairs. It consists of seven pairs of Darlington arrays with a common transmitter. The integrated circuit consists of 16 pins, 7 of which are input pins, 7 of which are output pins, and the rest are VCC and ground. The first four input pins are connected to the microcontroller. Likewise, the four output pins are connected to the stepper motors.
Stepper motors have 6 pins. Out of these six pins, 2 pins are connected to the 12V power supply and the rest are connected to the output of the stepper motor. The stepper rotates at a given step angle. Each step of the rotation is a small part of the entire cycle. This depends on the mechanical parts and driving method.
Similar to all electric motors, a stepper motor will have a stator and a rotor. The rotor has permanent magnets and the stator has coils. A basic stepper motor has 4 coils, each with a 90-degree rotational step. The four coils are activated in a cyclic sequence. The image below shows the direction of rotation of the axis. There are many ways to drive stepper motors. Some of them are explained below.
Full Step Drive: In this method, both coils are energized simultaneously. Therefore, here two opposite coils are excited at once.
Half-step drive: In this method, the coils are energized alternately. Therefore, it rotates at half step angle. In this method, you can energize two coils at once, or you can energize a single coil. Therefore, it increases the number of revolutions per cycle. As shown below.
How to operate this stepper motor driver circuit?
First, connect the circuit.
The microcontroller starts to drive the stepper motor.
The rotation of the stepper motor can be observed
Stepper motors have four wires. They are yellow, blue, red and white. These can be powered as described below.
During full-step driving, please proceed in the following order
To drive the motor at half step angle, proceed in this sequence
Advantages of Stepper Motor Controller Circuit
It consumes less power.
Requires low operating voltage
Stepper Motor Control Application
This circuit can be used in robotic applications.
This can also be used in electromechanical applications.
Stepper motors can be used in disk drives, matrix printers, etc.
Previous article:How to build an Android phone controlled robot using 8051 microcontroller and Bluetooth module
Next article:8051 microcontroller interrupt system structure and interrupt control principle
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Industry first! Xiaopeng announces P7 car chip crowdfunding is completed: upgraded to Snapdragon 8295, fluency doubled
- P22-009_Butterfly E3106 Cord Board Solution
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Happy New Year!
- [RVB2601 Creative Application Development] Embedded Development, I'm 10 Times Faster Than You -- RVB Dynamic Loading Model MBRE
- Analysis of WDT in MSP430 MCU
- Why does the newly soldered STM32 main control board run about 10 times slower than normal after programming?
- [Discussion] There is no place to make money during the seven days of National Day holiday
- Linux-3.14.52 Compiler Reference Manual v2.0
- ESP32 firmware is divided into two versions: ESP-IDF v3.x/4.x
- Two methods of programming TMS320C6748
- Enabling higher-performance front-end radar to make Vision Zero a reality
- Power supply control principle of three-phase fuel pump used in Mercedes-Benz passenger cars