Update Stepper_ULN2003A.md

This commit is contained in:
HomeSpan 2024-02-10 12:29:50 -06:00 committed by GitHub
parent 413c35304f
commit 972dda721c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 23 deletions

View File

@ -6,37 +6,31 @@ The Texas Instruments ULN2003A chip containins an array of seven Darlington tran
[^1]: Only four of the seven Darlington transistor pairs in the ULN2003A are needed to drive a typical unipolar stepper motor. [^1]: Only four of the seven Darlington transistor pairs in the ULN2003A are needed to drive a typical unipolar stepper motor.
Various manufacturers have incorporated this chip into a dedicated stepper motor board designed to drive unipolar motors such as these [28BYJ-48 5-Volt](https://opencircuit.shop/product/28byj-48-5v-stepper-motor-4-phase-5-wire) and [28BYJ-48 12-Volt](https://opencircuit.shop/product/28byj-48-12v-stepper-motor-4-phase-5-wire) Stepper Motors. Wiring for the [Opencircuit ULN2003 Stepper Motor Driver Board](https://opencircuit.shop/product/uln2003-stepper-motor-driver-module) that uses this chip is as follows: Various manufacturers have incorporated this chip into a dedicated stepper motor board designed to drive unipolar motors such the [28BYJ‑48 5‑Volt Stepper](https://opencircuit.shop/product/28byj-48-5v-stepper-motor-4-phase-5-wire) and [28BYJ‑48 12‑Volt Stepper](https://opencircuit.shop/product/28byj-48-12v-stepper-motor-4-phase-5-wire). Wiring for the [Opencircuit ULN2003 Stepper Motor Driver Board](https://opencircuit.shop/product/uln2003-stepper-motor-driver-module) that uses this chip is as follows:
#### **Power Connections** #### **Power Connections**[^2]
* *VCC* - connect to +3.3V on ESP32 * - connect to an external DC power supply that will drive stepper motor (5-12V)
* *VM+* - connect to external DC power supply that will drive stepper motor (5-13V) * - connect to GND on the ESP32, and to ground of external DC power supply
* *GND* - connect to GND on the ESP32, and to ground of external DC power supply
#### **Motor Connections** #### **Motor Connections**
* *MOTORA* - connect to the "A" coil of the stepper motor * plug the motor directly into the board's 5-pin connector
* *MOTORB* - connect to the "B" coil of the stepper motor
#### **Control Connections** #### **Control Connections**
* *AIN1, AIN2* - connect to two digital pins on the ESP32 - used to control direction and state of coil *A* * *IN1, IN2, IN3, IN4* - connect to four digital pins on the ESP32 - used to step the motor in either direction
* *BIN1, BIN2* - connect to two digital pins on the ESP32 - used to control direction and state of coil *B*
* *PWMA, PWMB* - if using PWM, connect to two digital pins on the ESP32; if not, connect to +3.3V on ESP32 to pull high
* *STBY* - connect to +3.3V on ESP32 to pull high
The **Stepper_TB6612** class includes two constructors: The **Stepper_ULN2003A** class includes the following constructors:
* `Stepper_TB6612(int AIN1, int AIN2, int BIN1, int BIN2)` * `Stepper_ULN2003A(int IN1, int IN2, int IN3, int IN4)`
* controls the driver board using only 4 digital pins from the ESP32, where the parameters specify the pin numbers. Supports the following step type modes: * controls the driver board using only 4 digital pins from the ESP32, where the parameters specify the pin numbers. Supports the following step type modes:
* FULL_STEP_ONE_PHASE * FULL_STEP_ONE_PHASE
* FULL_STEP_TWO_PHASE * FULL_STEP_TWO_PHASE
* HALF_STEP * HALF_STEP
* `Stepper_TB6612(int AIN1, int AIN2, int BIN1, int BIN2, int PWMA, int PWMB)` ❗Note: The ULN2003A chip does not support a short brake state. Calls to the `brake()` method, as well as setting the *endAction* parameter in the `move()` and `moveTo()` methods to **StepperControl::BRAKE** have no effect on the motor driver.<br><br>
* controls the driver board using 4 digital pins and 2 PWM pins from the ESP32, where the parameters specify the pin numbers. Supports the following step type modes:
* FULL_STEP_ONE_PHASE > [!TIP]
* FULL_STEP_TWO_PHASE > If you set the motor to move very slowly (e.g. 500ms per step) you will be able to track how the current is turned on and off for each phase of the motor coils depending on the *step mode* selected by observing the four LEDs (labeled *A, B, C, D*) built into the driver board. See also this [Last Minute Engineers Tutorial](https://lastminuteengineers.com/28byj48-stepper-motor-arduino-tutorial) for a detailed presentation of the ULN2003A and its use to drive a 28BYJ&#8209;48 5&#8209;Volt Stepper Motor.
* HALF_STEP
* QUARTER_STEP
* EIGHTH_STEP [^2]: the ULN2003A is a passive chip - there is no VCC power connection between the driver board and the ESP32
--- ---