Skip to content

4.2.15. Joystick Stepper Precision Micro Positioner

| Description In Project 105, learners will construct an expert interactive system titled 'Joystick Stepper Precision Micro-Positioner'. This manual details the complete synthesis of XY Joystick + Stepper Motor + IIC 1602 LCD into an intuitive, high-performance automated control platform.|------------------|----------------------------------------------------------------| | Use case |This project connects to real-world industrial and IoT applications such as: Project 105 equips students with professional skills in embedded human-machine interface (HMI) design and automated motion control.|

Components (Things You will need)

Arduino Uno Arduino USB Cable Bread Board Jumper Wires LCD Display Stepper Motor Motor Driver Joystick

Building the circuit

Things Needed:

  • Arduino Uno Core Board
  • XY Joystick
  • Stepper Motor
  • IIC 1602 LCD
  • USB Cable & Jumper Wires
  • Bread Board
  • Motor Driver

Mounting the component on the breadboard and wiring the circuit

Step 1: Connect the Arduino 5V pin to the breadboard's positive (+) power rail and the Arduino GND pin to the negative (-) power rail.

Step 2: Place the XY Joystick on the breadboard. - Connect the VCC pin to the 5V power rail on the breadboard - Connect the GND pin to the ground rail on the breadboard - Connect the VRx pin to Analog Pin A0 - Connect the VRy pin to Analog Pin A1 - Connect the SW (switch) pin to Digital Pin 2

Step 3: Place the ULN2003 Motor Driver Board on the breadboard (for the Stepper Motor). - Connect the VCC pin to the 5V power rail on the breadboard - Connect the GND pin to the ground rail on the breadboard - Connect IN1, IN2, IN3, and IN4 to Digital Pins 8, 9, 10, and 11 respectively - Plug the Stepper Motor connector into the driver board

Step 4: Place the IIC 1602 LCD on the breadboard. - Connect the VCC pin to the 5V power rail on the breadboard - Connect the GND pin to the ground rail on the breadboard - Connect the SDA pin to Analog Pin A4 - Connect the SCL pin to Analog Pin A5

Step 5: Ensure all components share a common GND connection, then verify all wiring before connecting the Arduino Uno to your computer using the USB cable.

Components on breadboard

Step 6: After confirming that all connections are correct, connect the USB cable to the Arduino Uno board and the computer to power the circuit.

Make sure to connect the Arduino USB cable to the Arduino board.

PROGRAMMING

Step 1: Open your Arduino IDE. See how to set up here: Getting Started.

Step 2: Write the complete program implementing the system logic with appropriate pin definitions, setup configuration, and the main control loop.

#include <Stepper.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

const int stepsPerRevolution = 2048;
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
LiquidCrystal_I2C lcd(0x27, 16, 2);

const int joyX = A0;
const int joySW = 2;

void setup() {
  myStepper.setSpeed(10);
  lcd.init();
  lcd.backlight();
  pinMode(joySW, INPUT_PULLUP);
  lcd.setCursor(0, 0);
  lcd.print("System Ready");
}

void loop() {
  int xVal = analogRead(joyX);
  if (xVal < 400) {
    myStepper.step(10);
    lcd.setCursor(0, 1);
    lcd.print("Moving CW ");
  } else if (xVal > 600) {
    myStepper.step(-10);
    lcd.setCursor(0, 1);
    lcd.print("Moving CCW");
  } else {
    lcd.setCursor(0, 1);
    lcd.print("Stationary");
  }
}


Step 7: Save your code. See the Getting Started section

Step 8: Select the arduino board and port See the Getting Started section:Selecting Arduino Board Type and Uploading your code.

Step 9: Upload your code. See the Getting Started section:Selecting Arduino Board Type and Uploading your code

CONCLUSION

Operating physical input devices instantly modifies actuator behavior and updates visual indicators in real time.