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

Arduino-Controlled Stepper Motor with Pushbutton Interface

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Stepper Motor with Pushbutton Interface

Circuit Documentation

Summary

The circuit in question is designed to control a 28BYJ-48 Stepper Motor using an Arduino UNO microcontroller and a ULN 2003 driver module. The circuit is powered by a 9V battery, which is regulated by an Mtiny Power module to provide the necessary voltages to the components. A pushbutton is included in the design, although its specific function is not detailed in the provided code. The Arduino UNO is programmed to drive the stepper motor in alternating directions with a specified number of steps and speed.

Component List

Arduino UNO

Pushbutton

9V Battery

Mtiny Power

28BYJ-48 Stepper Motor

ULN 2003

Wiring Details

Arduino UNO

Pushbutton

9V Battery

Mtiny Power

28BYJ-48 Stepper Motor

ULN 2003

Documented Code

Arduino UNO Code (sketch.ino)

#include<Stepper.h>
int stepsPerRevolution=2048;
int motspeed;
Stepper Mystepper(stepsPerRevolution,8,10,9,11);

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Mystepper.setSpeed(motspeed);
}

void loop() {
  // put your main code here, to run repeatedly:
  Mystepper.step(stepsPerRevolution);
  delay(500);
  Mystepper.step(-stepsPerRevolution);
  delay(500);
}

This code configures the Arduino UNO to control the stepper motor using the Stepper library. The motor is set to perform 2048 steps per revolution, which corresponds to the motor's specifications. The setSpeed function is called with an uninitialized variable motspeed, which should be set to a desired speed value. The loop function then moves the stepper motor one full revolution in one direction, pauses for half a second, and then moves it one full revolution in the opposite direction.

Note: The motspeed variable is not initialized in the provided code, which may cause the motor to not function as expected. It should be assigned a value representing the speed at which the motor should turn.

Other Microcontrollers

The provided code for the other microcontrollers is either empty or contains only template setup and loop functions without any operational code. Therefore, no additional documentation is provided for these microcontrollers.