Introduction: Stepper Motor With ESP32 Board

About: pursuing Bachelors in Electronics and Communication at Chandigarh University

Stepper motors are DC motors that move in discrete steps. They have multiple coils that are organized in groups called "phases". By energizing each phase in sequence, the motor will rotate, one step at a time.

Stepper motors are very useful in making projects which require precise positioning such as 3D printers. Due to few limitations we have one more type of motor called servo motors.

Limitations are : -

1. draw power even when not doing any work at all.

2. less torque at high speed.

3. No feedback mechanism like servo motor.

Moreover, Stepper motors require Motor drivers to connect with processing boards but we can connect servo motors directly to Arduino or esp32 board.

Step 1: Components Required

1. Stepper Motor -

2. Motor driver -

3. ESP32 -

4. Jumper wires -

5. Breadboard(optional) -

6. Arduino IDE software

Setting up your Arduino IDE before uploading code in ESP32 is very important : -

Step 2: Circuit Connections for Stepper Motor and ESP 32.

Stepper motor works on 5v volts. therefore connect 5V of motor driver to ESP 32 Vin.

Motor driver --> ESP32 board

in1Pin --> 25
in2Pin --> 33

in3Pin --> 32

in4Pin --> 35

Vcc --> VIN


Step 3: How to Upload Code in ESP 32 Board

1. Click on upload.

2. If no error. At the bottom of Arduino IDE, when we get message Connecting ...,...,

3. Press Boot button on ESP 32 board till you get the message done uploading.

4. After you code is uploaded successfully. Press enable button to restart or start code uploaded on ESP32 board.

Step 4: Arduino Code for ESP32 With Stepper Motor