science tinker

Joystick module (KY-023)

A thumb stick like the one on a game controller: two analog outputs for left–right and up–down, and a push switch.

Switches and controls · Elements inside: CCuNiFeHSiO

Function: what the KY-023 does in a circuit

A thumb stick like the one on a game controller: two analog outputs for left–right and up–down, and a push switch.

  • Reports left–right and up–down position
  • Has a push switch under the stick
  • Steers robots, games and camera mounts

KY-023 key facts

Supply3.3 V to 5 V
Axestwo 10 kΩ potentiometers
At restabout half the supply on VRx and VRy (512 of 1023)
SwitchSW connects to GND when pressed
PinsGND, +5V, VRx, VRy, SW

KY-023 pinout

The legs from left to right, as the part is drawn in the simulator:

No.Name
1GND
2+5V
3VRx (left–right)
4VRy (up–down)
5SW (push switch)

How it works

The stick turns two 10 kΩ potentiometers at right angles. Each one is a voltage divider: at rest VRx and VRy sit at half the supply (about 512 from analogRead), and they move towards 0 or 1023 as you push the stick. Pressing the stick down closes a switch that connects SW to GND, so read SW with pinMode(pin, INPUT_PULLUP): it is LOW when pressed. Springs bring the stick back to the centre.

What it is made of

  • Potentiometers: Carbon resistive tracks with metal wipers CCuNi
  • Stick and cap: Steel shaft with a rubber or plastic cap FeCH
  • Board: Glass-fibre and epoxy circuit board SiOC

Where the materials come from: Carbon from petroleum coke or graphite; copper and nickel from their ores; iron from iron ore (Australia, Brazil).

The chemistry

The resistive track is carbon particles in a binder. The wiper touches it part-way along, so the output voltage is a fraction of the supply.

Biology connection

Moving a joystick precisely uses pairs of muscles that pull against each other, guided by position sensors in your joints. Muscles and levers →

Safety and the environment

The centre is rarely exactly 512: allow a "dead zone" of about ±30 around it in your code. Do not connect SW to 5V.

Did you know? Most analog sticks in game controllers work this way, though newer ones use magnets and Hall-effect sensors, which do not wear out.

Try it in the simulator

Build and code a circuit with a Joystick module in these practice projects:

Questions students ask

What does the KY-023 do?

A thumb stick like the one on a game controller: two analog outputs for left–right and up–down, and a push switch. Main functions: reports left–right and up–down position; has a push switch under the stick; steers robots, games and camera mounts.

How do I read a joystick module?

Connect VRx and VRy to two analog pins and read them with analogRead(): about 512 at rest, 0 or 1023 at the ends. Connect SW to a digital pin set to INPUT_PULLUP: it reads LOW while the stick is pressed.

What are the connections of the KY-023?

In order: GND, +5V, VRx (left–right), VRy (up–down), SW (push switch).

How does the KY-023 work?

The stick turns two 10 kΩ potentiometers at right angles. Each one is a voltage divider: at rest VRx and VRy sit at half the supply (about 512 from analogRead), and they move towards 0 or 1023 as you push the stick. Pressing the stick down closes a switch that connects SW to GND, so read SW with pinMode(pin, INPUT_PULLUP): it is LOW when pressed. Springs bring the stick back to the centre.

What is the KY-023 made of?

Potentiometers: Carbon resistive tracks with metal wipers. Stick and cap: Steel shaft with a rubber or plastic cap. Board: Glass-fibre and epoxy circuit board.

Is the KY-023 safe? How should it be recycled?

The centre is rarely exactly 512: allow a "dead zone" of about ±30 around it in your code. Do not connect SW to 5V.

More switches and controls

Know someone who would use this?

It’s free for every learner. Send it to your class, team or club.

Updated · Free, no sign-up ·

Connected tools

The same idea from another angle, across the site.