Supplier photo of an assembled radio kit with a purple circuit board, telescopic antenna and clear case.
Supplier photo
Temu affiliate offer ยท Project idea

Build a radio

Soldering required. Check the supplied parts and board revision.

View kit on Temu

Tricky Circuit may earn a commission through these links. Product ideas have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

๐ŸŽฎ๐Ÿ”ฅ How to control both the SG90 servo and the 28BYJ-48 stepper motor with the joystick. This is a great setup for a robotic arm or a turret-like system!


๐Ÿ”น How It Will Work

  • Joystick X-axis โ†’ Controls the stepper motor (left/right rotation).
  • Joystick Y-axis โ†’ Controls the servo motor (up/down movement).

๐Ÿ”น Components Needed

โœ… Arduino (Uno/Nano/etc.)
โœ… SG90 Servo Motor
โœ… 28BYJ-48 Stepper Motor + ULN2003 Driver
โœ… Joystick Module (KY-023 or similar)
โœ… Jumper Wires & Breadboard


๐Ÿ”น Circuit Connections

๐Ÿ”ธ 28BYJ-48 Stepper to ULN2003 Driver

Stepper WireULN2003 Pin
RedVCC (5V)
BlueIN1
PinkIN2
YellowIN3
OrangeIN4
BlackGND

๐Ÿ”ธ ULN2003 Driver to Arduino

ULN2003 PinArduino Pin
IN18
IN29
IN310
IN411
VCC5V
GNDGND

๐Ÿ”ธ SG90 Servo to Arduino

Servo PinArduino Pin
VCC (Red)5V
GND (Brown/Black)GND
Signal (Orange)Pin 6

๐Ÿ”ธ Joystick to Arduino

Joystick PinArduino Pin
VCC5V
GNDGND
VRX (X-axis)A0
VRY (Y-axis)A1

๐Ÿ”น Arduino Code (Joystick Control for Both Motors)

#include <Servo.h>
#include <Stepper.h>

const int stepsPerRevolution = 2048;  // Steps per full rotation for 28BYJ-48
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);  // Stepper connected to pins 8,9,10,11

Servo myServo;  // Servo object

int joyX = A0;  // Joystick X-axis
int joyY = A1;  // Joystick Y-axis

void setup() {
    myStepper.setSpeed(10);  // Set stepper speed (adjustable)
    myServo.attach(6);  // Attach servo to Pin 6
}

void loop() {
    int xValue = analogRead(joyX);  // Read joystick X-axis (0-1023)
    int yValue = analogRead(joyY);  // Read joystick Y-axis (0-1023)

    // Control Stepper Motor (Left/Right Movement)
    if (xValue < 400) {  
        myStepper.step(-10);  // Move stepper left
    } 
    else if (xValue > 600) {  
        myStepper.step(10);  // Move stepper right
    }

    // Control Servo Motor (Up/Down Movement)
    int servoAngle = map(yValue, 0, 1023, 0, 180);  // Convert joystick value to 0-180ยฐ
    myServo.write(servoAngle);
}

๐Ÿ”น How It Works

  • Move joystick left/right โ†’ The stepper rotates left/right.
  • Move joystick up/down โ†’ The servo tilts up/down.
  • When centered, both motors stay in their current positions.

๐Ÿ”น Next Steps & Enhancements

๐Ÿ”ฅ Smooth Stepper Movement: Instead of step(-10) or step(10), try map(xValue, 0, 1023, -50, 50).
๐Ÿ”ฅ Button Control: Add a button to reset both motors to their default position.
๐Ÿ”ฅ Speed Control: Use joystick press (SW pin) to switch between fast and slow movement.


๐Ÿš€ Whatโ€™s Next?

Would you like to add another servo for a robotic arm? ๐Ÿค–๐Ÿ”ฅ

๐Ÿ“กBroadcast the signal โ€” amplify the connection.

Leave a Reply

Temu affiliate offers

Find your next electronics project

Explore these do-it-yourself project kits. Check the selected option, included parts and instructions on each offer.

Tricky Circuit may earn a commission if you buy through these Temu affiliate links. These are product ideas; they have not been bench-tested by Tricky Circuit and are not verified lesson parts lists.

Supplier photo of an assembled infinity mirror light cube illuminated on a dark background.

Supplier product photo

Build an infinity light cube

Listing specifies 5-volt direct current. Soldering required; battery and glue not included.

View kit on Temu

Supplier photo of a breadboard, jumper wires and assorted electronic components in a plastic storage case.

Supplier product photo

Try breadboard experiments

Breadboard, wires and assorted parts. Arduino controller board not included.

View kit on Temu

Supplier photo of an assembled blue surface-mount soldering practice board with a circular ring of small lights.

Supplier product photo

Solder a chasing-light board

Surface-mount soldering practice. Battery and battery holder not included.

View kit on Temu