Extension board · Sensors and inputs

Thumb joystick breakout

A console-style thumb joystick on a chainable analogue board: two potentiometers give the X and Y position as voltages, and pressing the stick closes a switch. The controller firmware can act on the switch today; reading the two axes needs a driver that does not exist yet.

Top view of the thumb joystick board: a ten-contact socket on the left and right edges and the square joystick with its round cap in the middle.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
2 axes + switchAlps RKJXV thumb joystick, 10 kΩ per axis
0 to 3.3 Vratiometric outputs, centre near half supply
±23°operating angle of the stick
< 1 mAcalculated, from the 3.3 V pin only
2 socketstype A input and chain
50 × 40millimetres, four M3 holes

Tech specs

PurposeJogging two machine axes by hand, menu navigation, pointing a camera or small robot
JoystickAlps Alpine RKJXV1224005: two linear 10 kΩ (±30 %) potentiometers and a push switch
OutputsX and Y analogue voltages through a 1 kΩ and 10 nF filter each; switch active low with a 10 kΩ pull-up
Supply3.3 V from the socket. 5 V only passes through to the chain socket
SocketsTwo 10-contact Gadgeteer type A sockets (Samtec SHF-105, 1.27 mm): input and chain
Test pointsSix on the underside: 3.3 V, ground, 5 V, X, Y and switch
Size50 × 40 mm, four M3 mounting holes
Works withSmoothieboard V2 Prime, header GH: switch through the button box module; no firmware driver for the axes
LicenceOpen hardware, CERN-OHL-S-2.0

Every figure with its basis is in the electrical specifications appendix; hole positions are in the mounting dimensions appendix.

Board tour

The numbers on the drawing match the list below it. The board is shown from the component side.

  1. 1
    Input socket A IN (J1) — The type A socket to the controller. Contact 3 is X, 4 is Y and 6 is the switch.
  2. 2
    Chain socket A CHAIN (J2) — Passes the unused contacts to a further board. The three contacts this board uses are cut off from it by open solder links.
  3. 3
    Thumb joystick (RV1) — Two potentiometers and a push switch in one metal-framed body. The cap is not part of the joystick part number: choose one for its 4 mm shaft.
  4. 4
    Wiper resistors (R1, R2) — 1 kΩ in series with the X and Y wipers. They also limit the current if a controller pin is driven by mistake.
  5. 5
    Axis filter capacitors (C1, C2) — 10 nF to ground on the X and Y outputs, to remove high-frequency noise.
  6. 6
    Switch network (R3, R4, C3) — 10 kΩ pull-up, 1 kΩ series resistor and 100 nF capacitor: a clean active-low signal.
  7. 7
    Supply capacitors (C4, C5) — 100 nF and 10 µF on the 3.3 V rail that feeds both potentiometers.
  8. 8
    Chain links (JP3, JP4, JP6) — Open as delivered. Closing one hands that contact to the chain socket.
  9. 9
    Mounting hole — One of four M3 holes in the corners, not connected to ground.
Point at a number, or tap it, to read what the part is; the same text is in the list. On a small screen, scroll the drawing sideways.

Pinout

The Gadgeteer socket numbers contacts 1 to 10; check numbering with the power removed before wiring by hand.

J1: input socket (A IN)

ContactSignalUsePrime header GH
13.3 VFeeds the potentiometers and pull-up3.3 V
25 VPassed to the chain socket only5 V
3X_OUTX axis voltagePC3 (ADC1_5)
4Y_OUTY axis voltagePA3 (ADC1_6)
5Passed throughNot used herePC2 (ADC1_4)
6SW_OUTSwitch, low when pressedPF2
7, 8, 9Passed throughNot used herePI10, PH7, PB12
10GNDGroundGND

J2: chain socket (A CHAIN)

Contacts keep their numbers. Contacts 1, 2, 5, 7, 8, 9 and 10 are joined straight to J1.

ContactOn J2
1, 2, 103.3 V, 5 V and ground, always connected
3, 4Only with JP3 or JP4 closed
6Only with JP6 closed
5, 7, 8, 9Always passed through

What you need

A controller socketPrime header GH, whose contacts 3 and 4 are analogue inputs.
A ten-way cableA 1.27 mm Gadgeteer ribbon cable, or four to six wires.
A thumb capFor the 4 mm shaft; check it clears nearby parts at full tilt.
For the axesFirmware or host code that reads two analogue inputs. None is supplied.

Get started

Minimum wiring: contact 1 to contact 1, 3.3 V; PC3, contact 3 to contact 3, X axis; PA3, contact 4 to contact 4, Y axis; PF2, contact 6 to contact 6, switch; contact 10 to contact 10, ground. Prime header GH (J39) Joystick J1 (A IN) contact 1contact 13.3 V PC3, contact 3contact 3X axis PA3, contact 4contact 4Y axis PF2, contact 6contact 6switch contact 10contact 10ground
The five connections the board needs. A straight ten-way cable makes all of them.
  1. Mount the board

    Use the four M3 holes with insulating spacers, and leave room for the cap to tilt 23 degrees in every direction.

  2. Connect with the power off

    Plug J1 into header GH. Never connect the element supply or a signal to 5 V.

  3. Check the voltages

    Power up and measure between ground and test points X and Y with the stick released.

    By the joystick data sheet each axis rests between 41 % and 59 % of 3.3 V, about 1.35 to 1.95 V; at full tilt it goes below 26 % or above 74 %.

  4. Add the switch to the configuration

    Use the button box entry in the next section, restart, and press the stick while watching a terminal.

    The configured command should run once per press. Which direction raises X or Y is not given by the files: note it on your board and swap it in your own code if needed.

Configuration

You wantModuleExample
Act on a press of the stickButton boxThe entry below
Read the X and Y positionNoneNo firmware module reads a joystick
Jog axes with the stickNoneNo analogue jogging exists

Add this to config.ini. PF2! inverts the pin, so the button counts as pressed when the board pulls it low. Replace the echo command with the command you want to run.

[button box]
stick.enable = true
stick.pin = PF2!
stick.press = echo joystick pressed

The syntax follows the SmoothieV2 button box module and its sample configuration. SmoothieV2 names the analogue inputs on PC3 and PA3 ADC1_5 and ADC1_6, but has no module that turns them into jogging or menu movement.

How it works

Each potentiometer wiper passes through a resistor and capacitor filter to an analogue contact; the switch pulls a resistor-held line low. Stick X10 k element 1 k + 10 nFfilter J1 contact 3ADC1_5 Stick Y10 k element 1 k + 10 nFfilter J1 contact 4ADC1_6 Push switchcloses to ground 1 k, 10 k, 100 nFdebounce J1 contact 6PF2
Three independent paths; there is no active electronics on the board.

Each axis is a voltage divider across the socket’s 3.3 V. Because the controller’s converter measures against the same supply, a slightly high or low rail does not move the reading: the output is a fraction of the supply. The data sheet asks for a load above 1 MΩ on the wiper, so the board adds no resistor to ground. Releasing the stick springs it to centre, but the centre voltage varies from part to part, so software needs a calibration step and a dead band.

The switch line is held at 3.3 V by 10 kΩ and pulled down through 1 kΩ when pressed, which gives about 0.3 V. The 1 kΩ also limits the capacitor’s discharge through the contact.

Solder links

Three links keep the joystick’s own signals off the chain. Leave them open while the joystick is in use: another device on the same contact would corrupt the reading.

Solder links as delivered: JP3 open; JP4 open; JP6 open. JP3 · openchain contact 3 JP4 · openchain contact 4 JP6 · openchain contact 6
The links as delivered. Close one with a small blob of solder across both pads; open it by removing the solder or cutting the copper between the pads.
LinkWhat it doesAs delivered
JP3Joins J1 contact 3 (X) to J2 contact 3Open
JP4Joins J1 contact 4 (Y) to J2 contact 4Open
JP6Joins J1 contact 6 (switch) to J2 contact 6Open

Chaining

A second board plugged into A CHAIN can use contacts 5, 7, 8 and 9. Contacts 3, 4 and 6 belong to the joystick. The chain does not create new controller pins.

The controller's ribbon cable goes to the connector A IN of the thumb joystick board. Inside the board each of the ten pins runs through a solder link to the connector A CHAIN, where a second ribbon cable continues to the next board. A closed link passes its pin on, an open link stops it. Controller one ten-pin port thumb joystick board A IN A CHAIN pin 3, X axis stops here pin 4, Y axis stops here pin 5, free passed on one solder link per pin Next board sees what is passed on
Chaining: one port of the controller serves two boards. Pin 1 of A IN leads to pin 1 of A CHAIN, pin 2 to pin 2, and so on, each through its own solder link. The three lines stand for the ten pins and show the links as delivered. Two boards must never drive the same pin, and a pin that one board uses for a signal is not free for the next. Pins 3 and 4 stop at this board; pin 5 is wired straight through.
ContactSignalOn A CHAIN
1, 23.3 V, 5 VPassed on
3, 4X, YStopped by open links
5Free analogue inputPassed on
6SwitchStopped by an open link
7, 8, 9FreePassed on
10GNDPassed on

Troubleshooting

SymptomLikely causeWhat to check
Both axes read near zeroNo 3.3 VTest point 3.3 V; cable seating and orientation
Centre is not half the supplyNormal part spread (41 to 59 %)Calibrate the centre with the stick released and use a dead band
An axis moves the wrong wayDirection is not fixed by the design filesInvert it in your software
X and Y are exchangedAxis assignment taken from the part drawingSwap them in your software
Switch never triggersWrong pin or missing inversionUse PF2! and check test point SW goes to about 0.3 V when pressed
Switch is always activePin not invertedAdd ! after the pin name

The board has no indicator lights; the underside test points show every signal.

Still stuck? Read how to ask for help or see the general troubleshooting guide.

Downloads

FileWhat it is
Schematic (PDF)The circuit diagram
Parts list (CSV)Every component with its value, footprint and part number where one is chosen
Board drawing (PNG)The top view used on this page
3D view, top (PNG)Rendered from the design files; the joystick body is an approximate model
3D view, angled (PNG)Rendered from the design files; the joystick body is an approximate model

Appendix: mounting dimensions

For drilling a mounting plate or designing an enclosure. Positions are hole centres, in millimetres, measured from the top-left corner with the board seen from the component side. Keep metal hardware under the board clear of the joystick’s soldered tails.

Mounting drawing of the thumb joystick board, component side: outline 50 by 40 millimetres with 4 mounting holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 50 40 0, 0 X Y 1 5.00, 5.00 2 45.00, 5.00 3 5.00, 35.00 4 45.00, 35.00 Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 50 × 40 mm, corners rounded to a 1 mm radius, board thickness 1.6 mm. Drawn from the design files, component side up, in the same orientation as the board tour.
HoleX (mm)Y (mm)DiameterUse
15.005.003.2 mm, not platedMounting, M3 screw
245.005.003.2 mm, not platedMounting, M3 screw
35.0035.003.2 mm, not platedMounting, M3 screw
445.0035.003.2 mm, not platedMounting, M3 screw

Appendix: electrical specifications

Every figure is a design value, a calculated or simulated value, or a manufacturer’s data sheet value, as the last column says. A dash means no figure is given.

ParameterApplies toLowerNominalUpperBasis
Supply voltageJ1 contact 1—3.3 V5 VAlps data sheet element maximum 5 V DC; the board is designed for 3.3 V
Element resistanceRV17 kΩ10 kΩ13 kΩAlps data sheet
Supply current, stick released3.3 V—0.66 mA0.94 mACalculated; upper at −30 % element resistance
Extra current while pressed3.3 V—0.30 mA—Calculated
Centre outputContacts 3, 441 %50 %59 %Alps data sheet, share of supply
Full-tilt outputContacts 3, 426 % or lower—74 % or higherAlps data sheet, share of supply
Operating angleStick—23°—Alps data sheet
Axis settling to 0.1 %Contacts 3, 4—0.24 ms—Simulated, no controller load
Switch low levelContact 6—0.30 V—Simulated
Wiper loadContacts 3, 41 MΩ——Alps data sheet recommendation

Component stress limits

PartLimitUse on this board
Joystick elements5 V DC3.3 V
Push switch contact50 mAAbout 3 mA discharge peak (calculated)
Filter capacitors50 V3.3 V
Series resistors on a wrongly driven pin3.3 mA at 3.3 VCalculated limit set by 1 kΩ

Appendix: simulation

The wiper filter and the switch network were simulated with ngspice. The wiper case uses the middle of a 10 kΩ element, which gives the highest source resistance.

Each simulated value (yellow mark) against its allowed range (green band). Centre output at 3.3 V, 10 k element, no load1.65 V Settling to 0.1 % after a step242 µs Switch output when pressed300 mV Switch output 5.9 ms after release3.29 V
Simulated value (yellow) against the limit used for it (green). Each bar has its own scale.
ResultSimulated valueLimitOutcome
Centre output at 3.3 V, 10 k element, no load1.65 V1.64 V to 1.66 VWithin
Settling to 0.1 % after a step242 µsat most 1 msWithin
Switch output when pressed300 mVat most 500 mVWithin
Switch output 5.9 ms after release3.29 V3.2 V to 3.31 VWithin

Not simulated: stick travel, wiper noise and contact bounce (the manufacturer gives no model), the controller’s sampling load, ground offsets, electrostatic discharge and temperature.

Appendix: datasheet

The first page of the joystick’s manufacturer specification. Click the page to open the PDF. The copy is the series specification and drawing; match the variant you buy against the drawing.

First page of the RKJXV series thumb pointer specification and drawing datasheet
RKJXV series thumb pointer specification and drawing — Alps Alpine, 14 pages.

See all boards on the extension boards page.

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.