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

How to Use SparkFun Qwiic Joystick: Examples, Pinouts, and Specs

Image of SparkFun Qwiic JoystickDesign with SparkFun Qwiic Joystick in Cirkit Designer

Introduction

The SparkFun Qwiic Joystick is a compact breakout board that provides an intuitive interface for user input. It combines an analog joystick with two buttons, offering a simple yet effective control mechanism for a wide range of applications, from gaming controllers to robotic control systems. The integration of Qwiic connectors simplifies the process of connecting the joystick to other devices, enabling a quick and secure setup without the need for soldering.

Explore Projects Built with SparkFun Qwiic Joystick

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Raspberry Pi Pico W Controlled RGB LED with Joystick Interaction: A project utilizing SparkFun Qwiic Joystick in a practical application
Raspberry Pi Pico W Controlled RGB LED with Joystick Interaction

This circuit features a Raspberry Pi Pico W microcontroller connected to a KY-023 Dual Axis Joystick Module and an RGB LED with individual resistors on each color channel. The joystick's analog outputs (VRx and VRy) are read by the microcontroller to control the color and brightness of the RGB LED in a dynamic fashion, as defined by the embedded Python code. The code implements a color-changing sequence that responds to the joystick's position, creating an interactive lighting system.

Open Project in Cirkit Designer
Image of Raspberry Pi Pico W Controlled RGB LED with Joystick Interaction: A project utilizing SparkFun Qwiic Joystick in a practical application
Raspberry Pi Pico W Controlled RGB LED with Joystick Interaction

This circuit features a Raspberry Pi Pico W microcontroller interfaced with a KY-023 Dual Axis Joystick Module and a four-pin RGB LED. The joystick's position controls the color of the RGB LED through PWM signals, with resistors limiting current to the LED's cathodes and a capacitor potentially used for debouncing the joystick's switch. The embedded code cycles through color sequences based on the joystick's Y-axis position, creating a dynamic lighting effect.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Name Description
GND Ground connection
3.3V Power supply input (3.3V from Qwiic system)
SDA I2C data line
SCL I2C clock line
INT Interrupt pin (active low)

Usage Instructions

Integration into a Circuit

  1. Powering the Device: Connect the Qwiic Joystick to a 3.3V power source through the Qwiic connect system.
  2. I2C Communication: Utilize the SDA and SCL lines for I2C communication with your microcontroller.
  3. Mounting: Secure the joystick in your design, ensuring that it is accessible and can move freely.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <Wire.h> // Include the I2C library (required for Qwiic)

// Define the I2C address for the Qwiic Joystick
#define JOYSTICK_ADDR 0x20

void setup() {
  Wire.begin(); // Join the I2C bus as a master
  Serial.begin(9600); // Start the serial communication
}

void loop() {
  Wire.beginTransmission(JOYSTICK_ADDR); // Start I2C transmission
  Wire.write(0x03); // Point to the specified register
  Wire.endTransmission(false); // End transmission, but keep the connection active

  Wire.requestFrom(JOYSTICK_ADDR, 5); // Request 5 bytes from the joystick
  while (Wire.available()) { // While bytes are available to read
    int joystickX = Wire.read(); // Read the X-axis value
    int joystickY = Wire.read(); // Read the Y-axis value
    int button1 = Wire.read(); // Read the button 1 value
    int button2 = Wire.read(); // Read the button 2 value
    // Print the values to the serial monitor
    Serial.print("X: ");
    Serial.print(joystickX);
    Serial.print(" Y: ");
    Serial.print(joystickY);
    Serial.print(" Button1: ");
    Serial.print(button1);
    Serial.print(" Button2: ");
    Serial.println(button2);
  }
  delay(500); // Wait for 500ms before the next loop iteration
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: Can I use the Qwiic Joystick with a 5V system? A: While the Qwiic system is designed for 3.3V, level shifting can be used to interface with 5V systems. However, direct connection without level shifting will damage the board.

Q: How do I change the I2C address of the joystick? A: The I2C address is fixed and cannot be changed for this device.

Q: Is it possible to use multiple Qwiic Joysticks on the same I2C bus? A: Since the I2C address is fixed, you cannot use multiple Qwiic Joysticks on the same bus without additional hardware, such as an I2C multiplexer.