Maker.io main logo

Stepper Motor 28BYJ-48 - Smooth Speed Ramping With Arduino & Visuino

2025-06-03 | By Ron Cutts

License: General Public License Drivers / Controllers Motors PWM Stepper Arduino

 

  1. The first example demonstrates how to ramp up the motor's speed smoothly.

  2. The second example adds a ramp-down phase, creating a complete speed control cycle.

Watch the demonstration video to see both examples in action!

Step 1: What You Will Need

  1. Arduino UNO (or any other board)

  2. Stepper motor 28byj-48 & stepper motor driver board

  3. Jumper wires

  4. Visuino program: Download Visuino

Step 2: The Circuit

The Circuit

  1. Connect Arduino pin [5V] to Driver Board1 pin [VCC]

  2. Connect Arduino pin [GND] to Driver Board1 pin [GND]

  3. Connect Arduino digital pin [2] to Driver Board1 pin [IN1]

  4. Connect Arduino digital pin [3] to Driver Board1 pin [IN2]

  5. Connect Arduino digital pin [4] to Driver Board1 pin [IN3]

  6. Connect Arduino digital pin [5] to Driver Board1 pin [IN4]

Step 3: Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino as shown in the first picture. Click on the "Tools" button in the Arduino component (Picture 1) in Visuino. When the dialog appears, select "Arduino UNO" as shown in Picture 2

  1. The first example demonstrates how to ramp up the motor's speed smoothly.

  2. The second example adds a ramp-down phase, creating a complete speed control cycle.

Watch the demonstration video to see both examples in action!

Step 4: What You Will Need

  1. Arduino UNO (or any other board)

  2. Stepper motor 28byj-48 & stepper motor driver board

  3. Jumper wires

  4. Visuino program: Download Visuino

Step 5: The Circuit

The Circuit

  1. Connect Arduino pin [5V] to Driver Board1 pin [VCC]

  2. Connect Arduino pin [GND] to Driver Board1 pin [GND]

  3. Connect Arduino digital pin [2] to Driver Board1 pin [IN1]

  4. Connect Arduino digital pin [3] to Driver Board1 pin [IN2]

  5. Connect Arduino digital pin [4] to Driver Board1 pin [IN3]

  6. Connect Arduino digital pin [5] to Driver Board1 pin [IN4]

Step 6: Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino as shown in the first picture. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino. When the dialog appears, select "Arduino UNO" as shown in Picture 2

Step 7: In Visuino Connect Components

image

  1. Connect "AnalogValue1" pin [Out] to "RampToValue1" pin [In]

  2. Connect "RampToValue1" pin [Out] to "ClockGenerator1" pin [Frequency]

  3. Connect "ClockGenerator1" pin [Out] to "Stepper1" pin [Step]

  4. Connect "Stepper1" pin [0] to Arduino digital pin [2]

  5. Connect "Stepper1" pin [1] to Arduino digital pin [3]

  6. Connect "Stepper1" pin [2] to Arduino digital pin [4]

  7. Connect "Stepper1" pin [3] to Arduino digital pin [5]

Step 8: Generate, Compile, and Upload the Arduino Code

Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom, click on the "Build" Tab. Make sure the correct port is selected, then click the "Compile/Build and Upload" button.

Step 9: Play

If you power the Arduino module, the Stepper Motor will start to rotate and ramp up its speed.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project that I created for this project. You can download it here and open it in Visuino: https://www.visuino.eu

Download Visuino file: Stepper1

Download Visuino file: Stepper2

Mfr Part # MIKROE-1530
STEPPER MOTOR PM GEARED UNI 5V
MikroElektronika
Mfr Part # A000066
ARDUINO UNO R3 ATMEGA328P BOARD
Arduino
More Info
View More Details
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.