TK94DIGITALbeginner

Five-Direction Joystick

Four directions and a centre press wired as five switches — menu navigation with no ADC and no dead-zone maths.

Comes in this kit — not sold separately

Specifications

TypeFive-direction tactile switch
DirectionsUp, down, left, right, plus centre press
Pull-upsFitted on the module
Supply voltage3.3 V or 5 V
OutputFive digital lines

What it is

Not an analog joystick. Five separate momentary switches under one cap, so each direction is a plain digitalRead.

That makes it the opposite trade from a thumbstick. There is no calibration, no centre offset drifting with temperature, no dead zone to tune, and no ADC pins consumed — but there is also no proportional control. It is a D-pad.

For menus, that is the better part. A thumbstick has to be converted into discrete steps anyway, and doing that well means hysteresis and repeat timing; here the discretisation is mechanical and free.

All five bounce like any other switch, and diagonal presses can close two at once, which is either a feature or something to filter depending on what you are building.

Five-Direction Joystick — front
Front
Five-Direction Joystick — back
Back
Five-Direction Joystick — side
Side

Pinout

  • GND (negative): Like the negative terminal (-) of a battery, connect to the control board's GND
  • VCC (positive): Like the positive terminal (+) of a battery, connect to the control board's 3.3V or 5V (this module supports both 3.3V and 5V)
  • NC (no connection): No actual circuit connection, included for unified interface, can be left unconnected
  • SIGNAL (signal output): Joystick direction detection output pin, connect to the control board's analog input pin (e.g. Arduino A0 or Pico GPIO 26)
    • Outputs analog signal (0-1023), direction can be determined by reading analog value
    • Center value is about 512, pushing up decreases value, pushing down increases value

Wiring

Five-Direction Joystick wiring

  1. GND → Control board GND
  2. VCC → Control board 3.3V or 5V
  3. SIGNAL → Control board analog input pin (for direction detection)

Example

// Pin number: change this to match your wiring
#define SIGNAL_PIN A0   // Arduino analog input pin connected to SIGNAL (e.g. A0)

void setup() {
  // Start serial for debugging (9600 baud)
  Serial.begin(9600);
  
  Serial.println("Five-direction joystick program started");
  Serial.println("Reading SIGNAL pin analog value to determine direction");
}

void loop() {
  // Read SIGNAL pin analog value (0-1023)
  int signalValue = analogRead(SIGNAL_PIN);
  
  // Determine joystick direction (based on actual measured values)
  // Push up: 100-130
  // Push left: 270-290
  // Push down: 450-470
  // Push right: 1000-1024
  // Press: 180-190
  
  if (signalValue >= 100 && signalValue <= 130) {
    Serial.println("Push up");
  } else if (signalValue >= 270 && signalValue <= 290) {
    Serial.println("Push left");
  } else if (signalValue >= 450 && signalValue <= 470) {
    Serial.println("Push down");
  } else if (signalValue >= 1000 && signalValue <= 1024) {
    Serial.println("Push right");
  } else if (signalValue >= 180 && signalValue <= 190) {
    Serial.println("Press");
  } else {
    Serial.println("Center position");
  }
  
  // Print joystick status
  Serial.print("SIGNAL value: ");
  Serial.println(signalValue);
  
  delay(200);  // Wait 200 milliseconds before reading again
}

When it doesn’t work

Presses register several times.
Five switches, five sets of contact bounce. Debounce each line, or use a library that handles a whole set.
Two directions read together.
A diagonal press genuinely closes two. Decide whether that is a diagonal or an error, and filter accordingly.
I expected analog values.
Wrong part — this is five switches. An analog thumbstick reports two ADC values instead.

Lessons using TK94

Each one is a working build, not a snippet.

Edit this page — content/modules/five-direction-joystick.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

Five-Direction Joystick

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum