Arduino Joystick: Button Pullup FAIL

I wired a resistive joystick to the knockoff Nano controlling the crystal tester and connected the button to an analog input because I have a lot of those left over and why not. Unfortunately, the ADC returned a sequence of random-ish numbers indicating the button didn’t have a pullup to +5 V.

One might be forgiven for assuming the pads marked R5 would hold such a pullup resistor, had the joystick not been relentlessly cost-reduced:

Keyes resistive joystick - R5 location

Keyes resistive joystick – R5 location

One would, of course, be completely wrong.

Having been around this block several times, I measured the pad-to-pin resistances and found R5 firmly affixed to the GND and +5V pins, with the SW (a.k.a. button) pin floating free. Pressing the joystick hat closes the switch next to R5, thereby connecting the SW pin to GND.

Baffles me. Maybe a fresh intern did the PCB layout and just misplaced the resistor?

So I soldered an ordinary resistor (*) between the +5 V and SW pins:

Keyes resistive joystick - button pullup

Keyes resistive joystick – button pullup

Now it works just as it should.

(*) For long-lost reasons, I have a zillion 12.4 kΩ 1% resistors appearing in place of simple 10 kΩ resistors.



  1. #1 by madbodger on 2017-06-29 - 08:50

    I believe the processor can engage pullups on the analog pins, but when you have a heap of 12.4kΩ resistors lying around, it’s probably more reliable to just use those.

    • #2 by Ed on 2017-06-29 - 12:29

      Plus, I wanted to run the button directly into A1 for E-Z wiring. It’s possible to turn A1 into a digital input with an internal pullup, but, having begun the exercise with the notion of just soldering a chip onto those obvious pads, an external resistor seemed a perfectly reasonable conclusion.

      [grumble, etc]

  2. #3 by Vedran on 2017-06-29 - 15:05

    We have a couple of these from a kit but I don’t think we ever used one. I’ll have to take a quick peek next time I’m around lab :)

    Oh and a bit of errata, second to last paragraph should probably read: “Now it works just [AS] it should.” Too bad you’re not treating them like Knuth :)

    • #4 by Ed on 2017-06-30 - 08:57

      Fixed! Thanks.

      Were I foolish enough to use his bug bounty algorithm, I’d be deep in debt by now. May he live forever!

      • #5 by Vedran on 2017-06-30 - 11:25

        I wonder how many of those checks ever got cashed in – probably not much. I mean it IS the ultimate geek currency :)

  3. #6 by tantris on 2017-06-29 - 17:32

    The other thing these joysticks could use is a top-plate with a round hole for the knob. And that could also limit the movement, so it doesn’t go all the way to the end. At least mine show some shouldn’t-be-there-resistance at the stop positions.

    • #7 by Ed on 2017-06-30 - 09:01

      It definitely cries out for a case protecting all those solder points. I’ve already scribbled several high-style and completely un-printable designs; right now, it dangles safely an inch off the workbench.

      • #8 by Vedran on 2017-06-30 - 11:22

        It seems like a job for the mill to me, maybe from a nice aluminum or Delrin scrap piece… I know, I know… that way lies madness :)

  1. LF Crystal Tester: Joystick for Oscillator Offset Adjustment | The Smell of Molten Projects in the Morning
  2. LF DDS Sine Generator With 0.1 Hz Steps | The Smell of Molten Projects in the Morning