ArrowtronElectronics Store
Free shipping over ₹999
100% genuine components
Dispatch in 1–2 days
Secure payments · UPI, Cards

Joystick-Controlled Pan-Tilt Servo Mount

Move two servos smoothly with a thumb joystick — the exact mechanism behind camera gimbals, robot heads and sensor turrets.

Beginner~1 hour5 components

What you’ll build

The joystick is two potentiometers: X and Y. The Arduino Nano maps each axis to a servo angle, driving an SG90 pair arranged as a pan-tilt bracket. Push the stick and the mount follows in real time.

Components you’ll need

ComponentQtyPrice
Arduino Nano ATmega328P Compatible Board1₹149
Joystick Module1₹39
SG90 Micro Servo Motor 9G2₹178
400 Point Breadboard1₹299
Jumper Wires MM1₹299
Total₹964

Step-by-step guide

  1. Wire the joystick: VCC to 5V, GND to GND, VRx to A0, VRy to A1.
  2. Connect the pan servo signal to D5 and the tilt servo signal to D6; power both from 5V and GND (use the breadboard rails).
  3. If the servos twitch, add a 100–1000µF capacitor across the servo power rails.
  4. Stack the servos into a pan-tilt bracket, or hot-glue the tilt servo onto the pan servo’s horn.
  5. Upload the sketch and steer with the stick — movement is smoothed so the mount doesn’t jerk.

The code

Mapping is direct: 0–1023 from each pot becomes 0–180 degrees, with a small smoothing filter for fluid motion.

#include <Servo.h>
Servo pan, tilt;
float px=90, py=90;
void setup(){ pan.attach(5); tilt.attach(6); }
void loop(){
  int tx = map(analogRead(A0), 0, 1023, 0, 180);
  int ty = map(analogRead(A1), 0, 1023, 0, 180);
  px += (tx - px) * 0.15;   // smoothing
  py += (ty - py) * 0.15;
  pan.write(px); tilt.write(py);
  delay(15);
}

Build this project

Add all 5 required components to your cart in one click — total ₹964.

Add all components to cart
Scroll to Top