Advertisements

Archive for June 29th, 2017

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.

 

Advertisements

,

13 Comments