top of page

Controlling Servo motor with Joystick

Updated: Mar 19

In this project, we will see how to use a joystick module to control the servo motor using Arduino UNO. A servo motor is an electric device used for precise control of angular rotation.


Hardware requirements:


Arduino UNO:

Arduino UNO
Arduino UNO

The Arduino is a programmable #microcontroller, it's an open-source electronics proto-type platform. It interacts with the user by receiving input with the aid of sensors and provides the output employing LED, buzzer, etc.,


In order to know more about the Arduino UNO, refer to this article.


Breadboard:

Breadboard
Breadboard

A #breadboard is a flat piece of wood that is provided with holes that allow users to build a circuit including the components and connections without the need for soldering due to which it is reusable and finds its best usage for the students who are new to build circuits. The holes in any horizontal line will be in series whereas the vertical holes remain at an equipotential state. There are different sizes of breadboards available in the market which include "full size", "half -size" and, "mini-size" breadboards.


Servo motor:

Servo motor
Servo motor

A servomotor is a rotary or linear actuator that allows for precise control of angular or linear position, velocity, and acceleration. A servomotor is a closed-loop servomechanism that uses position feedback to control its motion and final position. In this project, we can either use SG90 or MG90 servo motor.


Joystick sensor module:

Joystick sensor module
Joystick sensor module

Joystick Sensor has two individual potentiometers one for each x and y axes to read the user's input. It is equipped with a freewheeling holder, that allows changing the knob of the potentiometer which changes resistance and inturn the analog output.


The potentiometers are connected between Vcc and Ground. It is used to control the pointer movement in two dimensions and is sometimes also called a Control Stick.

Pin diagram of joystick
Pin diagram of joystick

The potentiometers are placed perpendicular to each other. To read the joystick's physical position, we need to measure the change in resistance of the potentiometer. This change can be read by Arduino analog pin using ADC.


Connecting wires:

Connecting wires
Connecting wires

Connecting wires are used to establish connections between different components in the circuit.


Software requirements:


Arduino IDE:

Arduino IDE
Arduino IDE

The Arduino Integrated Development Environment (IDE) is a cross-platform application (for Windows, macOS, Linux) that is written in functions from C and C++. It is used to write and upload programs to Arduino compatible boards, but also, with the help of third-party cores, other vendor development boards.


Circuit Connection and its Working:



Circuit connection involves the following steps:

  • The Ground pin of the Analog Joystick is connected to the ground pin of the Arduino UNO.

  • The 5V pin of the Analog Joystick is connected to the 5V pin of the Arduino UNO.

  • The VRx pin of the Joystick is connected to the Analog pin A0 of the Arduino UNO.

  • The control pin of the Servo motor is connected to the digital PWM PIN number 9 of the Arduino UNO.

  • The Vcc and ground pins of the Servo motor are connected to 5V and ground pins of the Arduino UNO respectively.


Code:




Project By - Anupama Koley and Neha Patil



 

See also:


















Follow us -


Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes and contests.



Content Written by-


Name - Kiranmai Chigurupati

Portfolio Link - click here

bottom of page