Project showcase
Control 2 stepper motors with a joystick

Control 2 stepper motors with a joystick © GPL3+

Control two 28BYJ-48 stepper motors with a joystick

  • 5,933 views
  • 1 comment
  • 3 respects

Components and supplies

Analog joystick (Generic)
×1
28BYJ-48 stepper motor
×2
Ph a000066 iso (1) ztbmubhmho
Arduino UNO
×1
ULN2003APG stepper driver
×2
11026 02
Jumper wires (generic)
×1

About this project

Follow the circuit diagram for all connections. You will have to also connect both of the stepper driver modules to a 9v battery. The steppers and stepper drivers are connected via the wires that come out of the stepper motor and have a special connector to plug into the motor driver.

Code

Stepper with joystick codeC/C++
#include <Stepper.h>
#define STEPS 2038 // the number of steps in one revolution of your motor (28BYJ-48)
Stepper stepper(STEPS, 8, 10, 9, 11);
Stepper stepper1(2038, 2, 4, 3, 5);
int potState = 0; 
int pot1State = 0;
void setup() {
  Serial.begin(9600); 
 }
 void loop() {
  potState = analogRead(A0); //reads the values from the potentiometers
  pot1State = analogRead(A1); //
  
  Serial.println(pot1State); // sends joystick data to serial port for debuging
  stepper.setSpeed(5);
  stepper1.setSpeed(5);

  if (potState > 600){  //all code below controls movement
    stepper.step(10);
  }
  
  if (potState < 400){
    stepper.step(-10);
  }

  if (pot1State < 400){
    stepper1.step(-10);
    delay(5);
  }
  if (pot1State > 600){
    stepper1.step(10);
  }
  
 }

Schematics

Two steppers with joystick
two_steppers_with_joystick_P77FXHz8ic.fzz
2 stepper with joystick
Two steppers with joystick b oe5jkgohuw

Comments

Similar projects you might like

Arduino Nano: Control 2 Stepper Motors With Joystick

Project tutorial by Boian Mitov

  • 29,767 views
  • 5 comments
  • 51 respects

Driving 28BYJ-48 Stepper Motor Control with Joystick

Project tutorial by BEASTIDREES62

  • 12,011 views
  • 11 comments
  • 19 respects

Servo Control with TV Remote Control

Project showcase by eldo85

  • 25,301 views
  • 8 comments
  • 48 respects

Mega Bread - Atari Joystick Linking for Robotics Control

Project in progress by Pigeon-Kicker

  • 3,590 views
  • 3 comments
  • 12 respects
Add projectSign up / Login