Controlling 2 Servos With Joystick on Arduio UNO

3,819

44

8

Introduction: Controlling 2 Servos With Joystick on Arduio UNO

Today I will guide you step by step on how to control 2 servos at the same time, which is useful for a robot arm

Step 1: What You Need

1. 1x Arduino UNO

2. 1x Joystick Module

3. 2x Servo Motors

4. 1x Breadboard

5. 12x Jumper Cables

6. USB Power Cord

Step 2: Connecting Servos

Servo 1:

Connect Ground(Brown) To ground on Breadboard

Connect Power(Red) To Power on Breadboard

Connect Imput(orange) To Pin 9

Servo 2:

Connect Ground(Brown) To ground on Breadboard

Connect Power(Red) To Power on Breadboard

Connect Imput(Orange) To Pin 10

Step 3: Connecting Joystick

1.Connect Ground On Joystick To Ground on Arduino

2.Connect +5V to To Power on Breadboard

3.Connect VRx to A1

4.Connect VRy to A0

Step 4: Connecting Arduino to Breadboard

1. Connect 5V To Power on Breadboard

2.Connect Ground To Ground on Breadboard

Step 5: Code

Open with Arduino IDE and you are good to go!

First Time Authors Contest 2016

Participated in the
First Time Authors Contest 2016

Arduino Contest 2016

Participated in the
Arduino Contest 2016

3 People Made This Project!

Recommendations

  • Make it Glow Contest

    Make it Glow Contest
  • First Time Author Contest

    First Time Author Contest
  • PCB Challenge

    PCB Challenge

8 Discussions

0
VicenteO6
VicenteO6

2 years ago

Just a note, in the code, this line :

VerticalServo.write(180-HorizontalServoPosition);

should be : VerticalServo.write(180-VerticalServoPosition);

0
DeonS14
DeonS14

Reply 2 years ago

Thankyou couldnt figure out why only one of my axis was workig

0
DonW93
DonW93

3 years ago

Great Job on this project..

Just a quick note; if any analog connection is open, both servos will respond to the one connected (A0,A1).

0
jackmachiela
jackmachiela

4 years ago

Looks great, now add a laser to it!

https://www.instructables.com/id/Basic-Doomsday-Device/

0
CarterW16
CarterW16

4 years ago

I'm impressed, did you really design this yourself?

0
Swansong
Swansong

4 years ago

Looks good, welcome to Instructables!