Electronic – arduino – Analog Thumb Stick Problems

analogarduinomicrocontroller

Outline:

I'm trying to work with an Arduino and Analog thumb stick to get values for a simple differential drive robot I'm working on. The Keyes_Sjoys Arduino Joystick Module I have in my possession is giving me some strange numbers however.

Following axises Data I have:

  • X-axis range of 0 to a shaky 470-520 with a center value of 40.
  • Y-axis range of a solid 4 to solid 1023 with a center value of 605.

Problem

I haven't used analog sensors before but it seems pretty obvious that my X-axis ranges should feel somewhat similar to the Y-axis but they don't. In addition, the X-axis hits zero way way before even coming close to the edge for its operating range.

Is my sensor plain broke (it's new), or is there some way I can recalibrate the potentiometer?

Update 1:
Wiring is the same as in this tutorial, and I used the same code, just added another analog input.
http://arduino.cc/en/Tutorial/AnalogReadSerial

void setup(){
 Serial.begin(9600); 
}
void loop(){
  int X = analogRead(A0);
  int Y = analogRead(A1);

  Serial.print("X = ");
  Serial.print(X);
  Serial.print(" Y = ");
  Serial.println(Y);
  delay(3);
}

Best Answer

  1. Physically disconnect all connections of the module from the Arduino.
  2. Then, check the resistance between the Vcc pin of the module and the actual pins at each end of each little potentiometer in the joystick device on the module.
  3. Similarly, check resistance between the Ground pin of the module and the physical pins at each end of each potentiometer in the joystick device.
  4. Finally check the resistance between the VRx pin and each of the center contacts of the little potentiometers, and similarly with VRy.

In a working module, in each case you should see a zero or nearly zero (~10 Ohms) resistance for one specific potentiometer pin from the module pin.

Almost definitely the soldering of one of the device pins on the module board is not perfect - Most likely the Vcc pin to one of the X-axis potentiometer's pins won't give you the low resistance reading expected.

Re-solder that connection on the little PCB.