Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Dual Servo Joystick Interface

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Dual Servo Joystick Interface

Circuit Documentation

Summary

The circuit in question is designed to interface an Arduino UNO with a joystick module and two Tower Pro SG90 servos. The joystick provides two-axis input to the Arduino, which can be used to control the servos or for other interactive purposes. The servos are powered by a 5V battery, and the joystick module also receives its power from the same battery. The Arduino reads the analog values from the joystick and outputs the data through its serial interface.

Component List

Arduino UNO

Tower Pro SG90 Servo (x2)

Joystick Module

5V Battery

MB102 Breadboard Power Supply Module 3.3V/5V

Wiring Details

Arduino UNO

Tower Pro SG90 Servo

Joystick Module

5V Battery

Documented Code

// Code for Arduino UNO to read joystick values and print them to the serial monitor.

const int xPin = A0, yPin = A1; // Joystick pins connected to Arduino's analog pins A0 and A1
float xValue, yValue; // Variables to store joystick values

void setup() {
  pinMode(xPin, INPUT); // Set the joystick X-axis pin as input
  pinMode(yPin, INPUT); // Set the joystick Y-axis pin as input
  Serial.begin(9600); // Start serial communication at 9600 baud rate
}

void loop() {
  xValue = analogRead(xPin); // Read the value from the joystick X-axis
  yValue = analogRead(yPin); // Read the value from the joystick Y-axis

  // Print the X-axis value to the serial monitor
  Serial.print("Value of x-axis: ");
  Serial.println(xValue);

  // Print the Y-axis value to the serial monitor
  Serial.print("Value of y-axis: ");
  Serial.println(yValue);

  delay(100); // Wait for 100 milliseconds before reading the values again
}

Note: The code provided is for the Arduino UNO microcontroller to read the analog values from the joystick module and output them to the serial monitor. The servos are not controlled in this code snippet. Additional code would be required to control the servos based on the joystick input.