Interface between Arcade style trackball and Arduino

Hey guys, am back to bother you all with questions about another random project I am doing. So I have seen this and liked the look of it so much, I had to grab one.

My question is how I would go about interfacing this with the Arduino? I can see that the device comes with 8 connection pins ( x2 power, x2 ground, X1,X2 and Y1,Y2) but I wasn't sure why there was a second X and Y cable, wouldn't you just need a single value for your X and Y coordinates? How would the Arduino be able to read these values? Am a little clueless here.

Has any one had any experience using this sort of device before or knows about the programming at all? Any information at all would be great to be able to go through.

As always, cheers for the help everyone!

It looks like each axis has a quadrature incremental encoder. Thus the 2 outputs per axis.

chickwolf:
My question is how I would go about interfacing this with the Arduino?

What does the data sheet have to say about the interface?

groundFungus:
It looks like each axis has a quadrature incremental encoder. Thus the 2 outputs per axis.

Sorry for the long today, got a little preoccupied with something else. I read through this article (Thanks for sending that) and have implemented the code within to try and setup a basic communication between the two, but the arduino is not registering the tracker ball as being there for some reason. I have it all hooked up in the same way that the guide says but still nothing. Here is the code I have implemented.

#define inputX1 6
#define inputX2 7


int counter = 0;
int state = 0;
int lastState = 0;

void setup() 
{
  pinMode (inputX1,INPUT);
  pinMode (inputX2,INPUT);

  Serial.begin (115200);

  lastState = digitalRead(inputX1);

}

 void loop() { 
   state = digitalRead(inputX1);
   if (state != lastState){     
     if (digitalRead(inputX2) != state) { 
       counter ++;
     } else {
       counter --;
     }
     Serial.print("Position: ");
     Serial.println(counter);
   } 
   lastState = state;
 }

Any ideas as to where I am screwing this up?

For clarification, I have X1 connected to pin 6, and X2 connected to pin 7

It may sound stupid, but are you sure your trackball is working properly? E.g. by connecting it to another known-good device?

Other than that: are you sure you have the correct wires? Do you have a shared GND connected? Correct supply voltage?

wvmarle:
It may sound stupid, but are you sure your trackball is working properly? E.g. by connecting it to another known-good device?

Other than that: are you sure you have the correct wires? Do you have a shared GND connected? Correct supply voltage?

Not stupid, seems perfectly valid!

The tracker ball came with a small interface device (about halfway down the page on the original web link) which connects between the tracker ball and a micro USB to USB cable, you can use this setup to use the tracker ball as a mouse for a computer, which I have done and has worked.

I have the 5V connection from the Tracker ball connected to the +5 on the Arduino, and grounded aswell.

I found some pictures of the guts of the trackball and must apologize for leading down the wrong path. The encoders appear to be optical encoders like for a mouse wheel (not mechanical). Not sure how to read them.

groundFungus:
I found some pictures of the guts of the trackball and must apologize for leading down the wrong path. The encoders appear to be optical encoders like for a mouse wheel (not mechanical). Not sure how to read them.

Thanks for finding that! I have found a couple of documents related to Quadrature encoding, optical encoding and Arduino's which look to be helpful, cheers for the heads up!

One

Two