Joystick Module (KY-023)

A Joystick Module (such as the KY-023 or 504-style) is a dual-axis analog input device containing two independent potentiometers configured to track physical movement along the X and Y…

Sensors14 blocksMicroPythonC++
Dual-Axis Joystick Module (KY-023)

At a glance

Pins and properties exactly as the circuit editor and simulator define this part. The text below explains how to use them.

Pinout

Pinout of the Dual-Axis Joystick Module (KY-023), drawn as in the circuit editor. Select a label to see that pin in the table below.

Pins

Pins of this part
PinLabelType
GNDGNDGround
VCC+5VPower in
VRXVRXAnalog out
VRYVRYAnalog out
SWSWSignal out

Properties

What you can change in the Property Inspector.

Properties of this part
PropertyRange or choicesDefault
X-Axis (VRX)0 to 1023512
Y-Axis (VRY)0 to 1023512
Push Switch (SW)On or offoff

A Joystick Module (such as the KY-023 or 504-style) is a dual-axis analog input device containing two independent potentiometers configured to track physical movement along the X and Y axes, along with a momentary push-button switch triggered by pressing the stick knob. In Open Maker Studio, joysticks are used for robotic arm controls, motor steering, threshold adjustments, and user menus.


1. Hardware Specifications & Pinout

  • Axes: 2 analog outputs (VRx for horizontal, VRy for vertical).
  • Midpoint Voltage: ~1.65V (when powered by 3.3V) or ~2.5V (when powered by 5.0V).
  • Switch Pin (SW): Normally-open momentary digital button (active-LOW, requires internal or external pull-up).
  • Pin Configuration:
    • GND: Common Ground.
    • +5V / VCC: Power input (3.3V or 5V).
    • VRx (X-Axis): Outputs variable analog voltage (ranges 0 to VCC).
    • VRy (Y-Axis): Outputs variable analog voltage (ranges 0 to VCC).
    • SW (Switch): Outputs digital LOW when pressed, HIGH when released.

2. How it Works & Midpoint Calibration

  • Potentiometer Divisors: Moving the stick changes the wiper position on the two internal 10 kΩ10\ \text{k}\Omega resistive tracks.
  • Deadzone Handling: Due to manufacturing tolerances, the resting center position is never exactly 50%50\% of the maximum voltage. It usually sits between 48%48\% and 52%52\% (analog value ~512 on 10-bit ADC).
  • Midpoint Range: A deadzone threshold (default: 30%30\% of travel) is enforced by the Blockly blocks to prevent noise or slight off-center offsets from registering as continuous directional input.

3. Component Properties

The joystick now has a real simulated component (ky023_joystick) — drag it onto the Circuit Canvas from the Components palette. It exposes three properties, all also directly interactive on the canvas (Section 4):

  • X-Axis (VRX) (xVal) — range 0–1023, default 512 (centered).
  • Y-Axis (VRY) (yVal) — range 0–1023, default 512 (centered).
  • Push Switch (SW) (swPressed) — boolean toggle, default false.

All five real pins are wired: GND/+5V power the module, VRX/VRY are real analog outputs whose voltage is a proportional divider driven by xVal/yVal (two independent 10 kΩ potentiometer models, one per axis), and SW is a real digital output the simulator pulls LOW when swPressed is true (10Ω to GND) or leaves floating high (100MΩ to GND) when false — matching a real switch with no onboard pull-up, same as the note in Section 1.


4. Simulator Behavior

With the component placed and the circuit running:

  • Drag the thumbstick anywhere within its travel radius to set xVal/yVal continuously between 0 and 1023 — releasing it springs back to center (512, 512) automatically, matching a real spring-loaded joystick module.
  • Click the center of the thumbstick (not drag) to press the switch — swPressed is true while held down and returns to false the moment you release, whether you release on the stick or anywhere else on the page.
  • A live text readout above the component shows X:<xVal> Y:<yVal> SW:<0 (LOW) / 1 (HIGH)> continuously while powered — always-visible, not a hover-only tooltip. The component also glows while the switch is held.

5. Supported Blockly Blocks

Drawing the blocks…

Joystick Module (KY-023) — OMS Parts