Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Stepper Motor with ULN2003A Driver

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Stepper Motor with ULN2003A Driver

Circuit Documentation

Summary

This circuit is designed to control a 28BYJ-48 stepper motor using an Arduino UNO and a ULN2003A breakout board. The Arduino UNO sends control signals to the ULN2003A, which in turn drives the stepper motor. The circuit allows for precise control of the stepper motor's position via serial input.

Component List

28BYJ-48 Stepper Motor

ULN2003A Breakout Board

Arduino UNO

Wiring Details

28BYJ-48 Stepper Motor

ULN2003A Breakout Board

Arduino UNO

Code Documentation

Arduino UNO Code

#include <Stepper.h>
#define STEPS 32

Stepper stepper(STEPS, 8, 9, 10, 11);
int val = 0;

void setup() {
    Serial.begin(9600);
    stepper.setSpeed(200);
}

void loop() {
    if (Serial.available() > 0) { 
        val = Serial.parseInt();
        stepper.step(val);
        Serial.println(val);
    }
}

This code initializes the stepper motor and sets up serial communication. In the main loop, it reads the number of steps from the serial input and moves the stepper motor accordingly.